This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.
Bz getPlayerIPAddress: Difference between revisions
Jump to navigation
Jump to search
Added bz_getPlayerIPAddress |
Removed version 2.99.x requirement. Added an example. IPAddress -> IP Address |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{apicall | {{apicall | ||
| name = bz_getPlayerIPAddress | | name = bz_getPlayerIPAddress | ||
| description = Returns the player's | | 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* | ||
| returns = The player's IP Address. | |||
}} | }} | ||
===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
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;