Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kid_Buu on May 29, 2018, 02:05 AM

Title: put turn on and off the engine of vehicle ?
Post by: Kid_Buu on May 29, 2018, 02:05 AM
how put turn on and off the engine of vehicle with cmd?
Title: Re: put turn on and off the engine of vehicle ?
Post by: MatheuS on May 29, 2018, 06:40 AM
You should visit the wiki.

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Vehicle.Lights
Title: Re: put turn on and off the engine of vehicle ?
Post by: NicusorN5 on May 29, 2018, 06:01 PM
Quote from: MatheuS on May 29, 2018, 06:40 AMYou should visit the wiki.

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Vehicle.Lights
He meant the engine, not the lights.
Title: Re: put turn on and off the engine of vehicle ?
Post by: umar4911 on May 29, 2018, 06:05 PM
can we turn the engine off in single player? I dont think so
Title: Re: put turn on and off the engine of vehicle ?
Post by: VK.Jona83Killer on May 29, 2018, 06:11 PM
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);
}
Title: Re: put turn on and off the engine of vehicle ?
Post by: NicusorN5 on Jun 01, 2018, 04:28 PM
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.