Welcome to the forum, Guest

To access forum content and all of our services, you must register or log in to the forum. Joining the forum and all content on the forum is completely free.

The world's largest FiveM Forum and GTA 5 Forum address

Hello dear member,
We work 24/7 to provide the most valuable content that will be of use to you,
you can share content and support the entire FiveM & GTA 5 community.

Job Help with policejob armory

Kerberos

Bronze Elite
Joined
Jun 13, 2021
Messages
12
Reaction score
1
Points
96
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
 

Login or register to get more out of the forum!

Login or register to get more out of the forum!

Register

Creating an account on the forum is completely free.

Register now
Log in

If you have an account, please login

Log in

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds