07.12.2016, 09:56
Show us your engine command or how you close the engine?
EDIT: Also,
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
since 0.3a you will have to reapply this function when OnVehicleStreamIn is called.
EDIT 2:
Optimized version of the code can be...
EDIT: Also,
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
since 0.3a you will have to reapply this function when OnVehicleStreamIn is called.
EDIT 2:
Optimized version of the code can be...
PHP код:
// top of the script
native IsValidVehicle(vehicleid);
// somewhere in the script
forward FuelTimer();
public FuelTimer()
{
for(new vehid, veh = GetVehiclePoolSize(); vehid <= veh; vehid++)
{
if(IsValidVehicle(vehid))
{
new enginec, lightsc, alarmc, doorsc, bonnetc, bootc, objectivec;
GetVehicleParamsEx(vehid, enginec, lightsc, alarmc, doorsc, bonnetc, bootc, objectivec);
if(enginec)
{
if(Fuel[vehid] > 0)
{
if(GetVehicleSpeed(vehid, 0) != 0)
{
FuelVar[vehid] ++;
if(FuelVar[vehid] >= 72/2)
{
FuelVar[vehid] = 0;
Fuel[vehid] --;
}
else if(FuelVar[vehid] >= 108/2)
{
FuelVar[vehid] = 0;
Fuel[vehid] --;
}
}
}
}
}
}
return 1;
}