SA-MP Forums Archive
enum. - 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: enum. (/showthread.php?tid=600728)



enum. - Bruker - 12.02.2016

Код HTML:
[15:03:51] [debug] Run time error 4: "Array index out of bounds"
[15:03:51] [debug]  Accessing element at index 381 past array upper bound 4
[15:03:51] [debug] AMX backtrace:
[15:03:51] [debug] #0 00044468 in public OnVehiclesLoad (0) from GAMEMODE.amx
Line Error:
Код HTML:
Veh[r][ServerID] = CreateVehicle(Veh[r][Mod], Veh[r][X], Veh[r][Y], Veh[r][Z], Veh[r][Angle], Veh[r][Col1], Veh[r][Col2], -1);
r = 1. (printf debug)

Enum:
Код HTML:
enum eVeh
{
    ORM:ORM_ID,
    ID,
    Owner,
    //............//
};
new Veh[5][eVeh];



Re: enum. - Bruker - 12.02.2016

BUMP..


Re: enum. - AbyssMorgan - 12.02.2016

Код:
[15:03:51] [debug]  Accessing element at index 381 past array upper bound 4

new Veh[5][eVeh]; // index 0 - 4 (4 is upperbound)
381 > 4 - error

clearly see the problem in the logs


Re: enum. - Bruker - 12.02.2016

hmm.. ok


Re: enum. - Bruker - 12.02.2016

Problem with complie time...

Код HTML:
enum e_Veh
{
    ORM:ORM_ID,
    ID,
    Owner,
    Model,
    Float:PosX,
    // ................................ //
};
new Veh[MAX_PLAYERS][MAX_VEHICLES][e_Veh];
[Finished in 33.6s]


Код HTML:
enum e_Veh
{
    ORM:ORM_ID,
    ID,
    Owner,
    Model,
    Float:PosX,
    // ................................ //
};
new Veh[MAX_PLAYERS][5][e_Veh];
[Finished in 10.1s]


Re: enum. - Bruker - 12.02.2016

BUMP.


Re: enum. - Joron - 12.02.2016

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Код:
[15:03:51] [debug]  Accessing element at index 381 past array upper bound 4

new Veh[5][eVeh]; // index 0 - 4 (4 is upperbound)
381 > 4 - error

clearly see the problem in the logs
Yeah,And..


Re: enum. - Bruker - 13.02.2016

....