[Release] LockSystem 3.1 (Updated the 07/16/2018) [BETA]

system
unlock
vehicles
lock
roleplay

#1

LockSystem, advanced lock system for vehicles.

Version 3.1 - Updated the 07/16/2018.

Github Repository

Latest version (3.1) here
ESX Version (thank's to @xseba360) : https://github.com/Xseba360/esx_locksystem
Old version (2.1) here (With the comma !)


(Changelog at the end of post)

Thank you, but i won't develop on FiveM anymore for now

After a long waiting time, here is the new (and last) version of the LockSystem script. I won't work on it anymore because i stopped developing on FiveM. The code is Open Source and I invite you to contribute to the project on Github. You will find the contribution guide directly on the Github README page.

What is LockSystem

LockSystem is a script allowing to :

  • Recover the keys of a vehicle with a percentage of success and customizable messages
  • Lock / Unlock the cars that belong to you
  • Give your keys with a chat command (Not tested, i can't do this alone)
  • Recover your keys when disconnecting and reconnecting (reset keys when server restarts)
  • Disable (or not) NPC cars
  • Provide a mini API to help developers work with it

How it works

When you enter a vehicle (any vehicle), you can try to retrieve the keys by pressing the U key (default). A percentage success rate can be configured. If you find the keys, you can lock and open the vehicle and give your keys to someone else..

Installation

  • Download and install the script
  • Move the LockSystem folder in your FiveM resources
  • Add start LockSystem in your server.cfg file

Configuration overview

You can find the configuration in config/shared.lua.
The sounds are in the html/sounds/ folder.

The give keys command

Here is the command for give the keys. I haven't tried i, i hope it works. Otherwise, feel free to solve the problems and contribute to the project on Github.

/givekey <player id> <plate>

Mini API

You will find all the necessary information in the files client_api.lua and server_api.lua.

Changelog

Version 3.1 (07/16/2018)

Trunk problem should be resolved


How to create a Lock Script for ESX
Lock Script
[REQ] Car lock script
[Help] I need Lock system
How do i setup a proximity text chat? and a few other questions
Inventory vehicle key
Script Vehicle Key?
[Release][ESX] ESX_NoCarJack
Working script for trunk with LockSystem 3.0
[Release][ESX] ESX_NoCarJack
Lock script compatible with esx vehicle inventory.?
[ESX] Script to lock npc vehicles
Still can't stream sounds? Or can we?
#2

work fine thx :slight_smile:
its possible to you to add a toggle engin ON/OFF ?

thx for your script its appreciate


#3

Sorry, I am french and I don’t see what you mean by toggle engine. You can quickly describe what you want me to add ?

Thanks you, glad you like it :smile:

Edit : Delete or display the text, is that?


#4

im french to xDDD im pm you x)


#5

Future update :

  • Disable engine when vehicle is locked
  • Add parameters for the text
  • Try to add custom external sound when lock/unlock

Tell me if you have any other suggestions


#6

here a french to ! :smiley: Nice script and thanks u for the non command use. Yes if you can add the toggle engine this will be cool (like your are in our out your vehicle and u can turn off ur engine) Thank for sharing


#7

I know this isnt related but you can also make a script to disable car when it crashes for set amount of secs the one we have is broken.


#8

Maybe a command would be useful! (/lock and /unlock)


#9

I can add a command even if I find that it ruins the RP a little, the option will be disabled for those who don’t want :slight_smile:


#10

Don’t lock a different vehicle or it bugs out and says you don’t have a vehicle anymore and you can’t get back in


#11

Update here !

Thank’s @SPJESTER, I will see what I can do but as long as I don’t use a database then you can only have one vehicle.

EDIT : You can change the vehicle if the last was unlocked.


#12

Why don’t you move

    local player = GetPlayerPed(-1)
    local car = SetPlayersLastVehicle(GetVehiclePedIsIn(player, true)) 


    if car ~= 0 then 
        posCar = GetEntityCoords(car, false)
        carX, carY, carZ = posCar.x, posCar.y, posCar.z 

        posPlayer = GetEntityCoords(player, false) 
        playerX, playerY, playerZ = posPlayer.x, posPlayer.y, posPlayer.z 
    end

Inside

if IsControlJustPressed(1, key) then

so the script won’t constantly update variables?


#13

Because I think it’s better to have predefined values and not wait to press the key, but you can edit the script as you like :slight_smile:


#14

The problem here is that it will eat client resources without any need. It will pull data and update values every frame (60 times a second average), that can lead to memory leak/unnecessary CPU load.


#15

So you just removing that line or what? I’d like just a button not the controller tripping it out lol


#16

@SPJESTER You have to do what he said, like that :

   if IsControlJustPressed(1, key) then

       local player = GetPlayerPed(-1)
       local car = SetPlayersLastVehicle(GetVehiclePedIsIn(player, true)) 


      if car ~= 0 then 
           posCar = GetEntityCoords(car, false)
           carX, carY, carZ = posCar.x, posCar.y, posCar.z 

           posPlayer = GetEntityCoords(player, false) 
           playerX, playerY, playerZ = posPlayer.x, posPlayer.y, posPlayer.z 
       end

#17

Hi, work fine! thx for the release.
I have a suggestion to make you if you want
It would be to replace the chat message by a notification at the top of the radar


#18

What is the call for that instead of chatMessage? i think it used to be like sendNotification


#20

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)


#21

Very nice integration with InteractSound. :slight_smile: