5 errors on my code: - 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: 5 errors on my code: (
/showthread.php?tid=238947)
5 errors on my code: -
Kieron532 - 12.03.2011
Hello, i'm attempting to compile my script, but it has 5 errors, it was 9 errors but i managed to fix it down to 5, but nothing i try seems to work for this:
Код:
public LoadRefundCars()
{
new arrCoords[42][64];
new strFromFile2[256];
new File: file = fopen("cars2.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(RefundcInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
RefundcInfo[idx][rcModel] = strval(arrCoords[0])
RefundcInfo[idx][rcLocationx] = floatstr(arrCoords[1]);
RefundcInfo[idx][rcLocationy] = floatstr(arrCoords[2]);
RefundcInfo[idx][rcLocationz] = floatstr(arrCoords[3]);
RefundcInfo[idx][rcAngle] = floatstr(arrCoords[4]);
RefundcInfo[idx][rcColorOne] = strval(arrCoords[5]);
RefundcInfo[idx][rcColorTwo] = strval(arrCoords[6]);
strmid(RefundcInfo[idx][rcOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(RefundcInfo[idx][rcDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
RefundcInfo[idx][rcValue] = strval(arrCoords[9]);
RefundcInfo[idx][rcLicense] = strval(arrCoords[10]);
RefundcInfo[idx][rcOwned] = strval(arrCoords[11]);
RefundcInfo[idx][rcLock] = strval(arrCoords[12]);
RefundcInfo[idx][rcMod][0] = strval(arrCoords[13]);
RefundcInfo[idx][rcMod][1] = strval(arrCoords[14]);
RefundcInfo[idx][rcMod][2] = strval(arrCoords[15]);
RefundcInfo[idx][rcMod][3] = strval(arrCoords[16]);
RefundcInfo[idx][rcMod][4] = strval(arrCoords[17]);
RefundcInfo[idx][rcMod][5] = strval(arrCoords[18]);
RefundcInfo[idx][rcMod][6] = strval(arrCoords[19]);
RefundcInfo[idx][rcMod][7] = strval(arrCoords[20]);
RefundcInfo[idx][rcMod][8] = strval(arrCoords[21]);
RefundcInfo[idx][rcMod][9] = strval(arrCoords[22]);
RefundcInfo[idx][rcDonate] = strval(arrCoords[23]);
RefundcInfo[idx][rcFuel] = strval(arrCoords[24]);
RefundcInfo[idx][rcTrunkWep][1] = strval(arrCoords[25]);
RefundcInfo[idx][rcTrunkAmmo][1] = strval(arrCoords[26]);
RefundcInfo[idx][rcTrunkWep][2] = strval(arrCoords[27]);
RefundcInfo[idx][rcTrunkAmmo][2] = strval(arrCoords[28]);
RefundcInfo[idx][rcTrunkWep][3] = strval(arrCoords[29]);
RefundcInfo[idx][rcTrunkAmmo][3] = strval(arrCoords[30]);
RefundcInfo[idx][rcTrunkWep][4] = strval(arrCoords[31]);
RefundcInfo[idx][rcTrunkAmmo][4] = strval(arrCoords[32]);
RefundcInfo[idx][rcTrunkArmour] = floatstr(arrCoords[33]);
RefundcInfo[idx][rcTrunkCounter] = strval(arrCoords[34]);
RefundcInfo[idx][rcAlarm] = strval(arrCoords[35]);
RefundcInfo[idx][rcTrunkDrugs] = strval(arrCoords[36]);
RefundcInfo[idx][rcTrunkMats] = strval(arrCoords[37]);
RefundcInfo[idx][rcImpounded] = strval(arrCoords[38]);
RefundcInfo[idx][rcImpoundedPrice] = strval(arrCoords[39]);
RefundcInfo[idx][rcInsur] = strval(arrCoords[40]);
RefundcInfo[idx][rcHealth] = floatstr(arrCoords[41]);
idx++;
}
}
fclose(file);
return 1;
}
and i get this in my compile log:
Код:
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(37) : error 020: invalid symbol name ""
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(40) : warning 215: expression has no effect
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(41) : warning 215: expression has no effect
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(41) : error 001: expected token: ";", but found "]"
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\little annies\DS\gamemodes\OnGameMode.pwn(41) : fatal error 107: too many error messages on one line
Re: 5 errors on my code: -
Kieron532 - 12.03.2011
Bump
Re: 5 errors on my code: -
xir - 12.03.2011
which ones are the error lines?
Re: 5 errors on my code: -
Kieron532 - 12.03.2011
The ones which show errors are:
while (idx < sizeof(RefundcInfo)) <THIS ONE IS ERROR LINE 37>
split(strFromFile2, arrCoords, ','); <ERRORLINE 40>
RefundcInfo[idx][rcModel] = strval(arrCoords[0]) <Errorline 41>
Re: 5 errors on my code: -
Scrip - 12.03.2011
pawn Код:
RefundcInfo[idx][rcModel] = strval(arrCoords[0]);
and this i think
pawn Код:
if(idx < sizeof(RefundcInfo))
Re: 5 errors on my code: -
Kieron532 - 12.03.2011
If i delete those, it just gives me more errors, so i won't attempt deleting again.
Is there anything wrong with the actual code itself? Is there an INC i'm missing? i have major ones like SSCANF2 ect.
Re: 5 errors on my code: -
Kieron532 - 13.03.2011
Sorry for double post but i really need some help on this, my gamemode will not start without these 5 errors fixed can someone attempt to fix this for me? I have searched for hours and no luck