GM/PlayerBindPress

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
m
Line 7: Line 7:
 
{{Arg
 
{{Arg
 
|type=Player
 
|type=Player
|name=ply
+
|name=player
 
|desc=The player who used the command
 
|desc=The player who used the command
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=string
 
|type=string
|name=cmd
+
|name=sBind
 
|desc=The bind command
 
|desc=The bind command
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=boolean
 
|type=boolean
|name=pressed
+
|name=bActivated
 
|desc=If the bind was activated or deactivated
 
|desc=If the bind was activated or deactivated
 
}}
 
}}

Revision as of 23:41, 4 November 2013

 GM:PlayerBindPress( )

Contents

Description

Runs when a bind has been pressed. Allows to block commands.

Arguments

Player player

The player who used the command

Arguments

string sBind

The bind command

Arguments

boolean bActivated

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


Personal tools
Navigation