08.10.2011, 19:48
pawn Код:
if(strcmp(cmdtext,"/daradmin",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Use /DarAdmin [ID][AdminLevel]");
new admin = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,-1,"Use /DarAdmin [ID][AdminLevel]");
new adminlevel = strval(tmp);
if(adminlevel < valorminimo || adminlevel > valormaximo) return SendClientMessage(playerid,-1,"Level de admin invбlido.");
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
GetPlayerName(admin,name2,sizeof(name2));
new string[128];
format(string,sizeof(string),"%s Promoveu %s Para Level %d de Admin!"name,name2,adminlevel);
SendClientMessageToAll(GetPlayerColor(admin),string);
PlayerInfo[admin][pAdmin] = adminlevel;//troque isto pela variavel equivalente a do seu sistema de admin
return 1;
}
PS: Troque valorminimo e valormaximo pelo nivel minimo e maximo de admin
Ex:
pawn Код:
if(adminlevel < 1 || admilevel > 10)