Vehicle::locked

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

This property used for lock/unlock vehicle. Players can't seat to locked vehicles, bikes too.

Boolean vehicle.lock;

Example

That's example will lock your vehicle, when you use command.

mp.events.addCommand(`doors`, 
	(player) => {
		let vehicle = player.vehicle;
		if (vehicle) {
			let newState = !vehicle.locked;
			vehicle.locked = newState;
			player.outputChatBox(`Your vehicle doors now <b>${newState ? `closed` : `opened`}</b>`);
		};
	}
);

See Also

Template:Vehicle block