GM/PlayerBindPress
From Garry's Mod
(Difference between revisions)
Robotboy655 (Talk | contribs) |
Robotboy655 (Talk | contribs) m |
||
Line 16: | Line 16: | ||
}} | }} | ||
{{Arg | {{Arg | ||
− | |type= | + | |type=boolean |
|name=pressed | |name=pressed | ||
|desc=If the bind was activated or deactivated | |desc=If the bind was activated or deactivated |
Revision as of 22:59, 1 May 2013
GM:PlayerBindPress( )
Contents |
Description
Runs when a bind has been pressed. Allows to block commands.
Arguments
Player ply
The player who used the command
Arguments
string cmd
The bind command
Arguments
boolean pressed
If the bind was activated or deactivated
Examples
Example
Prevents players from using flashlight.
function GM:PlayerBindPress(ply, bind, pressed) --To block more commands, you could add another line similar to --the one below, just replace the command if string.find(bind, "impulse 100") then return true end end