Fixes Documentation regarding fixing known issues
Here is a list of common issues and things you can do to attempt to resolve them
prior to contacting us for support.
Commands not printing
(How To)'Fix' some commands not printing to discord
WARNING
in most cases this is not recommended and 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 webhook event
when a command is triggered
Open the chat resourceFind and open the the cl_chat.lua in the chat resource you are experiencing issues with!
Locate the following codeif data.message: sub ( 1 , 1 ) == '/' then
ExecuteCommand (data.message: sub ( 2 ))
else
TriggerServerEvent ( '_chat:messageEntered' , GetPlayerName (id), { r, g, b }, data.message)
end
Replace it with thisif 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
additionally you can use exports instead of triggering a event which would look something like this:
if data.message: sub ( 1 , 1 ) == '/' then
ExecuteCommand (data.message: sub ( 2 ))
exports[ 'fivem2discord' ]: SendWebhookLogs ( 'chat' , GetPlayerName (id) .. ' [ID: ' .. GetPlayerServerId (id) .. ']' , data.message, 'steam' , GetPlayerServerId (id), true )
else
TriggerServerEvent ( '_chat:messageEntered' , GetPlayerName (id), { r, g, b }, data.message)
end
Save and profitSave your changes and restart your server.