AddEventHandler('chatMessage', function(source, color, msg)
cm = stringsplit(msg, " ")
if cm[1] == "/pm" or cm[1] == "/privatemessage" then
CancelEvent()
if tablelength(cm) > 1 then
local ptid = tonumber(cm[2])
local player2 = GetPlayerName(ptid)
local player1 = GetPlayerName(source)
local msgVar = {}
local textmsg = ""
for i=1, #cm do
if i ~= 1 and i ~= 2 then
textmsg = (textmsg .. " " .. tostring(cm[i]))
end
end
TriggerClientEvent('simp:textmsg', ptid, source, textmsg, player2, player1)
TriggerClientEvent('simp:textsent', source, ptid, player2, textmsg)
-- To send a log you can use the export function:
-- exports.JD_logs:discord('MESSAGE_YOU_WANT_TO_POST_IN_THE_EMBED', PLAYER_ID, PLAYER_2_ID, 'DECIMAL_COLOR_CODE', 'WEBHOOK_CHANNEL')
exports.JD_logs:discord(player1..' Send a PM to '..player2..'\nMessage: '..textmsg, source, ptid, '3241202', 'privatemessages')
end
end
end)
Hi, first of all thanks for this awsome script. Then, do you know if somebody has made a video teaching how to use the export function? I´m really new on it and canât understand much
First of all. Not a smart idea posting webhooks here,
Second, all logs will always send to the âallâ channel.
But youâre able to set a second channel for logs if you want to split them.
Hello, I have implemented something like this in my es_extended / server / main.lua.
RegisterNetEvent(âesx:removeInventoryItemâ)
AddEventHandler(âesx:removeInventoryItemâ, function(type, itemName, itemCount)
local playerId = source
local xPlayer = ESX.GetPlayerFromId(source)
if type == 'item_standard' then
if itemCount == nil or itemCount < 1 then
xPlayer.showNotification(_U('imp_invalid_quantity'))
exports.JD_logs:discord(xPlayer..' prĂłbuje upuĹciÄ '..itemName..' ,ale wpisuje niepoprawnÄ kwotÄ', source, 0, '3241202', 'all')
Unfortunately, something does not work for me ⌠I do not receive JD_Logs, es_extended errors on the server and client side. Nothing is displayed on the corresponding Discord channel, except for messages about the playerâs connection to the server. Could you please help me solve this?
I will add that I have set all logs to be sent to one channel (all)
On the other hand, I would like to thank you for such a great JD_Logs script, best regards and waiting for your help