DoesPlayerHaveJetPack
Jump to navigation
Jump to search
This function is used to determine whether or not a player has a jetpack.
Syntax
bool doesPlayerHaveJetPack ( player thePlayer )
Required Arguments
- thePlayer: The player you are checking.
Returns
Returns true if a player has a jetpack, false otherwise.
Example
This examples adds a "jetpack" command in console, which gives and removes jetpacks.
[lua] function consoleJetPack ( player, commandName ) if ( not doesPlayerHaveJetPack ( player ) ) then --if the player doesnt have a jetpack local status = givePlayerJetPack ( player ) --give him one if ( not status ) then outputConsole ( "Failed to give jetpack.", player )--tell him if it failed end else --otherwise local status = removePlayerJetPack ( player ) --remove his jetpack if ( not status ) then outputConsole ( "Failed to remove jetpack.", player ) --tell him if it faield end end end addCommandHandler ( "jetpack", consoleJetPack )
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