if(!strcmp(cmdtext, "/admins", true))
{
new Counts;
new const Ranks[][] =
{
"{FFFF00}Ajudante",
"{FF8C00}Moderador(a)",
"{009ACD}Administrador(a)",
"{FF0000}Sub-Staff",
"{03FF35}Staff{FFFFFF}"
};
new const PlayerAfk[][] =
{
"Online",
"{FF0000}Ausente"
};
new STR[9999];
new STX[3005], adminon;
format(STR, sizeof(STR), "Admin\tCargo\tStatus\n");
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
if(!IsPlayerConnected(x)) continue;
if(admin[x])
{
new NickName[25];
GetPlayerName(x, NickName, 25);
if(pAdmin[x] >= 1 && pAdmin[x] <= 5)
{
format(STR, 500, "%s{FFFFFF}%s {FFFFFF} \t%s{FFFFFF} {FFFFFF}\t{00A600}%s{FFFFFF}\n", STR, NickName, Ranks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]);
adminon++;
}
Counts++;
}
}
//teste
if(adminon == 0)
{
ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]", "{FF0000}Nгo hб membros da Administraзгo online no momento !", "Fechar", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else if(adminon == 1)
{
ShowPlayerDialog(playerid, 128, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Admins Online [ {328E0A}1 {FFFFFF}]", STR, "Fechar", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else
{
//teste
format(STX, 500, "{FFFFFF}Admins Online [ {328E0A}%d{FFFFFF} ]", adminon);
ShowPlayerDialog(playerid, 500, DIALOG_STYLE_TABLIST_HEADERS, STX, STR, "Fechar", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
return 1;
}
if(!strcmp(cmdtext, "/admins", true))
{
new const Ranks[][] =
{
"{FFFF00}Ajudante",
"{FF8C00}Moderador(a)",
"{009ACD}Administrador(a)",
"{FF0000}Sub-Staff",
"{03FF35}Staff{FFFFFF}"
};
new const PlayerAfk[][] =
{
"Online",
"{FF0000}Ausente"
};
new STR[256], STX[256], adminon, NickName[MAX_PLAYER_NAME], Counts;
format(STR, sizeof(STR), "Admin\tCargo\tStatus\n");
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
if(admin[x])
{
GetPlayerName(x, NickName, sizeof(NickName));
if(5 >= pAdmin[x] > 0)
{
format(STR, sizeof(STR), "%s{FFFFFF}%s {FFFFFF} \t%s{FFFFFF} {FFFFFF}\t{00A600}%s{FFFFFF}\n", STR, NickName, Ranks[pAdmin[x] - 1], PlayerAfk[AFK[x] - 0]);
adminon++;
}
Counts++;
}
}
//teste
if(adminon == 0)
{
ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{FFFFFF}Admins [ {FF0000}0{FFFFFF} ]", "{FF0000}Nгo hб membros da Administraзгo online no momento !", "Fechar", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else
{
format(STX, sizeof(STX), "{FFFFFF}Admins Online [ {328E0A}%s {FFFFFF}]", Counts);
ShowPlayerDialog(playerid, 128, DIALOG_STYLE_TABLIST_HEADERS, STX, STR, "Fechar", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
return 1;
}
Cara, faz muito tempo que nгo fuзo no pawn, mas tenta isso..
PHP код:
|
@Surak
O comando que eu desenvolvi para vocк ele tem os 2 sistemas AFK/Admin se ele te mandar vc terб os mesmo erros que vc tem agora. @Leonardo Muda os valores das variбveis STR[256] STX[256] coloque um valor maior nelas. |