SA-MP Forums Archive
Coloured dialog problem - 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: Coloured dialog problem (/showthread.php?tid=195914)



Coloured dialog problem - woot - 04.12.2010

Hi,

I'm trying to figure out why that one row always gets slightly fucked up.



Here's what I scripted, it works fine when not using any colours.


pawn Код:
// _bikes enum here ..
new bikes[ ][ _bikes ] =
{
    {   0,  "Faggio",       462,    650000  },
    {   1,  "BMX",          481,    400000  },
    {   2,  "Mountain Bike",510,    800000  },
    {   3,  "PCJ-600",      461,    1500000 },
    {   4,  "FCR-900",      521,    2600000 },
    {   5,  "Freeway",      463,    2200000 },
    {   6,  "BF-400",       581,    1300000 },
    {   7,  "Sanchez",      468,    2300000 },
    {   8,  "Wayfarer",     586,    2400000 }
};

new
    iString[ 384 ],
    tmps[ 35 ];
   
for(new c; c < sizeof(bikes); c++)     
{
    format(tmps,sizeof(tmps),"{FFFFFF}%s {248716}($%s) \n",bikes[c][bikename], number_format(bikes[c][bikeprice]));
    strcat(iString,tmps);          
}
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_LIST, "Bike Dealership", iString, "Buy", "Cancel");



Re: Coloured dialog problem - Simon - 04.12.2010

Increase the size of tmps array. The length of the array cannot hold all of the text you're formatting into it, put it at about 64.

The length of the line that's causing the error is currently at 44 characters (including null terminator).


Re: Coloured dialog problem - woot - 04.12.2010

Silly me - thanks bro! Forgot that they also take up string size.