• Restrict HL2 Weapons from being spawned in Sandbox
    2 replies, posted
I've been trying to get this to work for quite some time now. The server I play on as a lot of people who just randomly join to shoot people, noclip around, and just annoy people who are actually trying to build. We set sbox_weapons off, but we forgot that people could just spawn in weapons from the weapons tab. It's become a great annoyance since neither of us can find out how exactly to remove or restrict them. I thought of setting it so only admins can spawn them, but I cannot for the life of me find any files related to the weapons spawnlist. I found a section within the lua folder pertaining to the weapons, but it only has the Flechette gun in it. I tried even setting it so you would spawn with the weapons, but with no ammo. This would have meant you would have the weapons no matter what, but you could never get ammo since the server had maxsents set to 0, but that sadly did not work. I tried googling it, searching facepunch, and I cannot seem to find anyone else who has asked the same question.
[code] hook.Add("PlayerGiveSWEP", "AdminOnlySWEPs", function( ply, class, wep ) return ply:IsAdmin() end) [/code] [url]http://wiki.garrysmod.com/page/SANDBOX/PlayerGiveSWEP[/url]
Ah, thank you so much. I didn't even think about looking at the wiki for it.
Sorry, you need to Log In to post a reply to this thread.