Vehicle::setMod

From RAGE Multiplayer Wiki
Revision as of 20:25, 11 September 2020 by SugarD-x (talk | contribs) (Moved vehicle mod list to more appropriate location, and cleaned up some minor code and readability issues.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Shared
Function

 JavaScript


Applies the specified mod onto the vehicle.

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