[Request]Killengine

Started by KAKAN, Sep 17, 2015, 07:08 AM

Previous topic - Next topic

KAKAN

Hope everybody knows this:- KillEngine() function, It'll stop your vehicle, I don't know the cmd to start it again, So add those two functions, else tell me how to add them
oh no

soulshaker

Vehicle.Kill is already there.

MacTavish

Quote from: soulshaker on Sep 17, 2015, 07:12 AMVehicle.Kill is already there.
but that will blow the vehicle

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

I want to stop the engine of the vehicle, not to blow it away
oh no

EK.IceFlake

#4
function StartEngine(vehicle)
{
    for (local i = 0; i <= 101; ++i)
    {
        if (FindPlayer(i) != null && FindPlayer(i).Vehicle != null && FindPlayer(i).Vehicle.ID == vehicle.ID)
        {
            FindPlayer(i).Eject();
            FindPlayer(i).Vehicle = vehicle;
        }
    }
}

Untested btw, so if you can test it, show us the result!

KAKAN

oh no

EK.IceFlake

You said, KillEngine exists but how to start again.
Anyways you can set top speed to 0 and acceleration to 0 (handling) for killengine and reset 'em for startengine

KAKAN

Okay, It was my fault, any examples to the point you said
oh no


KAKAN

No its not there, I was asking to implement it
oh no

EK.IceFlake

Untested
function CVehicle::KillEngine()
{
    ::SetInstHandlingRule(ID, 13, 0);
    ::SetInstHandlingRule(ID, 14, 0);
}
function CVehicle::StartEngine()
{
    ::ResetInstHandlingRule(::ID, 13);
    ::ResetInstHandlingRule(::ID, 14);
}
Hope it workz