GetPlayerGravity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Visual improvement)
Line 1: Line 1:
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
{{Deprecated}}
{{DeprecatedWithAlt|getPedGravity|}}
 
Please use [[getPedGravity]]


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

Revision as of 14:27, 25 June 2014

Template:DeprecatedWithAlt

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 ( thePlayer )
	local gravity = getPlayerGravity ( thePlayer )
	outputChatBox ( "Your gravity: " .. tostring(gravity), thePlayer )
end
addCommandHandler ( "showGravity", showGravity )

See Also