IsPlayerInWater
From Multi Theft Auto: Wiki
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use isPedInWater instead. |
This function is used to determine whether or not a player is currently in water. Player is in water only if breath bar appears.
Syntax
bool isPlayerInWater ( player thePlayer )
Required Arguments
- thePlayer: The player you are checking.
Returns
Returns true if the player is in water, false otherwise.
Example
Click to collapse [-]
Serverside exampleThis example shows all players that are in water in a list to the player who enters the 'playersInWater' command.
function showPlayersInWater(sourcePlayer, command) local players = getElementsByType("player") local list = "" for k,v in ipairs(players) do if isPlayerInWater(v) then list = list .. " " .. getClientName(v) end end outputChatBox("Players pretending to be trouts: " .. list, sourcePlayer) end addCommandHandler("playersInWater", showPlayersInWater)
See Also
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
FROM VERSION 1.5.7 r19626 ONWARDS
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
FROM VERSION 1.5.7 r19626 ONWARDS
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerMoney
- takePlayerScreenShot