SA-MP Forums Archive
Problem with stock and propery showing it - 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: Problem with stock and propery showing it (/showthread.php?tid=351468)



Problem with stock and propery showing it - caki - 16.06.2012

So i use this stock to define vip status but when you do Stats output is wierd.Like some function is counting it instead of showing it. Any help would be great. Thanks


pawn Код:
stock VipType(playerid)
{
      new viprank[10];
      switch(PlayerInfo[playerid][pVIP])
      {
             case 0: { viprank = "None"; }
             case 1: { viprank = "Plantium"; }
             case 2: { viprank = "Gold"; }
             case 3: { viprank = "Silver"; }
             case 4: { viprank = "Bronze"; }
      }
      return viprank;
}



Re: Problem with stock and propery showing it - Babul - 16.06.2012

instead of formatting the rank with "%d" or "%i", use the string specifier "%s". the char "N" equals 78, "P" equals 80 etc when printed as integer.


Re: Problem with stock and propery showing it - iggy1 - 16.06.2012

^^

And your function can be improved slightly.

Don't use the code i posted here it crashed my compiler for some reason.


Re: Problem with stock and propery showing it - caki - 16.06.2012

Thank you both. Eh me being stupid i used %d and it was driving me nuts. Thank guys for help