SetGravity: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
==Description==
==Description==
This function sets the servers gravity level. Note that this does not effect players and their vehicles; to set player gravity use [[setPlayerGravity]].
This function sets the server's gravity level. Note that this does not effect players and their vehicles; to set player gravity use [[setPlayerGravity]].


==Syntax==
==Syntax==
Line 7: Line 8:


===Required Arguments===
===Required Arguments===
*'''level''': The level of gravity ( default is <b>0.008</b> )
*'''level''': The level of gravity ( default is '''0.008''' )


==Example==
==Example==
<syntaxhighlight lang="lua">addCommandHandler ( "setgravity", "grav" )
<syntaxhighlight lang="lua">
function grav ( source, command, gravid )
function grav ( sourcePlayer, command, level )
     setGravity ( gravid )
     setGravity ( tonumber(level) )
end</syntaxhighlight>
end
addCommandHandler ( "setgravity", grav )
</syntaxhighlight>


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Revision as of 11:47, 16 August 2007

Description

This function sets the server's gravity level. Note that this does not effect players and their vehicles; to set player gravity use setPlayerGravity.

Syntax

setGravity ( float level )

Required Arguments

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

Example

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

See Also