[HELP] fuel down timer
#1

Hello I was that every 40 seconds fuel down for 0.01 for example 15.0 then it will go 14.9 etc know the problem I turn gamemode and I sit in vehicle and driver for a while and then fuel is set to 14.9 of if is a car it was 40.0 then 39.9 and then 40 seconds are passed and fuel is still standing at 39.9 instead to go on 39.8

edit: I was put for timer 1000 miliseconds which is one second and know it lower down fuel but I want to lower every 30 or 40 seconds and if I put for 30 seconds or more it just lover fuel to 39.9 and it's stay like this

first in ongamemodeinit I have timer

SetTimer("FuelTimer",Sec(45),1);

then I have fueltimer


pawn Код:
forward FuelTimer();
public FuelTimer()
{
    for(new car = 1; car < MAX_VOZILA; car++)
    {
        if(VoziloJeBiciklo(car)) continue;
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == 1 && Gorivo[car] > 0.00) Gorivo[car] = floatsub(Gorivo[car],0.01); here is that so if the engine of vehicle is turned on then it set fuel down for 0.01
    }
    foreach(Player,i)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new string[128];
            format(string,sizeof string,"%.1fl",Gorivo[GetPlayerVehicleID(i)]); and here I update my fuel textdraw.
            TextDrawSetString(Speedometar0[i],string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] fuel down timer - by Luca12 - 17.06.2014, 21:39
Re: [HELP] fuel down timer - by Ciandlah - 18.06.2014, 08:22
Re: [HELP] fuel down timer - by TheKillZone - 18.06.2014, 09:09

Forum Jump:


Users browsing this thread: 1 Guest(s)