I have problem with disabling weapon spawning. I have used the same method to disable entity, npc and vehicle spawning, however it is not working for sweps. Here is the code.
[lua]
function NoWeapons( ply, weapon, info )
return false;
end
hook.Add( "PlayerSpawnSWEP", "NoWeapons", NoWeapons );
[/lua]
This is located in my init.lua so it is being run serverside like it is meant too.
Any help would be appreciated, thank you.
There are two hooks for SWEPS, SpawnSWEP and GiveSWEP, SpawnSWEP called when you mouse3(mouse wheel) click on an icon, GiveSWEP called when you simply click on the icon.
[QUOTE=Robotboy655;41739060]There are two hooks for SWEPS, SpawnSWEP and GiveSWEP, SpawnSWEP called when you mouse3(mouse wheel) click on an icon, GiveSWEP called when you simply click on the icon.[/QUOTE]
Thank you very much! I got the anti weapon spawning to work. Seems the wiki page on the hookGamemode.PlayerSpawnSWEP is wrong. The description is 'Called when a player wants to spawn a SWEP' :P
Thanks again!
[QUOTE=HappyGhetto;41739384]Thank you very much! I got the anti weapon spawning to work. Seems the wiki page on the hookGamemode.PlayerSpawnSWEP is wrong. The description is 'Called when a player wants to spawn a SWEP' :P
Thanks again![/QUOTE]
No, the wiki got it correct, I edited those 2 pages anyway, so it should be less confusing.
Sorry, you need to Log In to post a reply to this thread.