Difference between revisions of "Bz getPlayerIPAddress"

From BZFlagWiki
Jump to: navigation, search
m (return -> returns)
(Removed version 2.99.x requirement. Added an example. IPAddress -> IP Address)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{apicall
 
{{apicall
 
| name        = bz_getPlayerIPAddress
 
| name        = bz_getPlayerIPAddress
| description = Returns the player's IPAddress.
+
| description = Returns the player's IP Address.
 
| param1      = playerID
 
| param1      = playerID
 
| param1type  = int
 
| param1type  = int
 
| param1desc  = Player to lookup.
 
| param1desc  = Player to lookup.
| returnType = const char*
+
| returntype = const char*
| returns    = The player's IPAddress.
+
| returns    = The player's IP Address.
| version    = 2.99.x or later
+
 
}}
 
}}
 +
===Example===
 +
Tells the administrators a player has joined with the specified callsign and IP Address. (Even though this data is redundant, this is merely an example.)
 +
case bz_ePlayerJoinEvent: {
 +
bz_sendTextMessagef(BZ_SERVER,eAdministrators,
 +
"%s joined with IP Address %s."
 +
,bz_getPlayerCallsign(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID)
 +
,bz_getPlayerIPAddress(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID));
 +
}break;

Latest revision as of 06:18, 19 October 2011

const char* bz_getPlayerIPAddress (int playerID)


Returns the player's IP Address.

Parameters:
playerID  -  Player to lookup.
Returns:
The player's IP Address.

Example[edit]

Tells the administrators a player has joined with the specified callsign and IP Address. (Even though this data is redundant, this is merely an example.)

case bz_ePlayerJoinEvent: {
	bz_sendTextMessagef(BZ_SERVER,eAdministrators,
		"%s joined with IP Address %s."
		,bz_getPlayerCallsign(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID)
		,bz_getPlayerIPAddress(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID));
}break;