SA-MP Forums Archive
Text gives me numbers? :O - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Text gives me numbers? :O (/showthread.php?tid=215091)



Text gives me numbers? :O - Spiral - 22.01.2011

Here's the code:
pawn Код:
if(strcmp(cmd, "/vips", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pDonateRank] >= 1)
            {
                SendClientMessage(playerid, COLOR_GREEN, "VIP's online:");
                //foreach(Player, i)
                for(new i; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        if(PlayerInfo[i][pDonateRank] > 0)
                        {
                            GetPlayerName(i, giveplayer, sizeof(giveplayer));
                            new viptext[64];
                            if(PlayerInfo[i][pDonateRank] == 1) { viptext = "Bronze"; }
                            else if(PlayerInfo[i][pDonateRank] == 2) { viptext = "Silver"; }
                            else if(PlayerInfo[i][pDonateRank] == 3) { viptext = "Golden"; }
                            else if(PlayerInfo[i][pDonateRank] == 4)    { viptext = "Diamond"; }
                            format(string, sizeof(string), "%d VIP %s",viptext,giveplayer);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                        }
                    }
                }
            }
        }
        return 1;
    }
When I'm the donaterank 4, 3, 2 or 1 it shows me numbers as the viptext. How could I fix it? for ex it showed me 71, and 66. so it was like 66 VIP My Name,


Re: Text gives me numbers? :O - [NoV]LaZ - 22.01.2011

You assign %d to viptext, which is a string.


Re: Text gives me numbers? :O - Spiral - 22.01.2011

Oh yeah how could I be so stupid Thanks.