SA-MP Forums Archive
VIP Level - 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: VIP Level (/showthread.php?tid=404965)



VIP Level - MichiCZ - 05.01.2013

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?


Re: VIP Level - [HiC]TheKiller - 05.01.2013

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.



Re: VIP Level - MichiCZ - 05.01.2013

OOOOOOOOOOOOoou, i am dick
Thanks you, REP+!