Common Fixes

(How To)‘Fix’ some commands not printing (Not recommended though)

  • Open the cl_chat.lua in the chat resource you are experiencing issues with!

  • Find this piece of code:

if data.message:sub(1, 1) == '/' then
      ExecuteCommand(data.message:sub(2))
    else
      TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message)
    end
  • Add This:
TriggerServerEvent('FiveM2Discord:SendWebhookLogs', 'chat', GetPlayerName(id) .. ' [ID: ' .. GetPlayerServerId(id) .. ']', data.message, 'steam', GetPlayerServerId(id), false, true)

in a new line after ExecuteCommand(data.message:sub(2)) to make it look like this:

if data.message:sub(1, 1) == '/' then
      ExecuteCommand(data.message:sub(2))
 	  TriggerServerEvent('FiveM2Discord:SendWebhookLogs', 'chat', GetPlayerName(id) .. ' [ID: ' .. GetPlayerServerId(id) .. ']', data.message, 'steam', GetPlayerServerId(id), false, true)
	else
      TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { r, g, b }, data.message)
    end
  • Save & Profit

Note: not every command resource will use this file/code layout basically what we want to achieve here is make the chat resource communicate with FiveM2Discord’s server event when a command is triggered

  • If you need help please contact me here


About


This site contains Documentation for all of the Toxic Development Discord and FiveM Projects.
Built with using