Fuel decreases even though velocity is 0
#1

Topic explains everything. This timer is called every 6 seconds

PHP код:
public timer_update()
{
    for(new 
i=0;i<MAX_PLAYERS;i++)
    {
        new 
Float:Velocity[3];
        new 
vid GetPlayerVehicleID(i);
          
GetVehicleVelocity(vidVelocity[0], Velocity[1], Velocity[2]);
        if(
Velocity[0] == && Velocity[1] == && Velocity[2] == 0) return 0;
        if (
isrefuelling[i]) return 0;
        if (
GetPlayerVehicleSeat(i) == 0)
        {
            if(
Engine[i] == 1)
            {
                
fuel[vid] = fuel[vid] - 1;
                if (
fuel[vid]<1)
                {
                    
fuel[vid] = 0;
                    new 
veh GetPlayerVehicleID(i);
                    new 
engine,lights,alarm,doors,bonnet,boot,objective;
                    
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    
GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4);
                    
Engine[i] = 0;
                }
            }
        }
        new 
string[128];
        
format(string,sizeof string,"~b~Fuel: ~w~%i%"fuel[vid]);
        
PlayerTextDrawSetString(ivehFuel[i],string);
    }
    return 
1;

Reply


Messages In This Thread
Fuel decreases even though velocity is 0 - by NealPeteros - 30.04.2017, 07:05
Re: Fuel decreases even though velocity is 0 - by SoLetsGO - 30.04.2017, 08:36
Re: Fuel decreases even though velocity is 0 - by Vince - 30.04.2017, 09:11
Re: Fuel decreases even though velocity is 0 - by raydx - 30.04.2017, 09:26

Forum Jump:


Users browsing this thread: 1 Guest(s)