Difference between revisions of "SetGravity"

From Multi Theft Auto: Wiki
m
m
Line 4: Line 4:
  
 
'''Note:''' This does not effect peds/players; to set ped/player gravity use [[setPedGravity]].
 
'''Note:''' This does not effect peds/players; to set ped/player gravity use [[setPedGravity]].
 +
 +
'''Note:''' Setting the gravity level to different values on clients can cause animation bugs (players floating across ground because players see different fall animation.)
  
 
==Syntax==
 
==Syntax==

Revision as of 21:47, 20 July 2013

This function sets the server's gravity level.

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

Note: Setting the gravity level to different values on clients can cause animation bugs (players floating across ground because players see different fall animation.)

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