05.01.2016, 17:06
Quote:
Then I would print out the index whenever you want to access the "Veh" veriable to make sure it won't exceed the 1999 value.
Like this: Код:
printf("Veh index: %i", UlIDV); Veh[UlIDV][ServerID] = CreateVehicle(Veh[UlIDV][Model], Veh[UlIDV][PosX], Veh[UlIDV][PosY], Veh[UlIDV][PosZ], Veh[UlIDV][VAngle], Veh[UlIDV][Color1], Veh[UlIDV][Color2], -1); |
Код HTML:
[17:37:57] Model: 468 [17:37:57] Veh index: 0 [17:37:57] Model: 602 [17:37:57] Veh index: 1 [17:37:57] Model: 411 [17:37:57] Veh index: 2 [17:37:57] Model: 496 [17:37:57] Veh index: 3 [17:37:57] Model: 462 [17:37:57] Veh index: 4 [17:37:57] Model: 463 [17:37:57] Veh index: 5
Код HTML:
[17:38:38] Model: 0 [17:38:38] Veh index: 6 [17:38:38] [debug] Run time error 4: "Array index out of bounds" [17:38:38] [debug] Accessing element at index 65535 past array upper bound 1999 [17:38:38] [debug] AMX backtrace: [17:38:38] [debug] #0 0004ed6c in public OnVehiclesLoad (1) from GM.amx