Author Topic: Blocking a weapon/'s...  (Read 3692 times)

0 Members and 2 Guests are viewing this topic.

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Blocking a weapon/'s...
« 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.

Offline MulleDK13

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Blocking a weapon/'s...
« Reply #1 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.

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: Blocking a weapon/'s...
« Reply #2 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.

Offline iSnipeu

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 12
Re: Blocking a weapon/'s...
« Reply #3 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)

Offline Moka

  • Newbie
  • *
  • Posts: 19
  • Karma: 0
Re: Blocking a weapon/'s...
« Reply #4 on: November 01, 2012, 08:12:42 PM »
Cool i will try this out. Thanks!