[Release] NextGen Doorlocks!

how do you like pick a door

Does this support multiple jobs? Tried a couple of times but none seems to work.

Just use the export to check if your near a door, and if you are trigger the lockpick event. And your getting that error cause you don’t have our progress bars. You will have to replace the code with your own progbar stuff.

Yes it works for multiple jobs. Just do jobs = {'job1', 'job2', 'job3'}, etc

1 Like

Yep, that’s the way I was doing it and for some reason it only works with ‘job1’ and ignores the rest.

Ah yeah I had a return in the wrong place. Thats my bad. I updated the repo.

1 Like

Great release! Thank you very much!

I have a problem tho. Everything works great. I use devtools to grab the door model, but some doors don’t have model name. Shows only door hashkey.

How can I make it so the script grabs the hashkey without the modelname of the door. Would be nice if there would be an option where you can set the hashkey in the config, if you cannot grab the model name of the door.

1 Like

Ok i think i fixed, the code always check for a string, i just put an OR before every GetHashkey. in client
/cl_doors.lua
line 110

door1 = GetClosestObjectOfType(n, Data.Current.Doors[i].unlockDistance + 0.0, model1 or GetHashKey(model1), false, false, false)

Line 121

door2 = GetClosestObjectOfType(n, Data.Current.Doors[i].unlockDistance + 0.0, model2 or GetHashKey(model2), false, false, false)

Line 137

door1 = GetClosestObjectOfType(v, Data.Current.Doors[i].unlockDistance + 0.0,Data.Current.Doors[i].doorModel or GetHashKey(Data.Current.Doors[i].doorModel), false, false, false)

Line148

door2 = GetClosestObjectOfType(v, Data.Current.Doors[i].unlockDistance + 0.0,Data.Current.Doors[i].doorModel or GetHashKey(Data.Current.Doors[i].doorModel), false, false, false)

line 162

doorSingle = GetClosestObjectOfType(Data.Current.Doors[i].doorPos, Data.Current.Doors[i].unlockDistance + 0.0,Data.Current.Doors[i].doorModel or GetHashKey(Data.Current.Doors[i].doorModel), false, false, false)

i dont know if this is the correct way to do it.
all the credits to itsxScrubz

Ok this looks, excuse my language. Fucking Sick!

Going to throw it in to my test server, got a few ideas already!

Hey I love your work man, I installed the ESX-Version and everything is working great just can’t figure out how to lockpick doors, neither do I find a function for checking the ‘lockpick’-Item or anything like that, do I need to add a special event in my lockpick-Itemusage or how does it work exactly?

Not sure if @itsxScrubz would want to implement this into the source code himself, but what you can do is go to the door config and change all the named doors from 'v_name_of_door' to `v_name_of_door` with backticks and then you can also add your new hashes in number format. Following on from this, you would need to go into the client script and change all mentions of GetHashKey(hash) to just hash

This should achieve what you’re looking to do.

@ElSol Inside where you register the lockpick as a usable item, just use the export given to check if your near a lockpickable door, and if so, remove the item (or whatever you wanna do there) and trigger the event that handles lockpicking doors.

This would prob be the way to go. I didn’t consider doors that don’t have model names tbh. @shredxt if you wanna submit a pull request with the changes. If not, I’ll prob add it when I come back around to the doors later on.

Just wanna say thank you for this! Tested it and fully swapped all the old doorlocks on our main server for this. Something i’ve wanted for a while! Appreciate your work <3

1 Like

Looks fantastic :crazy_face: Hope someone can convert it to use discord roles as permissions as I currently do :smiley:

Thanks, for sure going to use in my server. Looks great!

I fixed a bug where I wasn’t checking if the door was a gate before forcing the heading and pushed the fix to the repo. <3

Hey thanks for you’re help with the lockpicks, I got it working just fine. I have another question, so I want to trigger to open a door in a different script(powerplanthit with prisonbreak) and I don’t seem to get the ServerEvent working correctly, so what I’ve tried is; “TriggerServerEvent(‘ng_doorlock_sv:setState’, BBG, vector(1845.15, 2608.86, 45.59), false)” So BBG is the location in my doorlist and the coordinates are from the door which I want to unlock… Do you know what I’m doing wrong?

@ElSol
The area needs to be a string. On top of that vector(1845.15, 2608.86, 45.59) isn’t a thing. vector3() is.

Like your not including all the info that needs to be sent.

area, pos, status, doubleDoor