SetGravity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
This function sets the server's gravity level.
This function sets the server's gravity level.


'''Note''' that this does not effect peds/players; to set ped/player gravity use [[setPedGravity]].
'''Note:''' that this does not effect peds/players; to set ped/player gravity use [[setPedGravity]].


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">setGravity ( float level )</syntaxhighlight>
<syntaxhighlight lang="lua">bool setGravity ( float level )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''level''': The level of gravity ( default is '''0.008''' )
*'''level''': The level of gravity (default is '''0.008''').
 
===Returns===
Returns ''true'' if gravity was changed, ''false'' otherwise.


==Example==
==Example==

Revision as of 14:29, 1 April 2010

This function sets the server's gravity level.

Note: that this does not effect peds/players; to set ped/player gravity use setPedGravity.

Syntax

bool setGravity ( float level )

Required Arguments

  • level: The level of gravity (default is 0.008).

Returns

Returns true if gravity was changed, false otherwise.

Example

function grav ( sourcePlayer, command, level )
    setGravity ( tonumber(level) )
end
addCommandHandler ( "setgravity", grav )

See Also