30.06.2011, 21:07
pawn Код:
if(strcmp(cmd,"/setadmin",true) == 0)
{
tmp = strtok(cmdtext, idx);
new player[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5)
{
if(!strlen(tmp))
return SendClientMessage(playerid,COLOR_RED,"USE: /daradmin [id] [nнvel]");
if(!IsNumeric(tmp))
return SendClientMessage(playerid,COLOR_WHITE,"[AVISO] Por favor digite o ID do Player.");
if(!IsPlayerConnected(strval(tmp)))
return SendClientMessage(playerid,COLOR_WHITE,"[ERRO] Jogador indisponнvel.");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
new level = strval(tmp);
new Level;
new playername[24];
PlayerInfo[giveplayerid][Admin] = dini_Int(file,"Level");
GetPlayerName(giveplayerid, playername, sizeof(playername));
format(file,sizeof(file),"Contas/%s.ini",playername);
if(!fexist(file)) dini_Create(file);
dini_Set(file,"Level", PlayerInfo[giveplayerid][Admin]);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
format(string, sizeof(string), "{FFFF00}Adm.Cmd:{33AAFF} O Administrador %s deu para vocк [Level %d] de Administrador!",player, level);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "{FFFF00}Adm.Cmd:{33AAFF} Vocк deu para %s [Level %d] de Administrador!", giveplayer, level);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(PlayerInfo[playerid][Admin] < 5) return SendClientMessage(playerid,COLOR_RED, "[ERRO] Vocк nгo й Administrador!");
return 1;
}