17.06.2014, 21:39
(
Последний раз редактировалось Luca12; 18.06.2014 в 01:22.
)
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
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;
}