-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: feat: ! Refactoring and describing the lockpickDoor function moved to client/functions.lua #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skimmed through things. Seems like an improvement.
Looks like there are some conflicts. Should have probably merged yours first. Sorry :( |
I will resolve conflicts soon |
function public.isCloseToCoords(coord1, coord2, distance) | ||
return #(coord1 - coord2) < distance | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an unnecessary abstraction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was already in the code. It improves readability a little bit, which is why I started using it.
|
||
--[[ Manifest ]]-- | ||
dependencies { | ||
'ox_lib', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make it so if you restart ox_lib, then this resource will be stopped. Is that the desired behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few lib.callbacks in the script, so without ox_lib it may throw errors
Description
The lockpickDoor, attemptPoliceAlert, isBlacklistedWeapon, isBlacklistedVehicle functions and their helper functions have been moved to clients/functions.lua
These can be used in main.lua using import, inspired by ox_target
Some conditions have been added to enable the usage of the lock pick.
When opened, the distance between the vehicle and the player's ped gets checked.
Previously, opening the lock on trucks was done in the middle of the vehicle. Now you just have to approach the driver's door.
Used statebag to hold information about the lock.
Checklist
BREAKING CHANGE:
In the statebag of the vehicle there is a saved information on whether it has been opened with a lock pick.