Array index out of bonus - 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: Array index out of bonus (
/showthread.php?tid=645360)
Array index out of bonus -
None1337 - 25.11.2017
Hello, I have a big problem with my commands /vehicles where is shows me a list of all my own vehicles .
the problem is sometimes the command give me some errors:
Код:
[19:56:32] [debug] Run time error 4: "Array index out of bounds"
[19:56:32] [debug] AMX backtrace:
[19:56:32] [debug] #0 001a9030 in public cmd_vehicles (playerid=0, params[]=@01570b48 "") at D:\gamemode\gamemodes\exgaming.pwn:26313
[19:56:32] [debug] #1 001a89b4 in public cmd_v (playerid=0, params[]=@01570b48 "") at D:\gamemode\gamemodes\exgaming.pwn:26291
[19:56:32] [debug] #2 native CallLocalFunction () from samp03svr
[19:56:32] [debug] #3 00039dc8 in public OnPlayerCommandText (playerid=0, cmdtext[]=@01570b3c "/v") at D:\gamemode\pawno\include\zcmd.inc:102
/vehicles:
https://pastebin.com/gY9nbdqD
Can someone help me please?
Re: Array index out of bonus -
xMoBi - 25.11.2017
show some log before that backtrace too
Re: Array index out of bonus -
Misiur - 25.11.2017
pawn Код:
aVehicleNames[PlayerInfo[playerid][pCarModel][id] - 400]
I'm 100% certain this is the cause. PlayerInfo[playerid][pCarModel][id] is probably -1/0/whatever else, something what you don't expect