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 getAdmin: Difference between revisions
Jump to navigation
Jump to search
New page: {{apicall | name = bz_getAdmin | description = Returns true if the player specified is an administrator on this server. Returns false otherwise. | param1 = playerID | par... |
m clarified what an administrator is |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{apicall | {{apicall | ||
| name = bz_getAdmin | | name = bz_getAdmin | ||
| description = | | returns = true if player is an administrator, false otherwise. | ||
| returntype = bool | |||
| description = Checks to see if the specified player is an administrator (has the ability to ban). | |||
| param1 = playerID | | param1 = playerID | ||
| param1type = int | | param1type = int | ||
| Line 8: | Line 10: | ||
| returns = True if the player specified is an administrator; false otherwise | | returns = True if the player specified is an administrator; false otherwise | ||
}} | }} | ||
===Example=== | |||
Displays a custom message if the player joins and is identified as an administrator. | |||
if (bz_getAdmin(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID)) { | |||
bz_sendTextMessage(BZ_SERVER,((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,"Welcome! Do not forget to check up on admin news with /adminnews!"); | |||
} | |||
Latest revision as of 21:06, 17 January 2013
bool bz_getAdmin (int playerID)
Checks to see if the specified player is an administrator (has the ability to ban).
Parameters:
playerID - The id of the player to check for admin status
Returns:
True if the player specified is an administrator; false otherwise
Example
Displays a custom message if the player joins and is identified as an administrator.
if (bz_getAdmin(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID)) {
bz_sendTextMessage(BZ_SERVER,((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,"Welcome! Do not forget to check up on admin news with /adminnews!");
}