Ulysses

General => Developers Corner => Topic started by: Moka on October 23, 2012, 07:24:05 PM

Title: Blocking a weapon/'s...
Post by: Moka on October 23, 2012, 07:24:05 PM
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.
Title: Re: Blocking a weapon/'s...
Post by: MulleDK13 on October 24, 2012, 04:08:58 PM
If you want to prevent all weapons from being used just set the regular gmod convar sbox_weapons to 0.
Title: Re: Blocking a weapon/'s...
Post by: Moka on October 30, 2012, 09:35:23 AM
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.
Title: Re: Blocking a weapon/'s...
Post by: iSnipeu on October 31, 2012, 03:53:37 AM
Code: [Select]
hook.Add("PlayerGiveSWEP", "BlockWeapons", function()
return ply:IsAdmin()
end)

hook.Add("PlayerSpawnSWEP", "BlockWeapons", function()
return ply:IsAdmin()
end)
Title: Re: Blocking a weapon/'s...
Post by: Moka on November 01, 2012, 08:12:42 PM
Cool i will try this out. Thanks!