09.12.2012, 10:13
Just one single variable is enough and makes easier. Also the variable must be global variable inorder to apply it for players. Here's a small example:
Edit:late.
pawn Код:
new pRank[MAX_PLAYERS]; //Create a global variable to apply the ranks for players.
CMD:setrank(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You must login as RCON to use this command.");
new p2;
new rank;
if(sscanf(params, "ui", p2, rank)) return SendClientMessage(playerid, 0xFF0000, "Usage: /setrank [playerid] [rank]");
if(p2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "This player ID is invalid.");
if(rank > 1 || rank > 4) return SendClientMessage(playerid, 0xFF0000FF, "Invalid rank. Avalaible 0-4.");
pRank[p2] = rank; //Sets the rank!
return 1;
}
CMD:examplecmd(playerid, params[])
{
if(pRank[playerid] == 1) //If player is rank 1.
{
//
}
return 1;
}