OnPlayerEnterVehicle
#1

How to disable the this problem.If a player enter in a car, If vehicle id 481, 509, 510 , The car engine will not off. Like the car's do. How to fix the problem?

I have Added this line too

Код:
case 509, 481, 510: VehicleFuel[vehicleid] = 100, arr_Engine{vehicleid} = 1, SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
But still problem
Reply
#2

What do you mean by
Quote:

The car engine will not off

?
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
What do you mean by
?
I mean, In bike vehicle. ( Padel bike ) Should not have to off. like engine car
Reply
#4

Bikes(In GTA) has no motor, so are you trying to turn something that doesn't exist off when you get in a bike ?

Maybe if you tell me why are you trying to do this I would understand..

however, to turn the vehicle motor off use this
pawn Код:
stock DisableVehicleEngine(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
Reply
#5

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Bikes(In GTA) has no motor, so are you trying to turn something that doesn't exist off when you get in a bike ?

Maybe if you tell me why are you trying to do this I would understand..
LOL no. I mean, If i enter a car, The car engine off. and i need to type /engine or /car engine to open it right?
Yes it is right./
But when i enter on a bike, The car also want /engine or /car engine . So I need to fix the problem. how to do that?
Reply
#6

Got it, and I showed you the codes to do it..

if, by default the motors are off, use my code

but if you disable it when somebody enters a vehicle, then don't when it's a bike.
Reply
#7

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Got it, and I showed you the codes to do it..

if, by default the motors are off, use my code

but if you disable it when somebody enters a vehicle, then don't when it's a bike.
Thanks. But where is the codes?
Reply
#8

use "DisableVehicleEngine(vehicleid)" wherever you want to turn the engine off
pawn Код:
stock DisableVehicleEngine(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
Reply
#9

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
use "DisableVehicleEngine(vehicleid)" wherever you want to turn the engine off
pawn Код:
stock DisableVehicleEngine(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
}
I have ask for only bike . not for whole car system
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new model = GetVehicleModel(vehicleid);
       
        switch(model)
        {
            case 481, 509, 510://Bikes, add more if you wish..
            {
                new engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)