23.12.2018, 01:49
Bom pessoal minha gm tem o comando /admins para ver os admins onlines mas quando ha mais de 4 ou cinco adm's pra cima a dialog buga ja peguei varios codigos da msm natureza mais ainda fica bugado. O comando й esse:
para vcs terem como base. Se tiverem alguma forma de aperfeiзoar eu agradeзo
PHP код:
if(strcmp(cmd, "/admins", true) == 0)
{
new count = 0;
new strcmd[1000];
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(Afile, sizeof(Afile), PASTA_ADMINS, GetPlayerNameEx(i));
if(DOF2_GetInt(Afile, "Level") > 1)
{
if(DOF2_GetInt(Afile, "ALevel") == 1)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ AJUDANTE™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ AJUDANTE™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 2)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ ADMINISTRADOR™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ ADMINISTRADOR™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 3)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ GERENTE™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ GERENTE™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 4)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ SUB-DONO™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ SUB-DONO™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 5)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ DONO™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ DONO™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 6)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ SCRIPTER™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ SCRIPTER™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
if(DOF2_GetInt(Afile, "ALevel") == 7)
{
if(AFK[playerid] == 0)
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ MAPPER™ ]\t\t{00FF00}[ ON ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
else
{
format(strcmd, sizeof(strcmd), "{FFFFFF}%s [%d]\t{00FF00}[ MAPPER™ ]\t\t{FF0000}[ OFF ]\n", GetPlayerNameEx(i), i);
strcat(string, strcmd, sizeof(string));
}
}
count++;
}
}
if(count == 0)
{
ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, "{FFFFFF}ADM's Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Nгo hб menbros da Administraзгo Online", "OK", "");
}
else
{
new msg[150], strcount[150];
format(msg, sizeof(msg), "{FFFFFF}ADM's Online [ {00FF00}%d{FFFFFF} ]", count);
strcat(strcount, msg, sizeof(strcount));
ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, strcount, string, "OK", "");
}
return 1;
}