SA-MP Forums Archive
What is this error? - 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: What is this error? (/showthread.php?tid=656803)



What is this error? - binnyl - 24.07.2018

Everyday this error flood on my server.log:
Код:
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05725, Float:fY=2.28528, Float:fZ=0.11955, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.06158, Float:fY=2.26917, Float:fZ=0.12363, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.06879, Float:fY=2.26624, Float:fZ=0.10714, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.06824, Float:fY=2.28418, Float:fZ=0.08942, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05573, Float:fY=2.31482, Float:fZ=0.08705, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03998, Float:fY=2.33142, Float:fZ=0.10780, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03198, Float:fY=2.31604, Float:fZ=0.14451, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:50] [debug] Run time error 4: "Array index out of bounds"
[11:32:50] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:50] [debug] AMX backtrace:
[11:32:50] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03741, Float:fY=2.27930, Float:fZ=0.16588, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:50] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05316, Float:fY=2.23889, Float:fZ=0.16177, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.06866, Float:fY=2.21619, Float:fZ=0.14058, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.08221, Float:fY=2.22925, Float:fZ=0.09750, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.07587, Float:fY=2.27942, Float:fZ=0.06744, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05859, Float:fY=2.32031, Float:fZ=0.06669, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03436, Float:fY=2.34460, Float:fZ=0.10228, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.02466, Float:fY=2.33020, Float:fZ=0.14332, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:51] [debug] Run time error 4: "Array index out of bounds"
[11:32:51] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:51] [debug] AMX backtrace:
[11:32:51] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03296, Float:fY=2.27979, Float:fZ=0.17338, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:51] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05280, Float:fY=2.22998, Float:fZ=0.16679, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.07275, Float:fY=2.21033, Float:fZ=0.13361, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.08411, Float:fY=2.22534, Float:fZ=0.09402, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.07660, Float:fY=2.28040, Float:fZ=0.06268, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.05762, Float:fY=2.32324, Float:fZ=0.06496, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.03436, Float:fY=2.34607, Float:fZ=0.09998, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.02289, Float:fY=2.33667, Float:fZ=0.13939, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.02997, Float:fY=2.28613, Float:fZ=0.17394, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:52] [debug] Run time error 4: "Array index out of bounds"
[11:32:52] [debug]  Attempted to read/write array element at index 54 in array of size 30
[11:32:52] [debug] AMX backtrace:
[11:32:52] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=54, Float:fX=-1.04553, Float:fY=2.23804, Float:fZ=0.17588, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:52] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:53] [debug] Run time error 4: "Array index out of bounds"
[11:32:53] [debug]  Attempted to read/write array element at index 51 in array of size 30
[11:32:53] [debug] AMX backtrace:
[11:32:53] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=51, Float:fX=-0.28156, Float:fY=2.74878, Float:fZ=0.11920, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:53] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
[11:32:53] [debug] Run time error 4: "Array index out of bounds"
[11:32:53] [debug]  Attempted to read/write array element at index 51 in array of size 30
[11:32:53] [debug] AMX backtrace:
[11:32:53] [debug] #0 0013b878 in OnPlayerWeaponShot (playerid=0, weaponid=31, hittype=2, hitid=51, Float:fX=-0.29395, Float:fY=2.74268, Float:fZ=0.12755, ... <1073741816 arguments>) at GnP.pwn:3283
[11:32:53] [debug] #1 0001dbc0 in public OnPlayerWeaponShot (... <7 arguments>) at /lib/include/YSI\..\YSI_Data\..\YSI_Coding\..\YSI_Internal\y_cgen.inc:30
The line 3283 is just:
Код:
if(SpawnKill[hitid] == true) { return 0; }
From:
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
...
    // shots in players
    if(hitid != INVALID_PLAYER_ID && paused[hitid] == false) {
        if(health[playerid] <= 0) { return 0; }
        // anti spawn kill damage
        if(SpawnKill[hitid] == true) { return 0; }
And anti spawn is just a bool:
Код:
new bool:SpawnKill[MAX_PLAYERS];



Re: What is this error? - JasonRiggs - 24.07.2018

If you're looping under a loop then that would be a problem, I guess collecting them all in the same line would do.. or show us the full code of this part so we can understand what's going on..


Re: What is this error? - jlalt - 24.07.2018

hittype == 2,
PHP код:
BULLET_HIT_TYPE_VEHICLE         2 
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
...
    
// shots in players
    
if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && paused[hitid] == false) {
        if(
health[playerid] <= 0) { return 0; }
        
// anti spawn kill damage
        
if(SpawnKill[hitid] == true) { return 0; } 



Re: What is this error? - JasonRiggs - 24.07.2018

Quote:
Originally Posted by jlalt
Посмотреть сообщение
hittype == 2,
PHP код:
BULLET_HIT_TYPE_VEHICLE         2 
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
...
    
// shots in players
    
if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && paused[hitid] == false) {
        if(
health[playerid] <= 0) { return 0; }
        
// anti spawn kill damage
        
if(SpawnKill[hitid] == true) { return 0; } 
I believe this is an addition to the system, how would it help??


Re: What is this error? - jlalt - 24.07.2018

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
I believe this is an addition to the system, how would it help??
you're making a variable per player and putting object index inside it ;_; bruh...
MAX_PLAYERS 30 // according to crash log
MAX_OBJECTS 1000 // by default. so object id 54 is > MAX_PLAYERS


Re: What is this error? - JasonRiggs - 24.07.2018

Quote:
Originally Posted by jlalt
Посмотреть сообщение
you're making a variable per player and putting object index inside it ;_; bruh...
MAX_PLAYERS 30 // according to crash log
MAX_OBJECTS 1000 // by default. so object id 54 is > MAX_PLAYERS
What objects mate? There are no objects in here, Maybe you mean that the target is greater than the MAX_PLAYERS, but this shouldn't make us change the hittype thing, Maybe just change the MAX_PLAYERS inside the script itself.


Re: What is this error? - jlalt - 24.07.2018

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
What objects mate? There are no objects in here, Maybe you mean that the target is greater than the MAX_PLAYERS, but this shouldn't make us change the hittype thing, Maybe just change the MAX_PLAYERS inside the script itself.
you're talking without logic now.
He's putting vehicle id instead of player id inside the per player variable. [ mistakenly was saying object instead of vehicle. ]


Re: What is this error? - binnyl - 28.07.2018

Quote:
Originally Posted by jlalt
Посмотреть сообщение
hittype == 2,
PHP код:
BULLET_HIT_TYPE_VEHICLE         2 
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
...
    
// shots in players
    
if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && paused[hitid] == false) {
        if(
health[playerid] <= 0) { return 0; }
        
// anti spawn kill damage
        
if(SpawnKill[hitid] == true) { return 0; } 
Thank you! +Rep