[Release] Model Blacklist v1.1

@iNOGAMERTAG
To the people where the blacklist is not working, it might have been that you forgot to include the commas. You need a comma after every model other than the last one.
Here’s a screenshot:
http://cloud.murfasa.com/0x01450M2800/Image%202017-07-24%20at%204.34.20%20PM.png

1 Like

This is breaking the chat for the FxServer. Anyone know why?

is there a tutorial video?

hello, For rhino and RPG ? pls thank you so much !

can someone like me a tutorial please? thanks!

it won’t work for me

I can’t get this to work i’ve done everything it says and i’ve put it so it starts up.

WEAPON_CARBINERIFLE blacklisteds is not worked…

Seems that the PED blacklist is not working for some reason. Weapon blacklist works fine just not Ped/NPC.

same for me ::frowning: WEAPON_CARBINERIFLE not workin.

where do you all gets the names for the weapons, vehicles, and peds. The website i used to use is offline.

Weapon blacklist does not work.

works for me just not “Carbine_Rifle”

Carbine rifle is “WEAPON_CARBINERIFLE”

Could you Screenshot @kry0n what your weaponblacklist is?

Sure thing - Here you go.
https://gyazo.com/d4e2d542632a3155cb60ae0f500a232d

I only have a couple weapons blacklisting. That is my current weapons so far. Mainly need the explosives.

-- CONFIG --

-- Blacklisted weapons
weaponblacklist = {
"WEAPON_GRENADELAUNCHER",
"WEAPON_RPG",
"WEAPON_STINGER",
"WEAPON_MINIGUN",
"WEAPON_GRENADE",
"WEAPON_STICKYBOMB",
"WEAPON_FIREWORK",
"WEAPON_RAILGUN",
"WEAPON_AUTOSHOTGUN",
"WEAPON_COMPACTLAUNCHER",
"WEAPON_PIPEBOMB"
}
 
-- Don't allow any weapons at all (overrides the blacklist)
disableallweapons = false
 
-- CODE --
 
Citizen.CreateThread(function()
    while true do
        Wait(1)
 
        playerPed = GetPlayerPed(-1)
        if playerPed then
            nothing, weapon = GetCurrentPedWeapon(playerPed, true)
 
            if disableallweapons then
                RemoveAllPedWeapons(playerPed, true)
            else
                if isWeaponBlacklisted(weapon) then
                    RemoveWeaponFromPed(playerPed, weapon)
                    sendForbiddenMessage("This weapon is blacklisted!")
                end
            end
        end
    end
end)
 
function isWeaponBlacklisted(model)
    for _, blacklistedWeapon in pairs(weaponblacklist) do
        if model == GetHashKey(blacklistedWeapon) then
            return true
        end
    end
 
    return false
end
1 Like

Yea everything else seems to work that I tried just wont stop the Carbine Rifles.
I can get it stop spawning the prison guards either.

We have a small issue where people like to farm the prison guards for the rifles.
https://gyazo.com/ba461e0f8ba0a9b43a29d2b5a8e1d1be

It appears that this script is defunct, are there any other blacklist scripts available or has anyone managed to update this one?

here is how to blacklist carabineriffle:

-- Blacklisted weapons
weaponblacklist = {
	"WEAPON_RAILGUN",
	"WEAPON_Minigun",
	"WEAPON_GRNLAUNCH",
	"WEAPON_PISTOL",
	"WEAPON_COMBATPISTOL",
	"WEAPON_CARBINERIFLE", --military ak
	"WEAPON_SNIPERRIFLE", --polmav sniper
	"WEAPON_HEAVYSNIPER", -- sniper lourd
	"WEAPON_MARKSMANRIFLE", --snipe automatique
}

-- Don't allow any weapons at all (overrides the blacklist)
disableallweapons = false

-- CODE --

Citizen.CreateThread(function()
	while true do
		Wait(1)

		playerPed = GetPlayerPed(-1)
		if playerPed then
			nothing, weapon = GetCurrentPedWeapon(playerPed, true)

			if disableallweapons then
				RemoveAllPedWeapons(playerPed, true)
			else
				if isWeaponBlacklisted(weapon) then
					RemoveWeaponFromPed(playerPed, weapon)
					sendForbiddenMessage("Cette arme est blacklisté!")
				end
			end
		end
	end
end)

function isWeaponBlacklisted(model)
	for _, blacklistedWeapon in pairs(weaponblacklist) do
		if model == GetHashKey(blacklistedWeapon) or model == 2210333304 then
			return true
		end
	end

	return false
end