20.07.2014, 19:59
Quando utilizo este comando na rcon ele deveria me meter em admin mas nao ele nao faz nada ele me envia isto de volta no server quando eu digito o comando:
Nem diz ID invalido nem nada...
PHP код:
Comando: /setadmin [PlayerID/ParteDoNome] [AdminLevel]
PHP код:
CMD:setadmin(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 5) {
if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, -1, "{C8C8C8} Comando:{FFFFFF} /setadmin [PlayerID/ParteDoNome] [AdminLevel]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_NICERED, "ID Invбlido!");
if (admlvl > 5 || admlvl < 0) return SendClientMessage(playerid, COLOR_NICERED,"Nнveis entre 1-5");
PlayerInfo[id][pAdmin] = admlvl;
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
new str[128];
format(str,128,"Setas-te administrador nнvel %i ao jogador %s", admlvl, victimname);
SendClientMessage(playerid, COLOR_WHITE, str);
format(str,128,"O Fundador %s deu-te administrador nнvel %i", adminname, admlvl);
SendClientMessage(id, COLOR_GREEN, str);
return 1;
}
else return SendClientMessage(playerid,-1,SEM_NIVEL);
}