Gamemode.SetupMove

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameSetupMove
SyntaxGM:SetupMove( Player Player, Cmovedata Movedata )
DescriptionSetupMove is called before the engine process movements. This allows us to override the players movement.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.SetupMove]Gamemode.SetupMove [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis example makes some admin-only rocket boots.
Used onNewerServer.png
Code
function mySetupMove(ply, mv)
	if (ply:KeyDown(IN_WALK) and ply:IsAdmin() ) then
		mv:SetVelocity( ply:GetAimVector() * 500 )
	end
end
hook.Add("SetupMove", "mySetupMove", mySetupMove)
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox