16.12.2018, 11:58
PHP код:
CMD:giverank(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "You are not authorized to use that command!");
new giveplayerid, rank;
if(sscanf(params, "ud", giveplayerid, rank)) return SendClientMessage(playerid, -1, "USAGE: /giverank [playerid] [Rank (1-2)]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "There is no such player!");
switch(rank)
{
case 1: pInfo[giveplayerid][pMod] = 1;
case 2..6: pInfo[giveplayerid][pAdmin] = rank - 1;
default: SendClientMessage(playerid, -1, "Don't go below number 0, or above number 6!");
}
return 1;
}
I'm assuming pAdmin is increased when a number above 1 is entered, so this is the code I've given you. Please change accordingly.