I need help making specific jobs not be able to not drop specific weapons. (DarkRP)
2 replies, posted
M.Config.DisallowDrop = {
["arrest_stick"] = true,
["door_ram"] = true,
["gmod_camera"] = true,
["gmod_tool"] = true,
["keys"] = true,
["lockpick"] = true,
["med_kit"] = true,
["pocket"] = true,
["stunstick"] = true,
["unarrest_stick"] = true,
["weapon_keypadchecker"] = true,
["weapon_physcannon"] = true,
["weapon_physgun"] = true,
["weaponchecker"] = true,
["weapon_arc_atmcard"] = true,
}
How do I make this for specific jobs?
[lua]
hook.Add("CanDropWeapon", "example", function(ply, weapon)
if not IsValid(weapon) then return end
local class = weapon:GetClass()
class = string.lower(class)
-- The player spawns with this weapon
if RPExtraTeams[ply:Team()] and table.HasValue(RPExtraTeams[ply:Team()].weapons, class) then
return false
end
-- Return nothing otherwise to take the default (by default things like pocket and keys can't be dropped)
end)
[/lua]
Code from [I][url]http://wiki.darkrp.com/index.php/DarkRP.CanDropWeapon[/url][/I]
ok, thank you.
Sorry, you need to Log In to post a reply to this thread.