RemovePlayerJetPack: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
This example adds a "jetpack" command in console, which allows toggling of a jetpack. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function jetPackCommand ( source, key ) | function jetPackCommand ( source, key ) |
Revision as of 15:50, 30 August 2007
This function is used to remove a player's jetpack.
Syntax
bool removePlayerJetPack ( player thePlayer )
Required Arguments
- thePlayer: The player you want to remove the jetpack from.
Returns
Returns true if the player had a jetpack, false otherwise.
Example
This example adds a "jetpack" command in console, which allows toggling of a jetpack.
function jetPackCommand ( source, key ) if ( doesPlayerHaveJetPack ( source ) ) then -- if the player has a jetpack removePlayerJetPack ( source ) -- remove it else givePlayerJetPack ( source ) -- otherwise give him one end end addCommandHandler ( "jetpack", jetPackCommand )
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