Gamemode.PlayerShouldAct

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerShouldAct
SyntaxGM:PlayerShouldAct( Player ply, String actname, Number actid )
DescriptionCalled when a client "acts" and checks the server wether it can or not.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerShouldAct]Gamemode.PlayerShouldAct [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionAllows the player to act.
Used onNewerServer.png
Code
 
function GM:PlayerShouldAct( ply, actname, actid )
	return true	
end
 
OutputThe player will be able to perform actions.

DescriptionHook version.
Used onNewerServer.png
Code
 
function ShouldAct( ply, actname, actid )
	return true
end
hook.Add( "PlayerShouldAct", "CanAct", ShouldAct );
 
OutputThe player will be able to perform actions.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox