Line too long
#1

What's wrong with this? I put it all on one line but my pawno crashes.

pawn Код:
format(string, sizeof(string), ""White"Kitchen Sink ("Green"$%d"White")\nKitchen Sink 2 ("Green"$%d"White")\nKitchen Sink 3 ("Green"$%d"White")\nCooker ("Green"$%d"White")\nCooker 2 ("Green"$%d"White")\nWashing Machine ("Green"$%d"White")\nWashing Machine 2 ("Green"$%d"White")\n", KitSink, KitSink2, KitSink3, Cooker, Cooker2, Washer, Washer2);
            format(string, sizeof(string), "%sFridge ("Green"$%d"White")\nFryer ("Green"$%d"White")", string, Fridge, Fryer);
            ShowPlayerDialog(playerid, DIALOG_FURNI2, DIALOG_STYLE_LIST, ""Green"Furniture & Supplies", string, "Purchase", "Next");
It shows the line up until half of the word Cooker and my string is set as 128 so should be okay..
Reply
#2

What are the numerals supposed to be? Object IDs?

Quote:

Kitchen Sink \nKitchen Sink 2 \nKitchen Sink 3 \nCooker \nCooker 2 \nWashing Machine \nWashing Machine 2 \n",

Is 109 letters, 92 without the \n seperators so object IDs (usually more than 4 digits) will cause your string length to exceed it's defined size.
Reply
#3

pawn Код:
new string[500];
format(string, sizeof(string),
""White"Kitchen Sink ("Green"$%d"White")\nKitchen Sink 2 ("Green"$%d"White")\nKitchen Sink 3 ("Green"$%d"White")\nCooker ("Green"$%d"White")\nCooker 2 ("Green"$%d"White")\nWashing Machine ("Green"$%d"White")\nWashing Machine 2 ("Green"$%d"White")\n", KitSink, KitSink2, KitSink3, Cooker, Cooker2, Washer, Washer2);
            format(string, sizeof(string), "%sFridge ("Green"$%d"White")\nFryer ("Green"$%d"White")", string, Fridge, Fryer);
            ShowPlayerDialog(playerid, DIALOG_FURNI2, DIALOG_STYLE_LIST, ""Green"Furniture & Supplies", string, "Purchase", "Next");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)