SA-MP Forums Archive
Help me please - 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: Help me please (/showthread.php?tid=488314)



Help me please - TwisTa98 - 17.01.2014

Hello! I am making some trucking server and i have problem in script.

Errors:
Код HTML:
C:\Documents and Settings\Admin\Рабочий стол\Server\gamemodes\Trucking.pwn(925) : error 028: invalid subscript (not an array or too many subscripts): "fuel"
C:\Documents and Settings\Admin\Рабочий стол\Server\gamemodes\Trucking.pwn(925) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Рабочий стол\Server\gamemodes\Trucking.pwn(925) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Рабочий стол\Server\gamemodes\Trucking.pwn(925) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Рабочий стол\Server\gamemodes\Trucking.pwn(925) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 925:
Код HTML:
fuel[i] = 100;
What i do ? please help me. Thank you in advance!


Re: Help me please - iOxide - 17.01.2014

That [i] statement is only used when you have looped through something. And as far as i guessed you haven't looped through the "fuel" thingy and used [i] directly. Can you show the function that has this line?


Re: Help me please - TwisTa98 - 17.01.2014

Yeah. That's in "OnGameModeInit".

Quote:

for(new i = 0; i < MAX_VEHICLES; i++)
{
new str[32];
fuel[i] = 100;
format(str,sizeof(str),"UT 5%03i",i);
SetVehicleNumberPlate(i,str);
}
SetTimer("fuel",70000,true);




Re: Help me please - iOxide - 17.01.2014

pawn Код:
new str[32];
for(new i = 0; i < MAX_VEHICLES; i++)
{
    fuel[i] = 100;
    SetVehicleNumberPlate(i,str);
    format(str,sizeof(str),"UT 5%03i",i);
}
SetTimer("fuel",70000,true);
Try that?


Re: Help me please - TwisTa98 - 17.01.2014

The same error again.


Re: Help me please - iOxide - 17.01.2014

Do you have that "fuel" thingy defined anywhere? Also tell me which gamemode are you editing (if its a downloaded one) I am also scripting a trucking server so i might be able to help you.


Re: Help me please - TwisTa98 - 17.01.2014

Yeah, i have defined as "new fuel[MAX_VEHICLES];" on the TOP.

I am editing "Ultimate Trucking 2.0".

If you have skype, add me: mc.zaz98

thank you.


Re: Help me please - iOxide - 17.01.2014

I have compiled the script on Ultimate Trucking and it worked fine without any errors warnings. There might be something wrong on your gamemode. Maybe you did something wrong while editing it?


Re: Help me please - TwisTa98 - 17.01.2014

No. I just replace all "fuel" word to "Benzini" and after that, i get errors. After i replace all "Benzini" to "fuel" for fix, but it not fixed.


Re: Help me please - iOxide - 17.01.2014

Ok, copy all your gamemode's script and paste it on pastebin.com then send it to me via forum pm. I will try to fix it for you.