Add a custom weapon on OX Inventory
Last updated
SetCurrentPedWeapon(playerPed, data.hash, true)
SetPedCurrentWeaponVisible(playerPed, true, false, false, false)local weaponAddons = {
'WEAPON_MEGAPHONE',
'WEAPON_PEPPERSPRAY',
'WEAPON_ANTIDOTE',
'WEAPON_BOLAWRAP',
'WEAPON_SPREADER',
'WEAPON_CUTTER',
'WEAPON_GLASSMASTER',
'WEAPON_GRENADE_SMOKE',
'WEAPON_GRENADE_STUN',
'WEAPON_GRENADE_TEARGAS'
}
local function isWeaponAddons(hash)
for _,v in pairs(weaponAddons) do
if hash == GetHashKey(v) then
return true
end
end
return false
end
if not isWeaponAddons(data.hash) then
SetCurrentPedWeapon(playerPed, data.hash, true)
SetPedCurrentWeaponVisible(playerPed, true, false, false, false)
end