GetLocalPlayer

From Multi Theft Auto: Wiki
Revision as of 23:37, 28 February 2007 by Jbeta (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the player element of the client running the current script.

Syntax

player getLocalPlayer ()

Returns

Returns a player element.

Example

This clientside function outputs the player's current location to the console.

function outputPOS ()
	--we get the player element
	local player = getLocalPlayer ()
	--we get the player's position
	local px, py, pz = getPlayerPosition ( player )
	--we output it to the console
	outputConsole ( "Your location: "..px.." "..py.." "..pz )
	end
end

See Also