Vehicle::repair: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 2: Line 2:
== Syntax ==
== Syntax ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
Vehicle vehicle.repair()
vehicle.repair()
</syntaxhighlight>
</syntaxhighlight>
== Example ==
== Example ==

Revision as of 13:44, 5 January 2017

This function repairs a vehicle.

Syntax

vehicle.repair()

Example

This example repairs a vehicle, in which the player sits.

mp.events.add('playerCommand', (player, cmd) => {
	let arr = cmd.split(' ');
	if (arr[0] == 'repair' && player.vehicle) {
		player.vehicle.repair();
	}
});