11.06.2014, 22:51
Try this:
pawn Код:
CMD:vips(playerid, params[])
{
new Count = 0, name[MAX_PLAYER_NAME], string[1400], VipRank[25];
for(new i = 0; i < MAX_PLAYERS; i++) //I would recommend foreach.
{
if(!IsPlayerConnected(i)) continue; //Remove if using foreach.
switch(PlayerInfo[i][Vip])
{
case 0: continue;
case 1: VipRank = "Level 1 VIP ($10 USD)";
case 2: VipRank = "Level 2 VIP ($15 USD)";
}
new fstr[70];
GetPlayerName(i, name, sizeof(name));
format(fstr, sizeof(fstr), "* %s (Id:%i) = %s\n", name, i, VipRank);
strcat(string, fstr);
Count++;
if(Count >= 20)
{
strcat(string, "\n{FF0000}Not all VIPs could be listed. (More than 20 online)");
break;
}
}
if(!Count) string = "{FF0000}There are currently no vips online";
format(string, sizeof(string), "{FF0000}Online Very Important Players\n{FFFFFF}%s", string);
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Online Vips", string, "OK", "");
return 1;
}