⚠️ Major Update ⚠️

- Major cleanup of all files including reformatting & notations
- Added an optional export to add to scripts as an alternative to import.lua
- Added player state to OnPlayerLoaded so no more need for isLoggedIn inside scripts
- Updated all events to the new RegisterNetEvent and got rid of unneeded handlers
- Added the ability for ACE permissions with commands
- Added two new config options for player update interval and status update
- Changed players table to use citizenid column as primary key <-- very important
- Overall sloppy code cleanup, removal of unused code, got rid of nil checks
This commit is contained in:
Kakarot
2021-09-24 22:46:20 -06:00
parent e683b991c6
commit 923f3d3a31
16 changed files with 5283 additions and 5580 deletions
+19 -5
View File
@@ -4,11 +4,25 @@ QBCore.Shared = QBShared
QBCore.ServerCallbacks = {}
QBCore.UseableItems = {}
function GetCoreObject()
exports('GetCoreObject', function()
return QBCore
end
end)
RegisterServerEvent('QBCore:GetObject')
AddEventHandler('QBCore:GetObject', function(cb)
cb(GetCoreObject())
-- To use this export in a script instead of manifest method
-- Just put this line of code below at the very top of the script
-- local QBCore = exports['qb-core']:GetCoreObject()
-- Get permissions on server start
CreateThread(function()
local result = exports.oxmysql:fetchSync('SELECT * FROM permissions', {})
if result[1] then
for k, v in pairs(result) do
QBCore.Config.Server.PermissionList[v.license] = {
license = v.license,
permission = v.permission,
optin = true,
}
end
end
end)