mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 16:23:21 +00:00
⚠️ 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:
+4
-20
@@ -4,26 +4,10 @@ QBCore.Config = QBConfig
|
||||
QBCore.Shared = QBShared
|
||||
QBCore.ServerCallbacks = {}
|
||||
|
||||
isLoggedIn = false
|
||||
|
||||
function GetCoreObject()
|
||||
exports('GetCoreObject', function()
|
||||
return QBCore
|
||||
end
|
||||
|
||||
RegisterNetEvent('QBCore:GetObject')
|
||||
AddEventHandler('QBCore:GetObject', function(cb)
|
||||
cb(GetCoreObject())
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
|
||||
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
|
||||
ShutdownLoadingScreenNui()
|
||||
isLoggedIn = true
|
||||
SetCanAttackFriendly(PlayerPedId(), true, false)
|
||||
NetworkSetFriendlyFireOption(true)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('QBCore:Client:OnPlayerUnload')
|
||||
AddEventHandler('QBCore:Client:OnPlayerUnload', function()
|
||||
isLoggedIn = false
|
||||
end)
|
||||
-- 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()
|
||||
Reference in New Issue
Block a user