Лучший Ответ
Elrmrnt-Kritik
,
20 Апрель 2017 - 17:37
_Supreme_, кхм... Тогда так:
if(!strcmp(cmd, "/leaders", true))
{
new text[16], a = -1, sendername[MAX_PLAYER_NAME], string[1024];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
if(PlayerInfo[i][pLeader] == 0) continue;
GetPlayerName(playerid, sendername, sizeof(sendername));
switch(PlayerInfo[i][pLeader])
{
case 1: text = "ОВД:";
case 2: text = "ФСБ:";
case 3: text = "Армия:";
case 4: text = "МЧС:";
case 5: text = "Мэрия:";
case 6: text = "Репортеры:";
case 7: text = "Русская мафия:";
case 8: text = "Бригада:";
}
static const fmt_str[] = "{ffec00}%s: {FFFFFF}%s [id: %d]\n";
new str[sizeof(fmt_str)+(-2+16)+(-2+MAX_PLAYER_NAME)+(-2+3)];
format(str, sizeof(str), fmt_str, text, sendername, i);
strcat(string, str);
a = i;
}
if(a == -1) format(string, sizeof(string), "Лидеры не в сети");
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "{999999}Лидеры", string, "закрыть", "");
return true;
}
Дополнение к сообщению:
В прошлом варианте с табуляцией ошибся.
Перейти к сообщению »