标志有没有办法具有“ 2个值”或“相同的值”?
enum PLAYER_RANK(+=1) {
PLAYER_RANK_1 = 1,
PLAYER_RANK_2 = PLAYER_RANK_1 /* and PLAYER_RANK_2 value*/,
PLAYER_RANK_3 = PLAYER_RANK_2 /* PLAYER_RANK_3 and PLAYER_RANK_1, PLAYER_RANK_2 values*/
};
new PLAYER_RANK:playerRank[MAX_PLAYERS];
playerRank[playerid] |= PLAYER_RANK_3;
现在玩家可以通过以下两个验证:(“他具有PLAYER_RANK_1,PLAYER_RANK_2,PLAYER_RANK_3的值”)
if (!(playerRank[playerid] & PLAYER_RANK_1))
return SendClientMessage(playerid, -1, "You are not allowed.");
if (!(playerRank[playerid] & PLAYER_RANK_3))
return SendClientMessage(playerid, -1, "You are not allowed.");
有什么办法吗?