qb-core
qb-core copied to clipboard
feat: some useful functions + command permission change
Command Permissions Simplify command permissions to be one parameter, as opposed to an infinite amount. I believe this is a lot cleaner and simpler way of doing permissions.
I've also searched the entire framework for QBCore.Commands.Add
function and no script is utilizing more than one parameter in this function. So it won't have any conflicts with the base framework or issues.
Useful Functions Adds the ability to manipulate tables (copy, copy strict, combine, and search) and grouping of digits together.
QBShared.GroupDigits(1000000, true)
-> $1,000,000
QBShared.GroupDigits(1000000, false)
-> 1,000,000
Questions (please complete the following information):
- Have you personally loaded this code into an updated qbcore project and checked all it's functionality? yes
- Does your code fit the style guidelines? yes
- Does your PR fit the contribution guidelines? yes
If you're using lua 5.4 you could also just do table.copy(), I don't see much use for a function like this to be added to the core.
So lua 5.4 is enabled in the fxmanifest.lua
for qb-core but when using table.copy(tbl)
it doesn't seem to work and throws a CLI error of
SCRIPT ERROR: @qb-core/server/commands.lua:65: attempt to call a nil value (field 'copy')
Am I missing something here or is copy not a function of the table
object with Lua 5.4?
refactored the permission change to ensure backward compatibility for extra perms, if supplied as per @tom-osborne request.
update the branch and see if it conflicts with the base branch.