SetPlayerGravity: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
This example allows the user to type a command to change their gravity: | This example allows the user to type a command to change their gravity: | ||
<syntaxhighlight lang="lua">function consoleSetPlayerGravity ( | <syntaxhighlight lang="lua"> | ||
if ( | function consoleSetPlayerGravity ( thePlayer, commandName, level ) | ||
local success = setPlayerGravity ( | if ( thePlayer and level ) then | ||
local success = setPlayerGravity ( thePlayer, tonumber ( level ) ) -- Sets the gravity | |||
if (not success) then | if (not success) then | ||
outputConsole( "Failed to set player gravity", | outputConsole( "Failed to set player gravity", thePlayer ) -- If it can't be set, this message will show | ||
end | end | ||
end | end |
Revision as of 11:08, 16 August 2007
Description
This function sets the gravity level of a player.
Syntax
setPlayerGravity ( player thePlayer, float level )
Required Arguments
- thePlayer: The player whose gravity to change.
- level: The level of gravity ( default is 0.008 )
Example
Click to collapse [-]
ServerThis example allows the user to type a command to change their gravity:
function consoleSetPlayerGravity ( thePlayer, commandName, level ) if ( thePlayer and level ) then local success = setPlayerGravity ( thePlayer, tonumber ( level ) ) -- Sets the gravity if (not success) then outputConsole( "Failed to set player gravity", thePlayer ) -- If it can't be set, this message will show end end end addCommandHandler ( "setplayergravity", consoleSetPlayerGravity )
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState