Vehicle::locked

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Server-Side
Property

Js.png JavaScript



A vehicle property used for locking or unlocking a vehicle.

JavaScript Syntax
Jslogo.png

Syntax

vehicle.locked;

Getter

  • Boolean

Setter

  • Boolean

Example

This example will lock your vehicle.

Server-Side
mp.events.addCommand('lock', (player) => {
		let vehicle = player.vehicle;
		if (vehicle) {
			let newState = !vehicle.locked;
			vehicle.locked = newState;
			player.outputChatBox(`Your vehicle doors are now ${newState ? `locked` : `unlocked`}.`);
		};
	}
);


See Also