07.12.2016, 09:47
Alright, hello dear scripters, i had a big problem about my fuel system. The fact is fuel is going down even if the engine is on or off also if a driver is in or not. Here are the codes for fuel. Any ideas or any help? Thanks i will rep you guys if you help me fixing this. Have a nice day.
Код:
forward FuelTimer();
public FuelTimer()
{
for(new vehid=0; vehid < MAX_VEHICLES; vehid++)
{
new enginec, lightsc, alarmc, doorsc, bonnetc, bootc, objectivec;
GetVehicleParamsEx(vehid, enginec, lightsc, alarmc, doorsc, bonnetc, bootc, objectivec);
if(enginec && Fuel[vehid])
{
FuelVar[vehid] ++;
if(GetVehicleSpeed(vehid, 0) != 0 && FuelVar[vehid] >= 72/2)
{
FuelVar[vehid] = 0;
Fuel[vehid] --;
}
else if(GetVehicleSpeed(vehid, 0) == 0 && FuelVar[vehid] >= 108/2)
{
FuelVar[vehid] = 0;
Fuel[vehid] --;
}
}
}
return 1;
}

