IsPlayerInWater
Jump to navigation
Jump to search
This article needs checking. | |
Reason(s): bool isPlayerOnGround ( player thePlayer ) ... Shouldn't clientside also have player theplayer in the brackets here?--Ransom 08:50, 19 September 2007 (CDT) |
This function is used to determine whether or not a player is currenlty in water.
Syntax
Click to collapse [-]
Serverbool isPlayerInWater ( player thePlayer )
Required Arguments
- thePlayer: The player you are checking.
Returns
Returns true if the player is in water, false otherwise.
Click to collapse [-]
Clientbool isPlayerInWater ( )
Returns
Returns true if the player is in water, false otherwise.
Example
This example shows all players that are in water in a list to the player who enters the 'playersInWater' command.
[lua] 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
- 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