GetPlayerIP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→See Also) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server function}} | {{Server function}} | ||
This function returns a [[string]] containing the IP address of the [[player]]. | |||
This function returns a string containing the IP address of the | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getPlayerIP ( | string getPlayerIP ( player thePlayer ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[player]]:getIP|ip|}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
* ''' | * '''thePlayer:''' The [[player]] element you want to get the IP of. | ||
===Returns=== | ===Returns=== | ||
Returns a string containing the requested | Returns a [[string]] containing the requested players's IP, or ''false'' if the player passed to the function is invalid. | ||
==Example== | ==Example== | ||
This example prints a player's IP to the chat. | This example prints a player's IP to the chat. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function printIp(thePlayer) | function printIp ( thePlayer ) | ||
outputChatBox("IP: "..getPlayerIP(thePlayer), thePlayer) | outputChatBox ( "IP: " .. getPlayerIP ( thePlayer ), thePlayer ) | ||
end | end | ||
addCommandHandler ( "ip", printIp ) | |||
addCommandHandler("ip", printIp) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions|server}} | ||
[[de:getPlayerIP]] | |||
[[ru:getPlayerIP]] |
Latest revision as of 22:42, 6 September 2024
This function returns a string containing the IP address of the player.
Syntax
string getPlayerIP ( player thePlayer )
OOP Syntax Help! I don't understand this!
- Method: player:getIP(...)
- Variable: .ip
Required Arguments
- thePlayer: The player element you want to get the IP of.
Returns
Returns a string containing the requested players's IP, or false if the player passed to the function is invalid.
Example
This example prints a player's IP to the chat.
function printIp ( thePlayer ) outputChatBox ( "IP: " .. getPlayerIP ( thePlayer ), thePlayer ) end addCommandHandler ( "ip", printIp )
See Also
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerCount
- getPlayerIdleTime
- getPlayerIP
- getPlayerVersion
- getRandomPlayer
- isPlayerMuted
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerMuted
- setPlayerScriptDebugLevel
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerScreenShot
- Shared
- 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