[Release] Server Logs to Discord

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)

sorry this one should not give that error

hello possible to add the ip of the players at the time of connection


Did you know how to fix the issue? And how to change discord to discord id?

Is there any way to help me create an aim log ???(when somebody pulls out a weapon)

i dont understand where i will put this

exports.JD_logs:discord(‘MESSAGE_YOU_WANT_TO_POST_IN_THE_EMBED’, PLAYER_ID, PLAYER_2_ID, ‘DECIMAL_COLOR_CODE’, ‘WEBHOOK_CHANNEL’)

i want to get a logs everytime they give / trade and give money

Not Custom Logs in TRADE AND DROP LOGS
MONEY TRASFER

Example . Player 1 Give Assault Riffle to Player 2 - it will give there steam

You can use the export function in the resource where you give items

can you please guide me… where should i put that export?

i cannot test it because im using my test server

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

The export function should be posted in the command/function you want to be logged.

As far as I know, there is no one that made a video yet. i might make one myself someday.

1 Like

Ok, let me know if you do that.
Thanks again

Nice release!I want to add resource logs to other webhook-channel and i did it but its not working!
What i did false?

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.

okay thnxx

https://gyazo.com/54a20341134dfc11390d86e096d24fb7 that gap between “TozyHD installerede nitro” and “Player ID: 1”, how to i delete that so there is no gap?

Find this in server/server.lua line 142

local player1 = message..'\n'.._playerID..''.. _postal ..''.. _discordID..''.._steamID..''.._steamURL

Change it to this

local player1 = message..''.._playerID..''.. _postal ..''.. _discordID..''.._steamID..''.._steamURL

hey how do i add logging IP addresses to the connection and disconnecting logs??

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

I am trying to exclude one specific channel from logging to the “all” chat, while the other channels still do.
Is there a way to do it?

1 Like