[Release] Server Logs to Discord

Yes you can add those

Add this to your resource at the moment the player gives the money and then add in the values

exports.JD_logs:discord('MESSAGE_YOU_WANT_TO_POST_IN_THE_EMBED', 'DECIMAL_COLOR_CODE', 'WEBHOOK_CHANNEL')

like the idea concept of the script, have been trying to set it up but dosent work but the script starts fine. ill keep trying, nice work

1 Like

Hey @JokeDevil, :wave:
you made a very nice release. Keep it up.
:+1:

1 Like

if you need any help you can always ask

1 Like

actually just solved it! it was an error from my part and love the script! nice work

2 Likes

¿can you make it show when the server started and how many users does it have inside? and can the shape of the texts be changed?

my id player is not good on the discord it tells me 65537 in the game i am id 1

Should only be on connecting since you don’t have a player id yet then

I’ll add it to the list :wink:

2 Likes

Currently using 2430 and it didn’t work are they any solutions for not updated servers?

yes, at the beginning, but when disconnecting it shows the true ID

+1 yes i just noticed it

sometimes the discord ID does not work properly does not find the person who shows it to me as his @451760124471853045

sorry for my english fault i’m french

Might happen is someone connects to the server without steam/discord running in the background. Next update I’ll put in a check if the identifier is available before posting

1 Like

It’s because there is no sever I’d existing when the at the point op connecting. This will be available after the player has spawned

First of all good release men!

Can we you add like thise events

  • Bank transfer
  • Money transfer between players
  • Item dropping
  • Item transfer

Like this things>? that will be nice :smiley:

2 Likes

You already can do this with the script. It has an export function :wink:

yeah agree

1 Like

Okay lets try then

Its this export right on this code?

RegisterServerEvent('bank:transfer')
AddEventHandler('bank:transfer', function(to, amountt)
    local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)
    local zPlayer = ESX.GetPlayerFromId(to)
    local balance = 0
    local nameFrom = getIdentity(_source).firstname .. ' ' .. getIdentity(_source).lastname
    local nameTo = getIdentity(to).firstname .. ' ' .. getIdentity(to).lastname
    if zPlayer ~= nil then
        balance = xPlayer.getAccount('bank').money
        zbalance = zPlayer.getAccount('bank').money
        if tonumber(_source) == tonumber(to) then
            -- advanced notification with bank icon
            TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank',
                               'Maak geld over',
                               'Je kan geen geld naar je eigen rekening zenden',
                               'CHAR_BANK_MAZE', 9)
        else
            if balance <= 0 or balance < tonumber(amountt) or tonumber(amountt) <=
                0 then
                -- advanced notification with bank icon
                TriggerClientEvent('esx:showAdvancedNotification', _source,
                                   'Bank', 'Geld overmaken',
                                   'Niet genoeg geld om over te maken',
                                   'CHAR_BANK_MAZE', 9)
            else
                xPlayer.removeAccountMoney('bank', tonumber(amountt))
                zPlayer.addAccountMoney('bank', tonumber(amountt))
                -- advanced notification with bank icon
                TriggerClientEvent('esx:showAdvancedNotification', _source,
                                   'Bank', 'Geld overmaken',
                                   'Je hebt geld overgemaakt: ~r~€' .. amountt ..
                                       '~s~ naar ~r~' .. nameTo,
                                   'CHAR_BANK_MAZE', 9)
                TriggerClientEvent('esx:showAdvancedNotification', to, 'Bank',
                                   'Transfer Money', 'Je hebt geld ontvangen ~r~€' ..
                                       amountt .. '~s~ van ~r~' .. nameFrom, 
                                       'CHAR_BANK_MAZE', 9)
                exports.JD_logs:discord('**' .. nameFrom .. 'Maakt' .. amount .. 'geld over naar' .. nameTo .., '1752220', 'banktransfer')
            end

        end
    end

end)
1 Like