fuel on startup - 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: fuel on startup (
/showthread.php?tid=287830)
fuel on startup -
cruising - 05.10.2011
Hello!
I got a fuel system, and it fills the cars on server startup.
But i have NPCs in vehicles and they cant refuel by them self and get out of fuel.
So how to do to get vehicle ids to get like 9999 fuel? i want id 548 and id 592 to get 9999 in fuel on startup.
Code on OnGameModeInit:
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++) {
fuel[i] = 250 + random(150);
}
Re: fuel on startup -
Pharrel - 05.10.2011
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++) {
fuel[i] = 250 + random(150);
if(i == 592 || i == 548) fuel[i] = 99999;
}
Re: fuel on startup -
cruising - 05.10.2011
Quote:
Originally Posted by Pharrel
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++) { fuel[i] = 250 + random(150); if(i == 592 || i == 548) fuel[i] = 99999; }
|
Getting warning 213: tag mismatch on that and it doesn't work
Re: fuel on startup -
Pharrel - 05.10.2011
i changed him...try again
Re: fuel on startup -
cruising - 05.10.2011
Quote:
Originally Posted by Pharrel
i changed him...try again
|
i have
pawn Код:
if(i == 592 || i == 548) fuel[i] = 99999;
no warning, but it still doesn't work
Re: fuel on startup -
Pharrel - 05.10.2011
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++)
{
if(i == 592 || i == 548)
{
fuel[i] = 99999;
continue;
}
fuel[i] = 250 + random(150);
}
Re: fuel on startup -
cruising - 05.10.2011
Quote:
Originally Posted by Pharrel
pawn Код:
for(new i=0;i<MAX_VEHICLES;i++) { if(i == 592 || i == 548) { fuel[i] = 99999; continue; } fuel[i] = 250 + random(150); }
|
Hmm...it still not working :/
Re: fuel on startup -
Pharrel - 05.10.2011
lol so it must have something in your GM that is setting the fuel after this loop...
Re: fuel on startup -
cruising - 05.10.2011
Quote:
Originally Posted by Pharrel
lol so it must have something in your GM that is setting the fuel after this loop...
|
No i havent, the only thing that can sett the fuel is when you refueling your self.
Re: fuel on startup -
Pharrel - 05.10.2011
idk then... i'm sure that this function works...