[Ajuda] Sistema de combustнvel
#1

Eu nгo manjo muito disso, entгo peguei um sistema que jб funciona, mas, ele sу funciona quando o player estб dentro do veнculo

PHP код:
CheckGas()
{
    foreach(
Playeri)
    {
           if(
GetPlayerState(i) == PLAYER_STATE_DRIVER)
           {
              new 
enginelightsalarmdoorsbonnetbootobjective;
            new 
vehicle GetPlayerVehicleID(i);
               new 
VehicleModel GetVehicleModel(vehicle);
               
GetVehicleParamsEx(vehicleenginelightsalarmdoorsbonnetbootobjective);
               if(
engine == 0)
            {
                break;
            }
               if(
VehicleModel == 487 || VehicleModel == 520 || VehicleModel == 462 ||
               
VehicleModel == 497 || VehicleModel == 425 || VehicleModel == 592 ||
               
VehicleModel == 519 || VehicleModel == 593 || VehicleModel == 452 ||
               
VehicleModel == 510)
               {
                   continue;
               }
               if(
IsARespCar(vehicle))
               {
                   continue;
               }
            new 
Float:health GetPlayerVehicleHealth(i);
            if(
health 20)continue;
               if(
Gas[vehicle] >= && vehicle TOTAL_CARROS)
               {
                   if(
Gas[vehicle] <= 10)
                   {
                       
PlayerPlaySound(i10850.00.00.0);
                   }
                   if(
Gas[vehicle] >= && Gas[vehicle] < 4)
                   {
                     new 
rdon random(10);
                    if(
rdon >= && rdon <= 7)
                    {
                         
GetVehicleParamsEx(vehicleenginelightsalarmdoorsbonnetbootobjective);
                           
SetVehicleParamsEx(vehicleVEHICLE_PARAMS_OFFlightsalarmdoorsbonnetbootobjective);
                        foreach(
Playerpp)
                        {
                            if(
GetPlayerVehicleID(pp) == vehicle)
                            {
                                
SendClientMessage(ppCOLOR_GRAD1"Aviso: Pouco combustivel no veiculo, o motor desligou. De a partida novamente!");
                            }
                        }
                    }
                   }
                   
Gas[vehicle]--;
                   
UpdateGas(vehicle);
               }
               else if(
CarConce[vehicle] >= 0)
               {
                   if(
Gas[vehicle] <= 10)
                   {
                       
PlayerPlaySound(i10850.00.00.0);
                   }
                   if(
Gas[vehicle] >= && Gas[vehicle] < 4)
                   {
                     new 
rdon random(10);
                    if(
rdon >= && rdon <= 7)
                    {
                         
GetVehicleParamsEx(vehicleenginelightsalarmdoorsbonnetbootobjective);
                           
SetVehicleParamsEx(vehicleVEHICLE_PARAMS_OFFlightsalarmdoorsbonnetbootobjective);
                        foreach(
Playerpp)
                        {
                            if(
GetPlayerVehicleID(pp) == vehicle)
                            {
                                
SendClientMessage(ppCOLOR_GRAD1"Aviso: Pouco combustivel no veiculo, o motor desligou. De a partida novamente!");
                            }
                        }
                    }
                   }
                   
Gas[vehicle]--;
                   
UpdateGas(vehicle);
               }
               else
               {
                   if(
vehicle >= TOTAL_CARROS)continue;
                
NoFuel[i] = 1;
                
PlayerPlaySound(i11590.00.00.0);
                 
GetVehicleParamsEx(vehicleenginelightsalarmdoorsbonnetbootobjective);
                   
SetVehicleParamsEx(vehicleVEHICLE_PARAMS_OFFlightsalarmdoorsbonnetbootobjective);
                
GameTextForPlayer(i,"~r~Sem combustivel~n~~y~Chame um mecanico para ajudar",1500,3);
                
UpdateGas(vehicle);
            }
           }
       } 
O que precisa ser feito para continuar o consumo de combustнvel mesmo quando o player estiver fora do veнculo?
Reply


Messages In This Thread
Sistema de combustнvel - by _MtM_ - 27.12.2016, 18:48
Re: Sistema de combustнvel - by MkeY - 27.12.2016, 19:13
Re: Sistema de combustнvel - by _MtM_ - 27.12.2016, 19:33
Respuesta: Sistema de combustнvel - by SammyJ - 27.12.2016, 19:52
Re: Sistema de combustнvel - by _MtM_ - 27.12.2016, 23:49
Re: Sistema de combustнvel - by didimk157 - 28.12.2016, 00:07

Forum Jump:


Users browsing this thread: 1 Guest(s)