GetPlayerGravity

From Multi Theft Auto: Wiki
Revision as of 22:38, 29 July 2007 by Driver2 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns a float that contains the current gravity for the specified player.

Syntax

float getPlayerGravity ( player thePlayer )

Required Arguments

  • thePlayer: The player whose gravity you want to check

Returns

Returns a float indicating the player's gravity, or false if the player is invalid. Default value is 0.008.

Example

This example outputs the gravity of the player who entered the 'showGravity' command.

function showGravity( player )
	local gravity = getPlayerGravity(player)
	outputChatBox("Your gravity: "..tostring(gravity),player)
end
addCommandHandler("showGravity", showGravity)

See Also