[Help] problem with setting fuel to vehicle
#1

Hello I put under ongamemodeinit 15.0 L for motocycles and know is the problem I turn on my server and sit on motocycle and fuel should be 15.0L but instead is 40.0 L. Thanks
Reply
#2

We cannot help without the code.
Reply
#3

Ok this is under ongamemodeinit

pawn Код:
for(new o = 1; o < MAX_VOZILA; o++)
    {
        if(o != INVALID_VEHICLE_ID)
        {
            if(IsPlane(GetVehicleModel(o)) || IsBoat(GetVehicleModel(o)) || IsBus(GetVehicleModel(o))) Gorivo[o] = 80.00;
            else if(IsCar(GetVehicleModel(o))) Gorivo[o] = 40.00;
            else if(IsMotoCycle(GetVehicleModel(o))) Gorivo[o] = 15.00;
            else if(IsTruck(GetVehicleModel(o))) Gorivo[o] = 100.00;
            else if(IsBycle(GetVehicleModel(o)) || GetVehicleModel(o) == 538) Gorivo[o] = 1000000.00;
            else  Gorivo[o] = 40.00;
            if(!IsBycle(GetVehicleModel(o)))
            {
                new engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(o, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(o, 1, 0, alarm, doors, bonnet, boot, objective);
            }
        }
    }
Reply
#4

Anyone? Thanks
Reply
#5

I believe Gorivo = Fuel try these code, what was the use of last else?

pawn Код:
for(new o = 1; o < MAX_VOZILA; o++)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(o != INVALID_VEHICLE_ID)
    {
        if(IsPlane(GetVehicleModel(o)) || IsBoat(GetVehicleModel(o)) || IsBus(GetVehicleModel(o))) Gorivo[o] = 80.00;
        else if(IsCar(GetVehicleModel(o))) Gorivo[o] = 40.00;
        else if(IsMotoCycle(GetVehicleModel(o))) Gorivo[o] = 15.00;
        else if(IsTruck(GetVehicleModel(o))) Gorivo[o] = 100.00;
        else if(IsBycle(GetVehicleModel(o)) || GetVehicleModel(o) == 538) Gorivo[o] = 1000000.00;

        if(!IsBycle(GetVehicleModel(o)))
            return GetVehicleParamsEx(o, engine, lights, alarm, doors, bonnet, boot, objective),
            SetVehicleParamsEx(o, 1, 0, alarm, doors, bonnet, boot, objective);
    }
}
Reply
#6

I try like this it not working
Reply
#7

Anyone? Thanks
Reply
#8

Post IsCar and IsMotoCycle. It seems there's a mistake in IsCar and exists a motorbike in it so the 2nd else if is not called at all.
Reply
#9

I bet those functions try and keep track of vehicles by vehicle id if they do I'm going to shit my pants.
Reply
#10

Konstantinos the stocks isamotocycle and isacar is working beacuse I make again stock and in the isamotocycle is all id of motocycles and isacar is all id of car vehicles
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)