Why does this not work please
#1

How comes when im out of a vehicle and the engine is on the fuel does not go down

pawn Код:
public timer_fuel_lower()
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    for(new i=0;i<MAX_PLAYERS;i++) { //loop for all players
        new PlayerVehicle = GetVehicleFileID(GetPlayerVehicleID(i));
        if (isrefuelling[i]) continue; //stop when a player is already refuelling
        new vid = GetPlayerVehicleID(i); //getting vehicle ID
        if (GetPlayerVehicleSeat(i) == 0 && EngineOn[vid] == 1 || IsPlayerInHotWiredCar == 1 || Vehicles[PlayerVehicle][CarGroup] >= 0 && Vehicles[PlayerVehicle][CarGroup] == Player[i][Group]) { //if the player is a driver (it should only lower the fuel when theres an driver!)
            fuel[vid] = fuel[vid] -1; //lowering fuel value
            if (fuel[vid]<1) //if fuel is empty
            {
                GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                fuel[vid] = 0; //setting fuel to 0 (else the timer will set it to -1 -2 -3 etc before removing player)
                SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, 0);
                SendClientMessage(i, WHITE, "This vehicle is out of fuel");
            }
        }
        new string[125];format(string,sizeof string,"Fuel:%i",fuel[vid]); //preparing string with next fuel value
        TextDrawSetString(td_fuel[i],string); //updating textdraw
    }
    for(new veh = 0; veh < MAX_VEHICLES; veh ++)
    {
          if(EngineOn[veh] == 1 && !DoesVehHaveDriver(veh))
          {
                fuel[veh] --;
          }
     }
    return 1;
}
Thank You
Reply


Messages In This Thread
Why does this not work please - by Geniuss - 09.06.2012, 12:53
Re: Why does this not work please - by JaKe Elite - 09.06.2012, 12:56
Re: Why does this not work please - by Azazelo - 09.06.2012, 12:57
Re: Why does this not work please - by Geniuss - 09.06.2012, 12:58
Re: Why does this not work please - by Geniuss - 09.06.2012, 13:00
Re: Why does this not work please - by JhnzRep - 09.06.2012, 14:00
Re: Why does this not work please - by Geniuss - 09.06.2012, 14:14
Re: Why does this not work please - by JhnzRep - 09.06.2012, 14:16
Re: Why does this not work please - by Geniuss - 09.06.2012, 14:32
Re: Why does this not work please - by JhnzRep - 09.06.2012, 14:38

Forum Jump:


Users browsing this thread: 1 Guest(s)