Giter Site home page Giter Site logo

qb-doorlock's People

Contributors

abdel1touimi avatar belorico avatar berkiebb avatar danielcoelh0 avatar darknight2590 avatar dmackgl avatar dose-420 avatar evanillaa avatar ghzgarage avatar gutsoo avatar hellraisertwo avatar idrisdose avatar imxirvin avatar itsanobrainer avatar johnclark96 avatar klay4 avatar los823ki avatar monkeywhisper avatar newtonzz avatar pushkart2 avatar qwerty1verified avatar sempercertusetfidelis avatar shadowz-git avatar singh-manavv avatar slugteamsix avatar suelthedev avatar theilleniumstudios avatar tonybynmp4 avatar vanadis1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qb-doorlock's Issues

[SUGESSTION] Add name field to door object.

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

/newdoor inputs not saving, have to re-enter all details

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!

Server starts with doors unlocked

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!!!

Suggestion: Reloading QB-Doorlocks

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.

Need Update

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 !

just a question

anyway somone could like code it to an older version of qbcore?

Error after succesfully lockpicking door

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')

IndexSizeError for volume

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.

image

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();
}

[BUG] Sliding Gates Do Not Lock

There is an issue where the text will say that the sliding gates such as at the sally port at the prison, and the back gate at MRPD are locked, but they still open. This seems to happen with locked garage doors as well.
FiveM - WWCRP qbCore RP Server 9_27_2021 1_26_14 AM

Locked variable not setting

When using /newdoor and checking locked, it does not produce the locked variable in the configuration files.
image
image

[BUG] Door lock dissapearing

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

Doors not locked

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

door id

  1. optimize name door objName = 'v_ilev_ph_door01', can using hash door
  2. convert door array to number array example Under
  3. add grade job config
  4. auto lock for door after example 1 minutes autolock = 1,

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,
	},
	},```

Option to make door stay open

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.

Out of the box doesn't work.

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.

[Suggestion/Improvement]

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.

Permission denied

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.

tooo slow

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

[BUG] Casino Doors

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

Doors wont get unlocked

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

doorlock suggest

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

[BUG] Fix test feature doesnt work properly

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.

updatestate

I'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

Broken Doorlocks

Go to a prison gate with a car really fast it will open the door halfway or any other gates

Door lockable not saving

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.

[SUGGESTION/QUESTION]

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

Gates still not working after temp fix

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?

[BUG]

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:

  1. Go to a set of double doors
  2. Lockpick double doors
  3. Succeed at the lockpick mini game
  4. Get an error for "nil value (field 'objCoords')"

Expected behavior
Be able to lock pick the door successfully.

Screenshots
image

Questions (please complete the following information):

  • When you last updated: [e.g. last week] - Today
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target] - No
  • Have you renamed qb- to something custom? [e.g. yes/no] - No

DoorLocked Isnt Working[BUG]

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.

Door Lock doesn't work after update

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.

Video: https://www.youtube.com/watch?v=z5DWJRmuuLs

aim doorlock or c4

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

NUI - Locked Box not working

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.

doorlock not support hash door

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
	},

[BUG] Doorlock not working - Lang Errors

Describe the bug
The script by default is not recognizing the lang files.

To Reproduce
Steps to reproduce the behavior:

  1. Install the script

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):

  • When you last updated: Now
  • Are you using custom resource? which ones? zdiscord, qb-target, and many many more
  • Have you renamed qb- to something custom? I renamed the file from qb-doorlock-main to qb-doorlock

Additional context
N/A

script error couldnt solve

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

tried the latest version

image
i got this trying to use latest version

how can i fix this issue
and great respect to you guys for coding this amazing script ๐Ÿฅ‡

[SUGGESTION] Adding job grade to the /newdoor menu

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.

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.