Player.GetCurrentCommand

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:GetCurrentCommand( )
Description:
Retuns the current CUserCmd.
Returns: CUserCmd
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.GetCurrentCommand]Player.GetCurrentCommand [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis will print if the player has the +attack key pressed.
Used onNewerServer.png
Code
function GM:SetupMove(ply, movedata)
	local cmd = ply:GetCurrentCommand()
	print(cmd:KeyDown(IN_ATTACK))
end
OutputTrue if the +attack key is down, false if it is not.


Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox