21.04.2016, 23:40
I have the function, SaveData which is called every 100 seconds.
This is the function.
Now, when the that function is called, I get this error:
I have no idea why.
These are the defines.
I really need this one fixed, thanks!
Also, when I was testing this out there we're the following things:
This is the function.
Код:
public SaveData() { foreach(Player, x) { savePlayerData(x); } for(new xh = 0; xh < MAX_HOUSES; xh++) { saveHouse(xh); } for(new xf = 0; xf < MAX_GROUPS; xf++) { saveGroup(xf); } for(new xc = 0; xc < MAX_CLANS; xc++) { saveClan(xc); } for(new xf = 0; xf < MAX_BUSINESSES; xf++) { saveBusiness(xf); } for(new xf = 0; xf < MAX_ASSETS; xf++) { saveAsset(xf); } for(new ff = 0; ff < 999; ff++) { saveDealer(ff); } }
Код:
[01:41:01] [debug] Run time error 4: "Array index out of bounds" [01:41:01] [debug] Accessing element at index 612 past array upper bound 611 [01:41:01] [debug] AMX backtrace: [01:41:01] [debug] #0 0008e970 in ?? (612) from orion.amx [01:41:01] [debug] #1 00170180 in public SaveData () from orion.amx
These are the defines.
Код:
#define MAX_HOUSES 69 #define MAX_GROUPS 69 #define MAX_CLANS 69 #define MAX_ASSETS (10) #define MAX_BUSINESSES 69
Also, when I was testing this out there we're the following things:
Код:
251 vehicle, 22 businesses, 41 houses, 1 player, 2 assets (total in the database).