16.11.2011, 18:22
pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(Admin[playerid] >= 8 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso: /daradmin [ID] [LEVEL]");
new id, lvl[256], level;
id = ReturnUser(tmp);
lvl = strtok(cmdtext, idx);
level = strval(lvl);
if(!strlen(lvl)) return SendClientMessage(playerid, -1, "Uso: /daradmin [ID] [LEVEL]");
if(level > 10) return SendClientMessage(playerid, -1, "Level mбximo: 10.");
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ID INVALIDO");
Admin[id] = level;
new string[256], n[24], n2[24];
GetPlayerName(id, n, 24);
GetPlayerName(playerid, n2, 24);
format(string, 128, "Vocк deu admin level {00FF00}%d{FFFFFF} para o jogador {00FF00}%s{FFFFFF} .", level, n);
SendClientMessage(playerid, -1, string);
format(string, 128, "O administrador {FF4500}%s{FFFFFF} te deu admin nivel {FF4500}%d{FFFFFF} Parabйns.",n2, level);
SendClientMessage(id, -1, string);
}
else { SendClientMessage(playerid, VERDE_AZUL, "Erro: {FFA500} Vocк nгo estб autorizado a usar este comando."); }
return 1;
}