SA-MP Forums Archive
Help: /vips command! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help: /vips command! (/showthread.php?tid=431280)



Help: /vips command! - Areax - 17.04.2013

Hello!

I maked a /vips command, which show a player all online vips, but if there are two vips online and then you do /vips, then it's only shows a one vip player, not both of them....Can someone fix that?

Code:
PHP код:
CMD:vips(playeridparams[])
{
    new 
count 0string[256];
    for(new 
0MAX_PLAYERS++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
gPlayerInfo[i][PLAYER_VIP] == 1)
            {
                
format(stringsizeof(string),"Vip Level 1:{B3754D} %s [BRONZE]"PlayerName(i));
                
ShowPlayerDialog(playerid117DIALOG_STYLE_MSGBOX"{09F709}Online Vips:"string"Ok""");
                
count++;
            }
            if(
gPlayerInfo[i][PLAYER_VIP] == 2)
            {
                
format(stringsizeof(string),"Vip Level 2:{BBBBBB} %s [SILVER]"PlayerName(i));
                
ShowPlayerDialog(playerid117DIALOG_STYLE_MSGBOX"{09F709}Online Vips:"string"Ok""");
                
count++;
            }
            if(
gPlayerInfo[i][PLAYER_VIP] == 3)
            {
                
format(stringsizeof(string),"Vip Level 3:{CCBD33} %s [GOLD]"PlayerName(i));
                
ShowPlayerDialog(playerid117DIALOG_STYLE_MSGBOX"{09F709}Online Vips:"string"Ok""");
                
count++;
            }
        }
    }
    if(
count == 0)
    {
        
ShowPlayerDialog(playerid117DIALOG_STYLE_MSGBOX"{09F709}Online Vips:""----|There are Currently No Vips Online|----""Ok""");
    }
    return 
1;

Thanks


Re: Help: /vips command! - Areax - 17.04.2013

Anyone?


AW: Help: /vips command! - ulbi1990 - 17.04.2013

pawn Код:
format(string, sizeof(string),"%sVip Level 1:{B3754D} %s [BRONZE]\n",string, PlayerName(i));
format(string, sizeof(string),"%sVip Level 2:{BBBBBB} %s [SILVER]\n",string, PlayerName(i));
format(string, sizeof(string),"%sVip Level 3:{CCBD33} %s [GOLD]\n",string, PlayerName(i));
Try this, you don't set the string and doesn't start a new line.


Re: Help: /vips command! - tyler12 - 17.04.2013

pawn Код:
CMD:vips(playerid, params[])
{
    new count = 0, string[256];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(gPlayerInfo[i][PLAYER_VIP] == 1)
            {
                format(string, sizeof(string),"%sVip Level 1:{B3754D} %s [BRONZE]\n", string, PlayerName(i));
                count++;
            }
            if(gPlayerInfo[i][PLAYER_VIP] == 2)
            {
                format(string, sizeof(string),"%sVip Level 2:{BBBBBB} %s [SILVER]\n", string, PlayerName(i));
                count++;
            }
            if(gPlayerInfo[i][PLAYER_VIP] == 3)
            {
                format(string, sizeof(string),"%sVip Level 3:{CCBD33} %s [GOLD]\n", string, PlayerName(i));
                count++;
            }
        }
    }
    if(count == 0)
    {
        ShowPlayerDialog(playerid, 117, DIALOG_STYLE_MSGBOX, "{09F709}Online Vips:", "----|There are Currently No Vips Online|----", "Ok", "");
    }
    else
    {
        ShowPlayerDialog(playerid, 117, DIALOG_STYLE_MSGBOX, "{09F709}Online Vips:", string, "Ok", "");
    }
    return 1;
}



Re: Help: /vips command! - Areax - 17.04.2013

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
CMD:vips(playerid, params[])
{
    new count = 0, string[256];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(gPlayerInfo[i][PLAYER_VIP] == 1)
            {
                format(string, sizeof(string),"%sVip Level 1:{B3754D} %s [BRONZE]\n", string, PlayerName(i));
                count++;
            }
            if(gPlayerInfo[i][PLAYER_VIP] == 2)
            {
                format(string, sizeof(string),"%sVip Level 2:{BBBBBB} %s [SILVER]\n", string, PlayerName(i));
                count++;
            }
            if(gPlayerInfo[i][PLAYER_VIP] == 3)
            {
                format(string, sizeof(string),"%sVip Level 3:{CCBD33} %s [GOLD]\n", string, PlayerName(i));
                count++;
            }
        }
    }
    if(count == 0)
    {
        ShowPlayerDialog(playerid, 117, DIALOG_STYLE_MSGBOX, "{09F709}Online Vips:", "----|There are Currently No Vips Online|----", "Ok", "");
    }
    else
    {
        ShowPlayerDialog(playerid, 117, DIALOG_STYLE_MSGBOX, "{09F709}Online Vips:", string, "Ok", "");
    }
    return 1;
}
Thanks