Why does this not work please
#10

pawn Код:
public timer_fuel_lower()
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    for(new i=0;i<MAX_Vehicles;i++)
    {
        GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(engine == 1)
        {
            fuel[i] -= 1;
        }
    }
    return 1;
}
Edit:

Then you can make a function to show the player the current fuel

pawn Код:
public ShowGas()
{
    new str[15];
    new engine, lights, alarm, doors, bonnet, boot, objective;
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            if(fuel[GetPlayerVehicleID(i)] == 0)
            {
                GetVehicleParamsEx(GetPlayerVehicleID(i), engine, lights, alarm, doors, nonnet, boot, objective);
                SendClientMessage(i, -1, "Your car ran out of fuel!");
                SetVehicleParamsEx(GetPlayerVehicleID(i),  0,  lights, alarm, doors, bonnet, boot, objective);
            }    
            format(str, sizeof(str), "Fuel:%i",  fuel[GetPlayerVehicleID(i)]);
            GameTextForPlayer(i, str, 3000, 3);
        }

}
Should do it.
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: 2 Guest(s)