Vehicle::defaultEngineBehaviour: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
m (Incorrect note for use. Should be using Config Flag as well to ensure Animation is fixed)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
Lets you disable the default engine behaviour (when you enter a vehicle, the player automatically turns on the engine). Setting this to false will stop the player from turning the engine on.<br>
<b>Note:</b><br>
It is best to set the config flag: [[Player_Config_Flags|PED_FLAG_STOP_ENGINE_TURNING]] - to ensure the player doesn't attempt to turn the engine resulting in a strange animation.
<pre>mp.players.local.setConfigFlag(429, true);</pre>


Lets you disable the default engine behaviour (when you enter a vehicle, the player automatically turns on the engine). Setting this to false will stop the player from turning the engine on.


{{JSContainer|
{{JSContainer|
Line 7: Line 12:


<pre>
<pre>
mp.game.vehicle.defaultEngineBehaviour = enabled;
mp.game.vehicle.defaultEngineBehaviour = flag;
</pre>
</pre>


=== Parameters ===
=== Parameters ===
*'''enabled''': {{RageType|Boolean}}
*'''flag''': {{RageType|Boolean}}


== Examples ==
== Examples ==

Latest revision as of 19:22, 23 May 2021

Client-Side
Function

 JavaScript



Lets you disable the default engine behaviour (when you enter a vehicle, the player automatically turns on the engine). Setting this to false will stop the player from turning the engine on.

Note:
It is best to set the config flag: PED_FLAG_STOP_ENGINE_TURNING - to ensure the player doesn't attempt to turn the engine resulting in a strange animation.

mp.players.local.setConfigFlag(429, true);


JavaScript Syntax

Syntax

mp.game.vehicle.defaultEngineBehaviour = flag;

Parameters

  • flag: Boolean

Examples

Simply disables people from turning on their engine within the server.

mp.game.vehicle.defaultEngineBehaviour = false;


See also