Formating error -
Feastahashi - 03.12.2012
Hey guys. :
I haven't used pawno for a long time, so, I forgot a bit and need help on this.
This isn't due a specific error, but about the correct using of this way.
Look:
Code:
new String[500][500];
new FlightPlace[3] =
{
"a",
"b",
"c",
"b"
};
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
};
Now the line which I removed and the error dissapeared:
Code:
format(String[0], 128, "%s - %d hours", random(FlightPlace), random(FlightHours))
I've tried many ways of representing these
random the text on the Format.
Hope you, guys, may help me.
Re: Formating error -
LarzI - 03.12.2012
pawn Code:
format(String[0], 128, "%s - %d hours", FlightPlace[random(4)], FlightHours[random(25)])
Also you need to set FlightPlace to 4, not 3, as you have 3 cells.
Re: Formating error -
Azazelo - 03.12.2012
pawn Code:
new randFlightPlace = random(sizeof(FlightPlace));
new randFlightHours = random(sizeof(FlightHours));//FlightHours
format(String[0], 128, "%s - %d hours", FlightHours[randFlightHours], FlightPlace[randFlightPlace]);
Re: Formating error -
Feastahashi - 03.12.2012
Guys, I've tried both of you, but the I think the problem is no longer on the line I mentioned.
Look now:
Code:
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:
Code:
C:\Users\KRF\Desktop\SampServer\filterscripts\Aircrafts.pwn(33) : error 018: initialization data exceeds declared size
Re: Formating error -
Feastahashi - 03.12.2012
Guys, please, I need that to continue on my script
.
Re: Formating error -
LarzI - 03.12.2012
Increase the array cell size by 1 and it should fix itself.