SA-MP Forums Archive
[HELP] I have a error in my GM please help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] I have a error in my GM please help (/showthread.php?tid=180027)



[HELP] I have a error in my GM please help - netfabbe - 29.09.2010

C:\Users\netfabbe\Desktop\GTA Script\gamemodes\tprp.pwn(76762 -- 76769) : error 032: array index out of bounds (variable "vehTrunk")
C:\Users\netfabbe\Desktop\GTA Script\gamemodes\tprp.pwn(76806) : error 032: array index out of bounds (variable "vehTrunk")
C:\Users\netfabbe\Desktop\GTA Script\gamemodes\tprp.pwn(76807) : error 032: array index out of bounds (variable "vehTrunkAmmo")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

public SaveTrunk()
{
new idx;
new File: file2;
idx = 184;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%i,%i,%i,%i,%i,%i,%i,%i,%i,%f\n",
vehTrunk[idx][1],
vehTrunkAmmo[idx][1],
vehTrunk[idx][2],
vehTrunkAmmo[idx][2],
vehTrunk[idx][3],
vehTrunkAmmo[idx][3],
vehTrunk[idx][4],

vehTrunkAmmo[idx][4],
vehTrunkCounter[idx],
vehTrunkArmour[idx]);
if(idx == 1)
{
file2 = fopen("TPRP/Trunks/trunk.cfg", io_write);
}
else
{
file2 = fopen("TPRP/Trunks/trunk.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}

What to do?

Please help me


Re: [HELP] I have a error in my GM please help - Zamaroht - 30.09.2010

Search for a statement somewhere in your script which starts like

pawn Код:
new vehTrunkAmmo
and show us.