IsPlayerInWater: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
{{Deprecated}} | |||
This function is used to determine whether or not a player is currently in water. Player is in water only if breath bar appears. | This function is used to determine whether or not a player is currently in water. Player is in water only if breath bar appears. | ||
Revision as of 14:19, 20 January 2009
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does. | |
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
Click to collapse [-]
Server and clientbool 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.
[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