This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz getPlayerCallsign"

From BZFlagWiki
Jump to: navigation, search
(New page: {{BZFS_API_Doc}}{{BZFS_API_Funcs}} ==Prototype== BZF_API const char* bz_getPlayerCallsign( int playerID ); ==Parameters== ; int playerID : The player ID to lookup ==Return Value== A poi...)
 
(Removed old format and replaced with consistent template, included example.)
 
Line 1: Line 1:
{{BZFS_API_Doc}}{{BZFS_API_Funcs}}
+
{{apicall
==Prototype==
+
| name          = bz_getPlayerCallsign
BZF_API const char* bz_getPlayerCallsign( int playerID );
+
| returns      = A string containing the callsign of the requested player.
 
+
| returntype    = const char*
 
+
| description  = Retrieves the callsign of a player.
==Parameters==
+
| param1        = playerID
; int playerID : The player ID to lookup
+
| param1type    = int
 
+
| param1desc    = The ID of the player to get the callsign for.
==Return Value==
+
}}
A pointer to the static string of the player's current callsign.
+
===Example===
 
+
Display the player's name upon joining.
==Description==
+
case bz_ePlayerJoinEvent: {
This function uses the same MD5 logic as BZFS.
+
bz_sendTextMessagef(BZ_SERVER,((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,
 
+
"Hello %s, thanks for joining this server."
==Version==
+
,bz_getPlayerCallsign(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID));
Requires BZFS 2.99.4 (2008-05-26) or later
+
}break;

Latest revision as of 06:13, 19 October 2011

const char* bz_getPlayerCallsign (int playerID)


Retrieves the callsign of a player.

Parameters:
playerID  -  The ID of the player to get the callsign for.
Returns:
A string containing the callsign of the requested player.

Example[edit]

Display the player's name upon joining.

case bz_ePlayerJoinEvent: {
	bz_sendTextMessagef(BZ_SERVER,((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,
		"Hello %s, thanks for joining this server."
		,bz_getPlayerCallsign(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID));
}break;