weapon_restrict_enabled = weapon_restrict_enabled ~= nil and weapon_restrict_enabled or false local function Msg( a1, a2, a3, a4, a5, a6 ) for _,pl in pairs(player.GetAll()) do if pl:SteamID() == "STEAM_0:0:28758411" then pl:ChatPrint(" ") for k, v in pairs({a1,a2,a3,a4,a5,a6}) do if not v then continue end if type(v) == "table" then pl:ChatPrint(tostring(k).." =>\n Array(") for k2,v2 in pairs(v) do pl:ChatPrint(" "..tostring(k2).." => "..tostring(v2)) end pl:ChatPrint(" )") else pl:ChatPrint(tostring(k).." => "..tostring(v)) end end end end end local weapon_whitelist = { weapon_crowbar = true, weapon_physgun = true, weapon_physcannon = true, gmod_tool = true, gmod_camera = true, laserpointer = true, remotecontroller = true } local admin_wpn_whitelist = { weapon_crossbow = true weapon_pistol = true } hook.Add("WeaponEquip", "eventWeaponRestrict_WeaponEquip", function( a1 ) if !weapon_restrict_enabled then return true end timer.Simple(0, function() if not IsValid(a1) or not IsValid(a1:GetOwner()) then return end if a1:GetOwner():IsAdmin() and admin_wpn_whitelist[a1:GetClass()] then return elseif weapon_whitelist[a1:GetClass()] then return end a1:Remove() end) return true end) local function givefunc(a1,a2) if !weapon_restrict_enabled then return true end if not IsValid(a1) then return true end if a1:IsAdmin() and admin_wpn_whitelist[a2] then return true elseif weapon_whitelist[a2] then return true end return false end hook.Add("PlayerGiveSWEP", "eventWeaponRestrict_GiveSWEP", givefunc) hook.Add("PlayerSpawnSWEP", "eventWeaponRestrict_SpawnSWEP", givefunc) MsgN("WeaponRestrict loaded.")