Hello, i some problem with error 4 -
Danielknow - 14.09.2018
[debug] Run time error 4: "Array index out of bounds"
[debug] AMX backtrace:
[debug] #0 001dd5a4 in public WC_OnPlayerPickUpPickup (0, 4
from SAIW.amx
[debug] #1 0000a280 in public OnPlayerPickUpPickup (0, 4
from SAIW.amx
any one know how to fix it?
tell if need to share the lines.
Re: Hello, i some problem with error 4 -
AzaMx - 14.09.2018
show the line
Re: Hello, i some problem with error 4 -
Danielknow - 14.09.2018
Quote:
Originally Posted by AzaMx
show the line
|
i cant found this line, using mw3 script.
any idea?
Public OnPlayerPickUpPickup (0, 48 )"
Re: Hello, i some problem with error 4 -
AmirSavand - 14.09.2018
You're trying to access an array with an invalid index.
Example:
PHP код:
new playerKills[MAX_PLAYERS];
// And somewhere in on player death
playerKills[killerid]++;
In this code, killerid could be INVALID_PLAYER_ID which exceed the MAX_PLAYERS therefor you get the invalid index error.
Share your code so we can help you.
Re: Hello, i some problem with error 4 -
KinderClans - 14.09.2018
Quote:
Originally Posted by Danielknow
i cant found this line, using mw3 script.
any idea?
Public OnPlayerPickUpPickup (0, 48 )"
|
Just copy the full OnPlayerPickUpPickup callback.
Re: Hello, i some problem with error 4 -
AmirSavand - 14.09.2018
Quote:
Originally Posted by Danielknow
i cant found this line, using mw3 script.
any idea?
Public OnPlayerPickUpPickup (0, 48 )"
|
If you had this code in a repo I could fix it for you, but I assume you don't.
You should know which line it is in the debug lines but if you can't find it, search for "OnPlayerPickUpPickup" in you gamemode.
Re: Hello, i some problem with error 4 -
Danielknow - 14.09.2018
Quote:
Originally Posted by AzaMx
show the line
|
Quote:
Originally Posted by KinderClans
Just copy the full OnPlayerPickUpPickup callback.
|
Quote:
Originally Posted by AmirSavand
If you had this code in a repo I could fix it for you, but I assume you don't.
You should know which line it is in the debug lines but if you can't find it, search for "OnPlayerPickUpPickup" in you gamemode.
|
https://github.com/DanielKnow/Error-...%204%20problem
Re: Hello, i some problem with error 4 -
AmirSavand - 14.09.2018
Quote:
Originally Posted by Danielknow
|
Wow, did you just make an entire repo for a simple error?
Show more from the server log. The code is pretty big.
There's lots of arrays, where's the rest of the log and line number?
Код:
[debug] Run time error 4: "Array index out of bounds"
[debug] AMX backtrace:
[debug] #0 001dd5a4 in public WC_OnPlayerPickUpPickup (0, 4 from SAIW.amx
[debug] #1 0000a280 in public OnPlayerPickUpPickup (0, 4 from SAIW.amx
Re: Hello, i some problem with error 4 -
Calisthenics - 14.09.2018
Compile the script with -d3 flag and run the server (
https://github.com/Zeex/samp-plugin-...ith-debug-info), you will be able to find the specific line caused this run time error and will also help for future run time errors.
Looking at the code, this is a part that could cause it if "gt" is out of bounds:
https://github.com/DanielKnow/Error-...blem#L202-L204
Re: Hello, i some problem with error 4 -
AmirSavand - 14.09.2018
Quote:
Originally Posted by Calisthenics
|
PHP код:
new cat[250], gt = gTeam[playerid];
strcat(cat, "{FFFFFF}Remote AirStrike Control System (RACS){FF0000}\t{FFFFFF}Cost :{45FF00} 50XP\n{FFFFFF}Base Defence (");
new CMDBaseDeftic = CMDBaseDeftick[gt];
Could be but it's wasting time unless he finds out the exact line of error.