put turn on and off the engine of vehicle ?

Started by Kid_Buu, May 29, 2018, 02:05 AM

Previous topic - Next topic

Kid_Buu

how put turn on and off the engine of vehicle with cmd?

MatheuS

if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.


umar4911

can we turn the engine off in single player? I dont think so
I am gamer, programmer and hacker. Try to find me!
xD

VK.Jona83Killer

Use this:

else if ( cmd == "engine" )
{
if ( !text ) MessagePlayer( "type /engine (on/off)", player);
else if ( text == "on" )
{
local veh = player.Vehicle;
veh.ResetHandlingData( 13 );
veh.ResetHandlingData( 14 );
MessagePlayer("Engine turned on!", player);
}
else if ( text == "off" )
{
local veh = player.Vehicle;
veh.Speed = Vector( 0, 0, 0 );
veh.SetHandlingData( 13, 0 );
veh.SetHandlingData( 14, 0 );
MessagePlayer("Vehicle lights are turned off", player);
}
else MessagePlayer("Engine turned off!", player);
}

NicusorN5

Quote from: VK.Jona83Killer on May 29, 2018, 06:11 PMUse this:

else if ( cmd == "engine" )
{
if ( !text ) MessagePlayer( "type /engine (on/off)", player);
else if ( text == "on" )
{
local veh = player.Vehicle;
veh.ResetHandlingData( 13 );
veh.ResetHandlingData( 14 );
MessagePlayer("Engine turned on!", player);
}
else if ( text == "off" )
{
local veh = player.Vehicle;
veh.Speed = Vector( 0, 0, 0 );
veh.SetHandlingData( 13, 0 );
veh.SetHandlingData( 14, 0 );
MessagePlayer("Vehicle lights are turned off", player);
}
else MessagePlayer("Engine turned off!", player);
}
Only works with default vehicles.