[Ayuda] Como detectar si el motor del auto estб prendido
#1

Quiero saber como detectar si el motor del auto esta encendido, para hacer que si estб encendido, empiece a restar la variable de la gasolina, y si esta apagado, se quede tal y como estб.
Gracias.
Reply
#2

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == VEHICLE_PARAMS_ON) // Si es verdadero entonces el motor esta encendido.
if(engine == VEHICLE_PARAMS_OFF) // Si es verdadero entonces el motor esta apagado.
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == VEHICLE_PARAMS_ON) // Si es verdadero entonces el motor esta encendido.
if(engine == VEHICLE_PARAMS_OFF) // Si es verdadero entonces el motor esta apagado.
Solo deberia detectar si el auto esta Encendido si esta encendido haz que reste la variable de gas, pues si esta off no se ejecutara esa funcion, saludos... (Esto lo digo por que depronto pondras if(engine == VEHICLE_PARAMS_ON), y luego else if(engine == VEHICLE_PARAMS_OFF)
Reply
#4

---> https://sampwiki.blast.hk/wiki/GetVehicleParamsEx
---> https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
---> https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights
Reply
#5

pawn Код:
CMD:test(playerid, params[])
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    switch(engine)
    {
        case VEHICLE_PARAMS_ON:
        {
            // Si es verdadero entonces el motor esta encendido.
        }
        case VEHICLE_PARAMS_OFF:
        {
            // Si es verdadero entonces el motor esta apagado.
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)