I am trying to find a way to check what weapon the player is currently holding and if they are holding a certain weapon it returns a true value for an if statement.
I have tried to use if GetCurrentPedWeapon(ped, weapon) == 1 then
but no matter what weapon you are holding it returns 1.
hi, can you help me with vangolico robbery? i tried to use get player current weapon to start robbery, but when i shoot, robbery won’t start.
here is my code
incircle = true
if GetSelectedPedWeapon(ped) == GetHashKey("weapon_specialcarbine") then
if IsPedShooting(GetPlayerPed(-1)) then
if Config.NeedBag then
if borsa == 40 or borsa == 41 or borsa == 44 or borsa == 45 then
ESX.TriggerServerCallback('esx_vangelico_robbery:conteggio', function(CopsConnected)
if CopsConnected >= Config.RequiredCopsRob then
TriggerServerEvent('esx_vangelico_robbery:rob', k)
PlaySoundFromCoord(soundid, "VEHICLES_HORNS_AMBULANCE_WARNING", pos2.x, pos2.y, pos2.z)
else
TriggerEvent('esx:showNotification', _U('min_two_police') .. Config.RequiredCopsRob .. _U('min_two_police2'))
end
end)
else
TriggerEvent('esx:showNotification', _U('need_bag'))
end
else
ESX.TriggerServerCallback('esx_vangelico_robbery:conteggio', function(CopsConnected)
if CopsConnected >= Config.RequiredCopsRob then
TriggerServerEvent('esx_vangelico_robbery:rob', k)
PlaySoundFromCoord(soundid, "VEHICLES_HORNS_AMBULANCE_WARNING", pos2.x, pos2.y, pos2.z)
else
TriggerEvent('esx:showNotification', _U('min_two_police') .. Config.RequiredCopsRob .. _U('min_two_police2'))
end
end)
end
end
end