problems at cmd:vips
#1

@hello all I got already posted a topic about this problem but I got a new problem, after giving that solution a shoot I got a now the problem is look at the code down

pawn Код:
CMD:vips(playerid, params[]){
    new Count, n[MAX_PLAYER_NAME], string[128], VipRank[40];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][Vip] > 0 && IsPlayerConnected(i))
        {
            switch(PlayerInfo[i][Vip])
            {
                case 1:
                {
                    VipRank = "Level 1 VIP ($10 USD)";
                }
                case 2:
                {
                    VipRank = "Level 2 VIP ($15 USD)";
                }
            }
            GetPlayerName(i, n, sizeof(n));
            format(string, 128, "%s{FFFFFF}* %s (Id:%i) = %s \n", string, n, i, VipRank);
            Count++;
        }
    }
    if(Count == 0)
    {
        ShowPlayerDialog(playerid, 121,DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Online Vips", "Currently, there is no vips online", "OK", "");
    }
    else
    {
        format(string, 128, "{FF0000}Online Very Important Players\n{FFFFFF}%s", string);
        ShowPlayerDialog(playerid, 12,DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Online Vips", string, "OK", "");
    }
    return 1;}
after the name nothing shows no infomations . so please help thanks in advance!
Reply
#2

help please.!
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)