pawn Код:
if(strcmp(cmd,"/nadmin", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), psContas, aname);
if(PlayerInfo[playerid][pAdmin] == 5){
new tmp[256];
new plid, nadmin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, VERMELHO_TD, "** [INFO] /nadmin [ID] [1 -- 5]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, VERMELHO_TD, "** [INFO] /nadmin [ID] [1 -- 5]");
return 1;
}
nadmin = strval(tmp);
if(IsPlayerConnected(plid)){
PlayerInfo[playerid][pAdmin] = nadmin;
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "** [INFO] O Administrador %s (%d) setou o seu nнvel Administrativo para: %s", aname, playerid, NivelAdmin(nadmin));
SendClientMessage(plid,tcadm, string);
SendClientMessage(playerid, Verde, "** [INFO] Comando efetuado com sucesso!");
return 1;
}else{
SendClientMessage(playerid, VERMELHO_TD, "*** [ERRO] Jogador nгo conectado.");
return 1;
}
}
}