General > Developers Corner

Blocking a weapon/'s...

(1/1)

Moka:
I used to have URS on my server but seeing as Garry's Mod  13 is about to be released and URS has not been updated yet I was wondering if anyone knew a function to block those HL2 weapons. I cant figure out where the files are for the guns that are in the spawn menu are so I had to resort to this. I cant really do any porting as I am not the best at Lua do if any of you could possibly send me a function to block a weapon it would be greatly appreciated.

MulleDK13:
If you want to prevent all weapons from being used just set the regular gmod convar sbox_weapons to 0.

Moka:
I have that set to false but people can still spawn weapons in the spawn menu. But seeing as the addon for the guns are no longer in the addons folder i am having trouble finding them to set them as admin only if possible.

iSnipeu:

--- Code: ---hook.Add("PlayerGiveSWEP", "BlockWeapons", function()
return ply:IsAdmin()
end)

hook.Add("PlayerSpawnSWEP", "BlockWeapons", function()
return ply:IsAdmin()
end)

--- End code ---

Moka:
Cool i will try this out. Thanks!

Navigation

[0] Message Index

Go to full version