Code Monkey home page Code Monkey logo

sy_carkeys's Introduction

Discord https://discord.gg/Vk7eY8xYV2

SY_CARKEYS

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)

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.

Events y exports

  • To obtain a key for a nearby vehicle with a ProgressBar:
exports['sy_carkeys']:CarKey(time) -- Waiting time of the ProgressBar
-- exports['sy_carkeys']:CarKey(1000)           1000 = 1s
  • To generate a key with a wait time for the player to enter the vehicle and obtain its license plate:
exports['sy_carkeys']:CarKeyBuy(time) --The time can be adjusted as needed and allows waiting for the player who is inside the vehicle.

-- exports['sy_carkeys']:CarKeyBuy(1000)           1000 = 1s
  • Create Key event:
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsUsing(ped)
local model = GetEntityModel(vehicle)
local name = GetDisplayNameFromVehicleModel(model)
TriggerServerEvent('sy_carkeys:CreateKey', plate, name)  
  • To delete the key of a player in their current vehicle (useful for when a player returns a work vehicle):
TriggerEvent('sy_carkeys:DeleteClientKey', count)
  • To delete specific keys:
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsUsing(ped)
local model = GetEntityModel(vehicle)
local name = GetDisplayNameFromVehicleModel(model)
TriggerServerEvent('sy_carkeys:DeleteKey', count, plate, name)  
  • LockPick:
exports['sy_carkeys']:LockPick()
  • HotWire:
exports['sy_carkeys']:HotWire()
  • Change Plate:
exports['sy_carkeys']:SetMatricula()

Ox inventory Item's

['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,
	client = {
		export = 'sy_carkeys.SetMatricula'
	}
},

Preview

Dependencies

sy_carkeys's People

Contributors

mono-94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.