29.06.2011, 22:24
Galera esse comando de setar Admin nгo ta funfando com os cara sу dar pra setar eu mesmo os outros nгo ta setando
PHP код:
if(!strcmp(cmd, "/setadmin", true))
{
new Level;
new Sjim[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][Admin] < 5)
{
SendClientMessage(playerid, 0xFC4430AA, "¤ Vocк nгo й administrador logado na RCON !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF6F28AA, "¤ Uso correto: /setaradmin [id] [level]");
return 1;
}
playerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF6F28AA, "¤ Uso correto: /setaradmin [id] [level]");
return 1;
}
Level = strval(tmp);
if(Level < 0 || Level > 5) return SendClientMessage(playerid, 0xFFFF00AA, "¤ Somente level de administrador entre 1 e 5!");
if(IsPlayerConnected(playerid))
{
if(playerid != INVALID_PLAYER_ID)
{
format(Sjim, sizeof(Sjim), "¤ Vocк deu б %s (ID:%d), level %d de administrador.", name, playerid, Level);
SendClientMessage(playerid, 0x00A400AA, Sjim);
format(Sjim, sizeof(Sjim), "¤ [PROMOVIDO] O Administrador %s lhe deu Level %d de Administrador!", name, Level);
SendClientMessage(playerid, 0x00FF00AA, Sjim);
GameTextForPlayer(playerid, "~p~PROMOVIDO!", 5000, 0);
PlayerInfo[playerid][Admin] = Level;
format(file, sizeof(file), "Contas/%s.ini", name);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Level", Level);
}
else
{
dini_IntSet(file, "Level", Level);
PlayerInfo[playerid][Admin] = Level;
}
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, 0xFC4430AA, "¤ (ERRO) Jogador nгo conectado!");
return 1;
}
}