SA-MP Forums Archive
Format function help - 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: Format function help (/showthread.php?tid=397136)



Format function help - Feastahashi - 03.12.2012

I'm creating this one cause nobody else went to my other topic. So, the problem is that:

Look now:

Код:
new String[500][500];
new FlightPlace[4] =
{
	"a",
	"b",
	"c",
	"d"
};                  ************* Line 33
new FlightHours[25] =
{
	0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
};
public OnZBCDayChange()
{
	new FD = random(MAX_FLIGHTS_PER_AIRPORT);
	new x = 0;
	if(GetDay() == ZBC_MONDAY)
	{
	    do
	    {

		 	new randFlightPlace = random(sizeof(FlightPlace));
			new randFlightHours = random(sizeof(FlightHours));//FlightHours
			format(String[0], 128, "%s - %d hours", FlightHours[randFlightHours], FlightPlace[randFlightPlace]);
		 	x++;
		}
		while x < FD;

 	}
  

}
I'm gettin' this:

Код:
C:\Users\KRF\Desktop\SampServer\filterscripts\Aircrafts.pwn(33) : error 018: initialization data exceeds declared size



Re: Format function help - InfiniTy. - 03.12.2012

Try this
pawn Код:
new FlightPlace[][4] =
{
    "a",
    "b",
    "c",
    "d"
};



Re: Format function help - Feastahashi - 03.12.2012

Omg, so thankful


Re: Format function help - Nirzor - 03.12.2012

try that one the guy said it should work