Vehicle::setMod: Difference between revisions

From RAGE Multiplayer Wiki
m (Added vehicle mods list)
m (Fixed a grammatical error.)
Line 17: Line 17:
*'''modIndex''': {{RageType|Int}}
*'''modIndex''': {{RageType|Int}}


== Examples ==
== Example ==
{{ServersideCode|
{{ServersideCode|
<pre>
<pre>

Revision as of 20:14, 11 September 2020

Shared
Function

 JavaScript


Applies the specified mod onto the vehicle.


List of Vehicle Mods

JavaScript Syntax

Syntax

vehicle.setMod(modType, modIndex);

Parameters

  • modType: Int
  • modIndex: Int

Example

Server-Side
mp.events.addCommand('mod', (player, _, modType , modIndex) => {
	if(!player.vehicle) return player.outputChatBox("You need to be in a vehicle to use this command.");
	player.vehicle.setMod(parseInt(modType), parseInt(modIndex));
	player.outputChatBox(`Mod Type ${modType} with Mod Index ${modIndex} applied.`);
});


See Also