[Debug] Amx BackTrace
#1

Hey guys!
What's this errors ?

Код:
[22:41:30] [debug] Run time error 4: "Array index out of bounds"
[22:41:30] [debug]  Accessing element at index 65535 past array upper bound 199
[22:41:30] [debug] AMX backtrace:
[22:41:31] [debug] #0 0014b6ec in public OnPlayerDeath () from Gamemode2.amx
[22:41:31] [death] Admin died 54
[22:41:53] [debug] Run time error 4: "Array index out of bounds"
[22:41:53] [debug]  Accessing element at index 65535 past array upper bound 199
[22:41:53] [debug] AMX backtrace:
[22:41:53] [debug] #0 0014b6ec in public OnPlayerDeath () from Gamemode2.amx
[22:41:53] [death] Admin died 255
[22:48:39] [debug] Run time error 4: "Array index out of bounds"
[22:48:40] [debug]  Accessing element at negative index -400
[22:48:40] [debug] AMX backtrace:
[22:48:41] [debug] #0 00160a74 in ?? () from Gamemode2.amx
[22:48:41] [debug] #1 0016098c in public CheckForChange () from Gamemode2.amx
[22:49:31] [debug] Run time error 4: "Array index out of bounds"
[22:49:31] [debug]  Accessing element at negative index -400
[22:49:31] [debug] AMX backtrace:
[22:49:31] [debug] #0 00160a74 in ?? () from Gamemode2.amx
[22:49:31] [debug] #1 0016098c in public CheckForChange () from Gamemode2.amx
Thanks in advance
Reply
#2

http://forum.sa-mp.com/showthread.ph...ighlight=65535

and for -400 must be something array[GetVehicleModel(GetPlayerVehicleID(playerid))-400]

GetPlayerVehicleID = 0
GetVehicleModel = 0

0 - 400 = -400;

max array is more than -1

new array[MAX_VEHICLES]; // 0 - 1999
Reply
#3

Well since you mentioned my topic
Instead of using a variable, use this:
pawn Код:
//under on player death
if(killerid!=INVALID_PLAYER_ID)
https://sampwiki.blast.hk/wiki/OnPlayerDeath
Important Note: You MUST check whether killerid equals INVALID_PLAYER_ID before using it in an array, as it will cause the script to stop. See example above.
Reply
#4

Thanks for reply!

But , this is my callback checkforchange, how to fix ?
Код:
public CheckForChange(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != VehicleModel[playerid])
{
VehicleModel[playerid] = GetVehicleModel(GetPlayerVehicleID(playerid));
ShowGameTextForPlayer(playerid);
}

return 1;
}
edit: hmm, the problem disappeared, perhaps with onplayerdeath fixed.
however, the callback is right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)