mono_carkeys is deprecated, you can use mVehicle instead
Hello community!
This is the first script I’m sharing on the forum. I’m not an expert in programming, I do it as a hobby. If you find any errors or see something strange in the code, let me know.
The script is basically a key system for vehicles that works with the key as an item using metadata.
Features
-
Turn on and off the vehicle engine using the corresponding assigned key to the vehicle (optional, Keys.Engine).
-
You can hold down the F key when exiting the vehicle to keep the engine running, if you have the vehicle keys. (Optional, Keys.OnExitCar)
-
Retrieve lost keys through an NPC that can be easily added in the Config.lua file.(In the config.lua file, you can edit the NPC to acquire the license plate. Keep in mind that if you set BuyNewPlate to true, the NPC will only sell license plates and not keys)
-
Administrators can create keys for the vehicle they are in, as well as for other players using their ID.
-
NPC-owned vehicles will be parked with their doors closed, and will be turned off if opened (This option is disabled by default since it is not 100% finished. It will block all kinds of vehicles, including those with NPCs inside. In the future, only vehicles without NPCs will be affected. Keys.CloseDoorsNPC).
-
Lockpicking system with skill check, allowing players to force entry into vehicles (includes a function in the Config.lua file to optionally add a dispatch system).
-
Includes a tool called “Wire Cutters” with skill check, allowing players to hotwire previously forced vehicles (optional).
-
The license plate item allows the player to customize both the color and the license plate of their vehicle. (This will change the license plate in the database)
-
Keybind to open/close the vehicle. (Default key is U, can be changed in the Config.lua file.)
-
Keybind to turn on/off the engine. (Default key is M, can be changed in the Config.lua file. Optional)
-
(New 17/5/2023) Now there is an attempt per vehicle to search for the key when you get into the vehicle. Button/command/export. (Configurable in Keys.FindKeys)
Commands Admins
- /givekey [ID] - With this command, you can obtain a key for the vehicle you are currently in, or you can use the ID of a player who is in a vehicle to give them a key to that vehicle.
- /delkey [ID] - With this command, you can delete the key for the vehicle you are currently in.
Ox Inventory Item
['carkeys'] = {
label = 'Car Key',
weight = 5,
stack = true
},
['ganzua'] = {
label = 'Lockpick',
weight = 25,
stack = true,
client = {
export = 'sy_carkeys.LockPick'
}
},
['alicates'] = {
label = 'Wire Cutters',
weight = 50,
stack = true,
client = {
export = 'sy_carkeys.HotWire'
}
},
['plate'] = {
label = 'Plate',
weight = 500,
stack = true,
},
carkey.png
alicates.png
ganzua.png
Documents
https://mono-2.gitbook.io/docs/mono-scrips/mono_carkeys
Preview
-
keys and menu recovery
https://streamable.com/ggh4b3 -
LockPick & HotWire
https://streamable.com/nps2uq -
Change Plate – [27/3/2023]
https://streamable.com/goz7ya
Download
Dependencies
- ox_lib - Releases · overextended/ox_lib · GitHub
- ox_inventory - Releases · overextended/ox_inventory · GitHub
- ox_target - Releases · overextended/ox_target · GitHub