Hi so i have gotten my blacklist working for all the vehicles and weapons that i want but the weapons im having trouble with the RPG and Grenade launcher WEAPON_RPG and WEAPON_GRENADELAUNCHER, Any help please?
Something along these lines will work- it’s not been tested but should do the job, it’ll remove the weapon from the PED if it has that weapon in it’s hand at any point
local barred_weapons = {'WEAPON_RPG', 'WEAPON_GRENADELAUNCHER'}
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for k, v in pairs(barred_weapons) do
if GetSelectedPedWeapon(GetPlayerPed(-1)) == GetHashKey(v) then
RemoveWeaponFromPed(GetPlayerPed(-1), GetHashKey(v))
TriggerEvent('chatMessage', 'SERVER', {255,0,0} 'Use of this weapon is not permitted!')
end
end
end
end)
1 Like