wtf>? bikes have fuel
#1

well, I have downloaded a fuel system and later I upgraded it and it works enough good BUT ITS WORKS FOR EVERY VEHICLES and that is my problem, if think real bikes ( bmx etc ) doesn't have fuel and I put condition for avoid it but doesn't work wtf? help me plz
pawn Код:
forward BenzinUpdate();
public BenzinUpdate()
{
    new string[256];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new vehicle = GetPlayerVehicleID(i);
            if(GetPlayerVehicleID(i) != 481 && GetPlayerVehicleID(i) != 509 && GetPlayerVehicleID(i) != 510)
            {
            if(IsPlayerInAnyVehicle(i) == 1)
            {
                if(Gas[vehicle] == 0)
                {
                        format(string, sizeof(string), "~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~FUEL: ~l~--");
                        GameTextForPlayer(i,string,10000,3);
                        new engine, lights, alarm, doors, bonnet, boot, objective;
                        GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
                        SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
                }
                else if(Gas[vehicle] > 0 && Gas[vehicle] <= 10)
                {
                        format(string, sizeof(string), "~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~FUEL: ~r~%d%",Gas[vehicle]);
                        GameTextForPlayer(i,string,5000,3);
                }
                else if(Gas[vehicle] >= 11 && Gas[vehicle] <= 50)
                {
                        format(string, sizeof(string), "~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~FUEL: ~y~%d%",Gas[vehicle]);
                        GameTextForPlayer(i,string,5000,3);
                }
                else if(Gas[vehicle] >= 51 && Gas[vehicle] <= 100)
                {
                        format(string, sizeof(string), "~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~FUEL: ~g~%d%",Gas[vehicle]);
                        GameTextForPlayer(i,string,5000,3);
                }
                return 1;
            }
            return 1;
            }
            return 1;
        }
        return 1;
    }
    return 1;
}
forward CheckGas();
public CheckGas()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                new vehicle = GetPlayerVehicleID(i);
                if(GetPlayerVehicleID(i) != 481 && GetPlayerVehicleID(i) != 509 && GetPlayerVehicleID(i) != 510)
                {
                if(Gas[vehicle] >= 1)
                {
                Gas[vehicle]--;
                return 1;
                }
                return 1;
                }
                return 1;
            }
            return 1;
        }
        return 1;
    }
    return 1;
}
http://i43.tinypic.com/65twcm.png
Reply


Messages In This Thread
wtf>? bikes have fuel - by mineralo - 31.01.2012, 17:25
Re: wtf>? bikes have fuel - by mineralo - 01.02.2012, 11:51
Re: wtf>? bikes have fuel - by Baboon - 01.02.2012, 11:58

Forum Jump:


Users browsing this thread: 1 Guest(s)