15.12.2018, 16:31
How to do as, for example, enter /giverank 0 2.
Example rank:
Number 1 - pInfo[playerid][pMod] = 1;
Number 2 - pInfo[playerid][pAdmin] = 1;
Example rank:
Number 1 - pInfo[playerid][pMod] = 1;
Number 2 - pInfo[playerid][pAdmin] = 1;
Код:
CMD:giverank(playerid, params[]) { if(pInfo[playerid][pAdmin] == 1) { new string[128], giveplayerid, rank; if(sscanf(params, "ud", giveplayerid, rank)) return SendClientMessage(playerid, -1, "USAGE: /giverank [playerid] [Rank (1-2)]"); if(rank > 6 || rank < 0) { SendClientMessage(playerid, -1, "Don't go below number 0, or above number 6!"); return 1; } if(IsPlayerConnected(giveplayerid)) { pInfo[giveplayerid][pAdmin] = rank; SendClientMessage(giveplayerid, -1, string); format(string, sizeof(string), "You have given %s rank %d.", PlayerName(giveplayerid), rank); SendClientMessage(playerid, -1, string); } } else { SendClientMessage(playerid, -1, "You are not authorized to use that command!"); } return 1; }