Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Script Help with policejob armory

Kerberos

Gold Elite
Joined
Jun 13, 2021
Messages
64
Reaction score
114
Points
246
Hi all.

I have a policejob with access true rank.
The script worked but i think i messed up something.
So, the deal is, every rank can see what is in the inventory, but only can take what is configured on your level.
The problem is, with different rank it says i can't take the item (that is ok), but with the correct rank, it says nothing but the weapon don't come to my inventory.
Here is the code:

ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'armory_get_weapon',
{
title = _U('get_weapon_menu'),
align = 'top-left',
elements = elements,
},
function(data, menu)
menu.close()
local arma = data.current.value

if (PlayerData.job.grade == 0) then
local flag = false
for i=1, #Config.ArmasPermitidas.Nivel1, 1 do
if (arma == Config.ArmasPermitidas.Nivel1.name) then
flag = true
ESX.TriggerServerCallback('esx_policejob:removeArmoryWeapon', function()
OpenGetWeaponMenu()
end, data.current.value)
end
end
if not flag then
ESX.ShowNotification("Não tens permissão para retirar uma/um " .. ESX.GetWeaponLabel(arma) .."!")
end
end


end,
function(data, menu)
menu.close()
end
)
end)
end


Can you help me ?
Thanks
 
Top