Help with my fuel system :S
#3

pawn Код:
public FuelUpdate()
{
    new string[128];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(GetPlayerState(i) == 2)
        {
            new PVeh = GetPlayerVehicleID(i);
            if(VFuel[PVeh])//If inbettween 1 and 100
            {
                VFuel[PVeh] -= 1;//Remove 1 fuel///
                format(string, 128,"~n~~n~~n~~n~~n~~n~~n~~n~~g~Fuel: ~w~%d%",VFuel[PVeh]);//And show it
                GameTextForPlayer(i,string,18000,3);//In GameText
            }
            else//Else if its 0
            {
                RemovePlayerFromVehicle(i);//Remove Player
                SendClientMessage(i,RED,"This Vehicle Is Out Of Fuel!");//Tell Them Its Empty.
            }
        }
    }
return 1;
}
Try that. It should be more optimized. You really need to only check if the fuel is over 0.
Reply


Messages In This Thread
Help with my fuel system :S - by YungGee - 10.02.2011, 04:09
Re: Help with my fuel system :S - by JamesC - 10.02.2011, 04:29
Re: Help with my fuel system :S - by Backwardsman97 - 10.02.2011, 04:34
Re: Help with my fuel system :S - by YungGee - 10.02.2011, 07:01
Re: Help with my fuel system :S - by Mean - 10.02.2011, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)