pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "[Info] /daradmin [playerid/Parte-do-Nick] [level(1-5000)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5000 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("[Administrador]: %s promoveu %s para administrador no nivel %d.", sendername, giveplayer, level);
format(string, sizeof(string), "Vocк foi promovido a moderador, no nнvel %d pelo administrador %s.", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s promoveu %s para administrador nivel %d [PARABENS!].", sendername,giveplayer,level);
SendClientMessageToAll( COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo pode usar esse comando!");
}
}
return 1;
}
}