Gamemode.PlayerBindPress
From GMod Wiki
Event Hook | |
Hook Name | PlayerBindPress |
Syntax | GM:PlayerBindPress( Player player, String bind, Boolean pressed ) |
Description | Runs when a bind has been pressed. |
Returns | Boolean |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=Gamemode.PlayerBindPress]Gamemode.PlayerBindPress [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- To stop a player from being able to alias a command to get around a block, you should search the bind's string instead of comparing it.
This is because an alias just runs the contents of itself when it is called, IE: alias piggy "say Anyone want a doughnut?" would be the exact same as saying that yourself. So, therefore, alias flight "impulse 100" would be blocked regardless of the player using the actual command or the alias.
To check for non-toggle binds ( slot01, toggleconsole, etc. ), you would use the pressed argument since there's the press and unpress states for it.