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_hasPerm
Jump to navigation
Jump to search
bool bz_hasPerm (int playerID, const char* perm)
Checks to see if the player specified has the permission specified.
Parameters:
playerID - The id of the player to check
perm - The name of the permission to check for
Returns:
True if the player specified has the permission specified, false if they do not have the permission specified
Example
Using a groups file, if you specify the +OPERATOR permission (You make it up) and then check for that permission upon a player join, you can as an example, set a player as the operator.
case bz_ePlayerJoinEvent: {
if (bz_hasPerm(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,"OPERATOR")) {
bz_setPlayerOperator(((bz_PlayerJoinPartEventData_V1*)eventData)->playerID);
}
}break;