Coloured dialog problem
#1

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");
Reply
#2

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).
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)