qbcore-framework / qb-doorlock Goto Github PK
View Code? Open in Web Editor NEWDoorlock Script For QB-Core
License: GNU General Public License v3.0
Doorlock Script For QB-Core
License: GNU General Public License v3.0
The garage door that slide overhead......what is the yaw for this as for me it just turns the door.....disregard ;)
You should make doors have heading in config so when you close door it makes it be in that heading automatically.
As an example, I go to the prison gate, its locked by default... I can still get in and it opens... then I toggle unlock then lock again, then it works... Video below.
Is your feature request related to a problem? Please describe.
How can it be possible where 2 jobs being able to open lock/unlock a door using "/newdoor"?
Describe the feature you'd like
Where 2 jobs can unlock/lock a door when configured via "/newdoor"
Describe alternatives you've considered
none really.
Additional context
none
Great script! However my doors are unlocked when the server restarts, even turning autolock on, it will not auto lock until I have locked / unlocked it once.
EDIT
So it works fine, but the issue is that when you tick the locked tickbox when doing /newdoor, it wont add "locked = true" so it needs to be added manually, so other than that everything is mint!!!
When you stand in the middle of the door and toggle the lock, the sound reaches a value that is above 1. Cause when dividing by a number lesser then 1, you get a value greater then the one you were dividing.
So for my self I found a fix, but I'm not too confident in my JS skills so let me post it in here instead of making a pull request.
qb-doorlock/html/app.js:71
playAudio(data) {
var volume = (data.audio['volume'] / 10) * data.sfx
if (volume > 1.0) { var volume = 1.0; }
if (data.distance !== 0 && data.distance >= 1.0) { var volume = volume /= data.distance; }
const sound = new Audio('sounds/' + data.audio['file']);
sound.volume = volume;
sound.play();
}
accidently messed up settings on door locks that are placed in game and cant remove them
did the command change, or was it with all the changes to the core, as /newdoor isn't working.
hello
Hello, as we know that doors are exploding
For example, you can add the following
To shoot the door or put explosives to open the door
It would be a great idea I was trying it but unfortunately I didn't finish the code
if IsPlayerFreeAiming(PlayerId()) then
if (i = #QB.Doors and IsPedShooting(PlayerPedId())) then
local _, door = GetEntityPlayerIsFreeAimingAt(PlayerId())
if GetEntityModel(door) == v.objHash then
if Config.Chance == 25 then
chance = math.random(1,4)
elseif Config.Chance == 50 then
chance = math.random(1,2)
elseif Config.Chance == 75 then
chance = math.random(1,3)
elseif Config.Chance == 100 then
chance = 1
end
print(chance)
if chance == 1 then
v.locked = not v.locked
TriggerServerEvent('qb-doorlock:server:updateState', k, #QB.Doors) --
TriggerEvent('qb-doorlock:doorBroken')
end
end
end
end
Hi there, Gates and garage doors still will not freeze when locked, they only freeze once locked is toggled but will reset itself if you log out and log back in
is there a fix for this yet?
I don't know why in some scripts
I can't open a suggestion
I'm sorry, the problem is not mine
But I have a proposal to convert config
To a more understanding and knowledge of door numbers
example:
```QB.Doors = {
[1] = {
{
textCoords = vector3(434.81, -981.93, 30.89),
authorizedJobs = { 'police' },
gardeJobs = {5},
locking = false,
locked = false,
pickable = false,
distance = 2.5,
doors [1] = {
{
objName = 'v_ilev_ph_door01',
objYaw = -90.0,
objCoords = vector3(434.7, -980.6, 30.8)
},
doors [2] = {
{
objName = 'v_ilev_ph_door002',
objYaw = -90.0,
objCoords = vector3(434.7, -983.2, 30.8)
}
}
},
},
[2] = {
{
objName = 'v_ilev_gtdoor02',
objYaw = 90.0,
objCoords = vector3(464.3, -984.6, 43.8),
textCoords = vector3(464.38, -983.64, 43.8),
authorizedJobs = { 'police' },
gardeJobs = {5},
locking = false,
locked = true,
pickable = false,
distance = 1.5,
},
},```
I dont understand how to lock doors myself and why the cardealer ones aren't working..
Create a way to open door locks with a certain item (like a "key" item from shared.lua). It will be much easier If you've locations as Hotels, Motels or Houses.
Describe the bug
The script by default is not recognizing the lang files.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
/newdoor does not work and there are errors in the f8 console
Screenshots
https://i.imgur.com/JqByioF.png
Questions (please complete the following information):
qb-
to something custom? I renamed the file from qb-doorlock-main to qb-doorlockAdditional context
N/A
Is there a command to remove a door?
Go to a prison gate with a car really fast it will open the door halfway or any other gates
With NUI doorlocks, i'd usually need to type /newdoor, enter all the inputs needed and create the door, and be able to open the newdoor menu with all the previous inputs saved, with qb-doorlocks, I must re-enter all the details again each time I go to /newdoor, if its supposed to be like this then I apologies or if its an issue I thought i'd note it down here just incase, thanks!
this is the error Error loading script server/main.lua in resource qb-doorlock: @qb-doorlock/server/main.lua:272: attempt to index a nil value (global 'Lang')
[ script:qb-doorlock] stack traceback:
[ script:qb-doorlock] @qb-doorlock/server/main.lua:272: in main chunk
how can i solve this please
Latest version when you use the in-game UI to make a door and tick the "Locked" box it doesn't print it on the config file. You have to manually add it on each door.
anyway somone could like code it to an older version of qbcore?
After I successfully lockpick a door I receive the following error in the client console (F8):
SCRIPT ERROR: @qb-doorlock/client/main.lua:234: attempt to index a nil value (field 'objCoords')
The Version 2 update has broken the function for unlocking the prison gates, and any bank-robbery doors that use items to unlock the gate/door.
Just downloaded and installed this to the server, by default the jail gates are locked, was able to roll up to them and they opened even though it stated they were locked.
this has been fine for weeks, now i get this message when i make a door, ?
[ script:qb-doorlock] SCRIPT ERROR: @qb-doorlock/server/main.lua:227: /home/server/resources/[custom]/qb-doorlock/configs/testing.lua: Permission denied
edit, i think it was something to do with the permissions of the files, myside.
Hello guys im reporting a issue with qb-door lock. Everything is working fine tell I try to add lock door at the casino. I tried different doors with the same out come. When using /newdoor and add a door at the casino it does not save/accept the door. I provided a video of the issue. I have no errors client/server side.
Video of what im talking about: https://streamable.com/0j5qav
Describe the bug
A clear and concise description of what the bug is. A stranger to qbcore should be able to read your bug report and understand how to reproduce it themselves and understand how the feature should work normally.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Be able to lock pick the door successfully.
Questions (please complete the following information):
qb-
to something custom? [e.g. yes/no] - NoI'm using this trigger on my client.lua but it doesn't update the door.
TriggerServerEvent('qb-doorlock:server:updateState', Config.Bobcat[doors].thermite[index].doorId, false, false, false, false)
yes the doorid is returned correctly, i checked with print()..
but even if i remove the
Config.Bobcat[doors].thermite[index].doorId
and write the door number, it still doesn't update it and it stay locked.
Here is the door code in qb-doorlock
Config.DoorList['bobcat-door1'] = { authorizedJobs = { ['police'] = 0 }, doorRate = 1.0, distance = 2.0, doors = { {objName = -1259801187, objYaw = 355.0022277832, objCoords = vec3(883.480347, -2258.529785, 32.534859)}, {objName = -1563799200, objYaw = 175.0022277832, objCoords = vec3(880.895142, -2258.308350, 32.534859)} }, doorLabel = 'Door1', locked = true, pickable = false, doorType = 'double', }
BUT, if i set myself to police job and thermite the door, i get the updatestate correctly
please test this not working
{
objName = -1212951353,
objCoords = vector3(-1491.1, -383.19, 40.16),
textCoords = vector3(-1491.1, -383.19, 40.16),
authorizedJobs = { 'police' },
locking = false,
locked = true,
pickable = false,
distance = 15.0,
size = 2
},
and test this same door
{
objName = 'v_ilev_ml_door1',
objCoords = vector3(-1491.12, -383.13, 40.16),
textCoords = vector3(-1491.12, -383.13, 40.16),
authorizedJobs = { 'police' },
locking = false,
locked = true,
pickable = false,
distance = 15.0,
size = 2
},
So there is an error where the locked door isn't locked but after like few seconds it gives you the option "Locked"
There aren't any errors
When adding doors to the config, some doors that are changed by script might be messed up when the order of the list changes.
A possible solution that is backwards compatible is by adding a name field to the door objects in the config.
Example:
{
name = "pol_1", -- Field to use as an identifier instead of it's index in the table
textCoords = vector3(434.81, -981.93, 30.89),
authorizedJobs = { 'police' },
locking = false,
locked = false,
pickable = false,
distance = 2.5,
doors = {
{
objName = 'gabz_mrpd_reception_entrancedoor',
objYaw = -90.0,
objCoords = vector3(434.7444, -980.7556, 30.8153),
},
{
objName = 'gabz_mrpd_reception_entrancedoor',
objYaw = 90.0,
objCoords = vector3(434.7444, -983.0781, 30.8153),
}
}
},
The name can be used for the doorID paramater in the qb-doorlock:server:updateState
event by changing the event handler to something like this:
RegisterNetEvent('qb-doorlock:server:updateState', function(doorID, state)
if type(doorID) == type("string") then
doorID = getDoorByName(doorID)
end
QB.Doors[doorID].locked = state
TriggerClientEvent('qb-doorlock:client:setState', -1, doorID, state)
end)
function getDoorByName(name)
index = 1
for _, door in pairs(QB.Doors) do
if door.name == name then
return index
end
index = index + 1
end
end
When you create a new door, you can add the job authorization to the door but can not add a job grade unless done later in the config. I feel like it would be a great addition to just add the option to add grades straight to the /newdoor menu.
First, thank you so much for such beatifull server and work, really glad that you finally make it public.
I'm trying to unlock a door using the items required (screwdriverset, lockpick) but the door wont open for some reason.
there are no errors of any sort, just wont work.
again, thank you for such great work
Reloading the qb-doorlocks script does not take in effect the job you currently have, you need to re-log in order for it to detect what job you have. If it could check your job on script reload, it would be easier to code the locks instead of logging off and on every time.
Also What MLO's have you based your door locks on? It seems to me like the MLO's I have installed are quite different from the location of the door locks.
So basically, not all doors behave like this in the video. Some doors work but for some reason, gates do not.
Also, there are instances where ped can go in then "lock" appears after a few seconds. Making the ped locked on the other side of the door.
It's not the door ID that is in issue as video shows that door ID is correct, its just that it doesn't show up or lock the gates/doors right away.
Door locks are not staying on doors. Suddenly a lock will disappear for everyone and the door wont be lockable comes back after script reboot 60+ people in server
When creating a new door then opening the new config file and changing the doors from:
fixText = false,
To:
fixText = true,
Nothing changes. It should move the textcoords but it does not, they stay where they are.
The multicharacter works fine for qb-doorlock defult but some player are able to hop in realquick but there are many player who can't !
When creating a door, and you select any of the checkmarks on the bottom. Nothing is getting saved correctly. If you set one to be locked, it's not locked after you've created the door.
hello can give suggest
doorlock not support lock object mrpd
mrpd_bollards_01
mrpd_bollards_02
and Is it possible to add a method to the smart door?
For example, job recognition and automatic door opening
Or the doors that work while you are inside the car only?
external doors open auto
and
The timer counter must be in config
for each door autolock after example 5 min
Make general door interaction use raycasting to get what model your looking at, and only lock/unlock that one
When i try to make new door from game i select locked Option but it doesn't Get locked also when i checked Config.lua it says locked false.
An option to make a door stay open in the unlocked state would be great.
I don't know if this would benefit all door types but for example garages would benefit from this option.
This way they could be used like real world garages that don't just close up on you when you leave the area.
guys i just updated qb-doorlock but its look like the script is too low , i mean when i go faster to a locked door , the door is open after a sec its locked and print Locked
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.