Jump to content
Fivem-DEV.cz
Sign in to follow this  
BzZz

[WEBHOOK ] Log zbraní z frakčního skladu

Recommended Posts

VÝBĚR ZBRANÍ

  1. Otevřete si esx_policejob/server/main.lua
  2. Vyhledejte si event: ESX.RegisterServerCallback('esx_policejob:removeArmoryWeapon'
  3. Hned pod tímto řádkem naleznete tuto část: 
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.addWeapon(weaponName, 500)
  4. Vložte mezi tyto dva řádky kód s webhookem. Nezapomeňte změnit odkaz na váš discord. Kód poté bude vypadat následovně: 
    local xPlayer = ESX.GetPlayerFromId(source)
        local connect = {
                    {
                        ["color"] = "16718105",
                        ["title"] = GetPlayerName(source).." (".. xPlayer.identifier ..")",
                        ["description"] = "📤 Vybral zbraň: **"..weaponName.."** z policejního skladu.",
                        ["footer"] = {
                        ["text"] = os.date('%H:%M - %d. %m. %Y', os.time()),
                        ["icon_url"] = "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/271/honeybee_1f41d.png",
                        },
                    }
                }
    
    PerformHttpRequest("https://discord.com/api/webhooks/729100729960112345/RL6MlpbFkKSIVeOM1w_FCvKlc2ivPboPAmjSvDzE5UKYh5hl5nzAMHwfr1Q0RE12345", function(err, text, headers) end, 'POST', json.encode({username = "Policie - Zbrojnice - Logger", embeds = connect}), { ['Content-Type'] = 'application/json' })
    
    xPlayer.addWeapon(weaponName, 500)

    _______________________________________________________________________________________________________

ULOŽENÍ ZBRANĚ

  1. Otevřete si např. esx_policejob/server/main.lua
  2. Vyhledejte si event: ESX.RegisterServerCallback('esx_policejob:addArmoryWeapon'
  3. Hned pod tímto řádkem naleznete tuto část:
    local xPlayer = ESX.GetPlayerFromId(source)
    
        if removeWeapon then
            xPlayer.removeWeapon(weaponName)
        end

     

  4. Vložte mezi řádek if removeWeapon then a xPlayer.removeWeapon(weaponName) kód s webhookem. Nezapomeňte změnit odkaz na váš discord. Kód poté bude vypadat následovně:
    local xPlayer = ESX.GetPlayerFromId(source)
            if removeWeapon then
          local connect = {
                    {
                        ["color"] = "628480",
                        ["title"] = GetPlayerName(source).." (".. xPlayer.identifier ..")",
                        ["description"] = "📥 Vložil zbraň: **"..weaponName.."** do policejního skladu.",
                        ["footer"] = {
                        ["text"] = os.date('%H:%M - %d. %m. %Y', os.time()),
                        ["icon_url"] = "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/271/honeybee_1f41d.png",
                        },
                    }
                }
            PerformHttpRequest("https://discord.com/api/webhooks/729100729960112345/RL6MlpbFkKSIVeOM1w_FCvKlc2ivPboPAmjSvDzE5UKYh5hl5nzAMHwfr1Q0RE12345", function(err, text, headers) end, 'POST', json.encode({username = "Policie - Zbrojnice - Logger", embeds = connect}), { ['Content-Type'] = 'application/json' })
            
    xPlayer.removeWeapon(weaponName)
    end

     

 

Edited by BzZz
  • Like 5
  • Vážně ? řekni nám ještě otom víc. 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Our partners

rcore.cz
K4mb1
SLTH
×
×
  • Create New...