28.11.2011, 13:42
pawn Код:
public OnGameModeInit()
{
//things
SetTimer("FuelConsumption", 5000, true);
return 1;
}
new VehicleGas[MAX_VEHICLES];
forward FuelConsumption();
public FuelConsumption()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
GetVehicleParamsEx(vehgas,engine,lights,alarm,doors,bonnet,boot,objective);
if(IsPlayerInAnyVehicle(i)) {} else return 1;
new vehgas = GetPlayerVehicleID(i);
VehicleGas[vehgas] -= 1;
if(VehicleGas[vehgas] >= 0) SetVehicleParamsEx(vehgas, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}