SA-MP Forums Archive
[HELP] fuel wrong set - 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] fuel wrong set (/showthread.php?tid=507174)



[HELP] fuel wrong set - Luca12 - 16.04.2014

Hello I have a fuel system and know is the problem when I turn on server and go to nrg it say's that is fuel 40 L but it should be 15 L?.For buses cars and trucks it work's fine. What cause that problem? Thanks

Here is code for setting fuel on ongamemodeinit


pawn Код:
for(new o = 1; o < MAX_CARS; o++)
    {
        if(o != INVALID_VEHICLE_ID)
        {
            if(IsAPlane(GetVehicleModel(o)) || IsABus(GetVehicleModel(o))) Fuel[o] = 80.00;
            else if(IsACar(GetVehicleModel(o))) Fuel[o] = 40.00;
            else if(IsAMotocycle(GetVehicleModel(o))) Fuel[o] = 15.00;
            else if(IsATruck(GetVehicleModel(o))) Fuel[o] = 100.00;
            else  Fuel[o] = 40.00;
        }
    }



Re : [HELP] fuel wrong set - S4t3K - 16.04.2014

Try removing this from your code

PHP код:
            else  Fuel[o] = 40.00
Then rebuild and retry.


Re: [HELP] fuel wrong set - Luca12 - 16.04.2014

Then it all goes wrong. I already try that.


Re : [HELP] fuel wrong set - S4t3K - 16.04.2014

Does the fuel has a minimum ?


Re: [HELP] fuel wrong set - Riddick94 - 16.04.2014

Well, pretty obvious is go and check your custom function:

pawn Код:
IsAMotocycle
and find out if there's NRG's ID. Right?

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Try removing this from your code

PHP код:
            else  Fuel[o] = 40.00
Then rebuild and retry.
What value you going to set to the vehicles not included in if statements then? Of course, you're wrong.