Gamemode.PlayerGiveSWEP
From GMod Wiki
Revision as of 00:24, 23 March 2010 by Crazy Quebecer (Talk | contribs)
Event Hook | |
Hook Name | PlayerGiveSWEP |
Syntax | GM:PlayerGiveSWEP( Player player, String class, Table weapon ) |
Description | Called when a player tries to give themselves a SWEP. |
Returns | Nil |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=Gamemode.PlayerGiveSWEP]Gamemode.PlayerGiveSWEP [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Stops players giving themselves SWEPs. |
---|---|
Used on | |
Code | function GM:PlayerGiveSWEP( ply, class, wep ) return false end |
Output | N/A |
Description | Only allows admins to give themselves SWEPs. |
---|---|
Used on | |
Code | hook.Add("PlayerGiveSWEP", "AdminOnlySWEPs", function( ply, class, wep ) return ply:IsAdmin() end) |
Output | N/A |