[23:16:42] [debug] Run time error 4: "Array index out of bounds" [23:16:42] [debug] Attempted to read/write array element at index 17 in array of size 16 [23:16:42] [debug] AMX backtrace: [23:16:42] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:42] [debug] Run time error 4: "Array index out of bounds" [23:16:42] [debug] Attempted to read/write array element at index 18 in array of size 16 [23:16:42] [debug] AMX backtrace: [23:16:42] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:43] [debug] Run time error 4: "Array index out of bounds" [23:16:43] [debug] Attempted to read/write array element at index 19 in array of size 16 [23:16:43] [debug] AMX backtrace: [23:16:43] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:43] [debug] Run time error 4: "Array index out of bounds" [23:16:43] [debug] Attempted to read/write array element at index 20 in array of size 16 [23:16:43] [debug] AMX backtrace: [23:16:43] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:43] [debug] Run time error 4: "Array index out of bounds" [23:16:43] [debug] Attempted to read/write array element at index 21 in array of size 16 [23:16:43] [debug] AMX backtrace: [23:16:43] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:43] [debug] Run time error 4: "Array index out of bounds" [23:16:43] [debug] Attempted to read/write array element at index 22 in array of size 16 [23:16:43] [debug] AMX backtrace: [23:16:43] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:43] [debug] Run time error 4: "Array index out of bounds" [23:16:43] [debug] Attempted to read/write array element at index 23 in array of size 16 [23:16:43] [debug] AMX backtrace: [23:16:43] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:44] [debug] Run time error 4: "Array index out of bounds" [23:16:44] [debug] Attempted to read/write array element at index 24 in array of size 16 [23:16:44] [debug] AMX backtrace: [23:16:44] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:16:44] [debug] Run time error 4: "Array index out of bounds" [23:16:44] [debug] Attempted to read/write array element at index 24 in array of size 16 [23:16:44] [debug] AMX backtrace: [23:16:44] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:04] [debug] Run time error 4: "Array index out of bounds" [23:17:04] [debug] Attempted to read/write array element at index 17 in array of size 16 [23:17:04] [debug] AMX backtrace: [23:17:04] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:04] [debug] Run time error 4: "Array index out of bounds" [23:17:04] [debug] Attempted to read/write array element at index 18 in array of size 16 [23:17:04] [debug] AMX backtrace: [23:17:04] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:04] [debug] Run time error 4: "Array index out of bounds" [23:17:04] [debug] Attempted to read/write array element at index 19 in array of size 16 [23:17:04] [debug] AMX backtrace: [23:17:04] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 20 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 21 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 22 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 23 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 24 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 25 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 26 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482 [23:17:05] [debug] Run time error 4: "Array index out of bounds" [23:17:05] [debug] Attempted to read/write array element at index 26 in array of size 16 [23:17:05] [debug] AMX backtrace: [23:17:05] [debug] #0 001048f0 in public OnObjectMoved (objectid=2) at C:\Users\XE\Desktop\Слив\gamemodes\Gelenger.pwn:19482
Show us lines 19472 - 19492, and if they are using any global variables show their definition too.
|
[HTML]public OnObjectMoved(objectid) { if (objectid == Ball) { new Float: x, Float: y, Float: z; GetObjectPos(objectid, x,y,z); new n = END_BALL_STEP; if (BallStep >= n) { new b; if (!Mode) b = 8; else b = 10; if (BallStep == n + b) { BallPos[0] = x; BallPos[1] = y; BallPos[2] = z; CanJump[BallOn] = 0; ApplyAnimation(BallOn, "BSKTBALL", "BBALL_Jump_Shot_O", 4, 0, 0, 0, 1, 100); BallOn = -1; } else { if (!Mode) { GameTextForPlayer(BallOn, "~g~+1", 3000, 6); new Float: a = BallDown[BallStep - n]; MoveObject(objectid, x,y,z + a, 8-a); BallStep++; } else { new Float: a = BallSide[BallStep - n]; MoveObject(objectid, x+0.15*Mode, y - 0.08, z + a, 8-a); BallStep++; } } } MoveObject(objectid, x+BallSteps[0], y+BallSteps[1], z+ZBallPos[BallStep], 7.65); BallStep++; }
Add somewhere in there trace, and print out values "BallStep" and "BallStep - n". One of those is 20 and your suspects are BallDown[BallStep - n] and ZBallPos[BallStep]. Check the size of arrays ZBallPos and BallDown - the one with 16 slots is your culprit.
|
public OnObjectMoved(objectid) { if (objectid == Ball) { new Float: x, Float: y, Float: z; GetObjectPos(objectid, x,y,z); new n = END_BALL_STEP; if (BallStep >= n) { new b; if (!Mode) b = 8; else b = 10; if (BallStep == n + b) { BallPos[0] = x; BallPos[1] = y; BallPos[2] = z; CanJump[BallOn] = 0; ApplyAnimation(BallOn, "BSKTBALL", "BBALL_Jump_Shot_O", 4, 0, 0, 0, 1, 100); BallOn = -1; } else { if (!Mode) { GameTextForPlayer(BallOn, "~g~+1", 3000, 6); new Float: a = BallDown[BallStep - n]; MoveObject(objectid, x,y,z + a, 8-a); BallStep++; } else { new Float: a = BallSide[BallStep - n]; MoveObject(objectid, x+0.15*Mode, y - 0.08, z + a, 8-a); BallStep++; } } } MoveObject(objectid, x+BallSteps[0], y+BallSteps[1], z+ZBallPos[BallStep], 7.65); BallStep++; }