30.06.2011, 23:47
pawn Код:
if(!strcmp(cmdtext,"/setadmin",9,true))
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5)
{
if(!cmdtext[11])
return SendClientMessage(playerid,COLOR_RED,"USE: /daradmin [id] [nнvel]");
if(!cmdtext[13])
return SendClientMessage(playerid,COLOR_WHITE,"[AVISO] Por favor digite o ID do Player.");
if(!IsPlayerConnected(cmdtext[11]))
return SendClientMessage(playerid,COLOR_WHITE,"[ERRO] Jogador indisponнvel.");
PlayerInfo[cmdtext[11]][Admin] = cmdtext[13];
GetPlayerName(cmdtext[11], playername, sizeof(playername));
format(file,sizeof(file),"Contas/%s.ini",playername);
if(!fexist(file)) dini_Create(file);
dini_Set(file,"Level", PlayerInfo[cmdtext[11]][Admin]);
GetPlayerName(cmdtext[11], 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(cmdtext[11], 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 return SendClientMessage(playerid,COLOR_RED, "[ERRO] Vocк nгo й Administrador!");
return 1;
}