30.06.2011, 20:54
Galera to com problema nesse comando de dar Admin nгo ta setando na Dini, nгo ta setando na conta o Level que botei, alguem pode me ajudar?
PHP код:
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];
GetPlayerName(giveplayerid, playername, sizeof(playername));
format(file,sizeof(file),"Contas/%s.ini",playername);
dini_Create(file);
dini_IntSet(file,"Level", Level);
PlayerInfo[giveplayerid][Admin] = dini_Int(file,"Level");
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;
}