VIP Level
#1

Hi, I use a script to VIP levels 1,2,3 and I want to make a stock that after writing / vips display text instead of 1,2,3 Bronze, Silver, Gold

Stock is as follows:

Код:
stock GetValTarif(val)
{
    new name[16];

    if(val == 1) name = "Bronze";
    else if(val == 2) name = "Silver";
    else if(val == 3) name = "Gold";
    else name = "None";
    return name;
}
A command:

Код:
COMMAND: vips (playerid, params [])
{
    new string [1024], temp [128];
    strcat (string, "" blue "VIP Players On-Line: \ n" white "");
    for (new i = 0 i <MAX_PLAYERS, i + +)
    {
        if (PlayerInfo [i] [VIPLevel]> = 1 && IsPlayerConnected (i))
    {
    format (temp, sizeof (temp), "\ n% s [% d] Tarif:% d", GetName (i), i, GetValTarif (PlayerInfo [i] [VIPLevel]));
    strcat (string, temp);
    }
}

ShowPlayerDialog (playerid, VIPS_DIALOG, DIALOG_STYLE_MSGBOX, "VIP Players", string, "Ok", "");
return 1;
}
However, when you display the dialog again displays 1,2,3. Do not know how?
Reply
#2

pawn Код:
format (temp, sizeof (temp), "\n%s [%d] Tarif:%s", GetName (i), i, GetValTarif (PlayerInfo [i] [VIPLevel])); //Tarif should be %s as the function is returning a string.
Reply
#3

OOOOOOOOOOOOoou, i am dick
Thanks you, REP+!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)