RU/getGravity

From Multi Theft Auto: Wiki
Revision as of 17:07, 6 March 2010 by PoliticalOrel (talk | contribs) (Created page with '__NOTOC__ {{RU/Server client function}} This function returns the current gravity level for the context in which it is called (server or client). ==Syntax== <syntaxhighlight lang="lua"> float …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns the current gravity level for the context in which it is called (server or client).

Syntax

float getGravity()

Returns

Returns a float with the current server or client (depending on where you call the function) gravity level.

Example

Click to collapse [-]
Server

This serverside command outputs the serverside gravity level.

function getGravityLevel( playerSource )
    local gravity = getGravity ( )
    outputConsole ( "The gravity is currently set to " .. gravity, playerSource )
end
-- attach the 'getGravityLevel' function to the "gravity" command
addCommandHandler ( "gravity", getGravityLevel )

Примечание