@VultureScripts Okay, perhaps I didnât read the initial information correctly but to me it read that all the doors were synced in the database.
Why do we have to have this then ?
- I would expect that I add a door in a database table with itâs propname, x , y and z location and that the script reads that and checks if itâs locked / unlocked. With this solution I still have to manually add doors to a script where you want to be able to restart the script and it picks up the changes from the DB.
It uses the [1] etc to get the doors information 
I can make a pull request but I have distance checks working and gates working on my server. Im assuming its still gonna be syncing as I just added the IDs similar to the format you have in the db and in the script. The distance checks can also be used for the other doors as well if people want to make the unlocks and locks further from the door.
Granted I am all alone on the server but from my testing all the gates seem to be working. Testing will definitely be needed on a bit more populated server. I am also using custom ymaps for gates at lspd and bcso offices.
Ofcourse! Go ahead ill look over it
And aslong as all seems okay il update it 
Thank you.
Will do! The code isnât all my idea. Took the idea from esx_doorlock. Just tweaked a little to match the code in your script. So it could most likely be improved. Just learning lua as I go. 
Sounds good to me

That I saw, but when I read synced doors via database I expected the door to be in a table in the database and not in the script so a quick restart of the script would instantly load the new doors from the database.
But that might have been an idea youâre gonna be working on now, correct ?
UPDATE 30/09/2019
Thanks to @Crutchie you now have the ability to add distance checks to the doors.
This makes life easier if wanting to add gates.
Thanks for the PR :)
Hey is it possible to add steam ids to this lock script please
Hello, I would like to know how I could add permits to other doors? for example I want to close the mechanicâs workshop, but how would I make the mechanic no longer open it?
Iâve never done garages before but theoretically you just need to get the coords of the door and the prop name and use those in the client script.
As far as mechanic not being able to open it as long as they donât have access to open doors then they shouldnât be able to open it.
I know that friend! you do not understand me, what I want to do is to be able to create a permit for the mechanic apart from the policy that comes by default, the mechanicâs door and the concurrent one and close it but what is necessary to give the mechanic permission to open it
what must i edit when i want ambulance can open the Doors or other Factions , or with an item?
@VultureScripts what would i need to remove to make this non esx, as i already have a doors script but it lags, and it seems you have fixed that. My server is just not esx so i would like to remove that part.
Do you use essentialmode?
1sdww
sql doesnt work
these 2 sql donât work
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) /;
/!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
