27.12.2016, 19:52
Vocк terб que que refazer esse cуdigo.
Base:
Base:
PHP код:
## Base ##
CheckGas()
{
for(new vehicleid, v = GetVehiclePoolSize(); vehicleid <= v; ++vehicleid)// loop passando por todos os veiculos conectados.
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine <= VEHICLE_PARAMS_OFF) // veiculo desligado
continue;
if(Gas[vehicleid] <= 0){ // caso o veiculo nгo tenha combustivel.
SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
else{
Gas[vehicleid]--;
}
}
return false;
}