PEACESCRIPT Documentation
StoreDiscord
  • 👋Introduction
  • 📸PEACE-Speedcamera
    • 📜Config File
    • 📂Unlocked File
      • 🖥️Server
        • QBCore
        • ESX
        • QBOX
        • Custom
      • 💻Client
        • QBCore
        • ESX
        • QBOX
        • Custom
  • 📄PEACE-JobMenu
    • 📜Config File
    • 📂Unlocked File
      • 💻Client
        • QBCore
        • ESX
        • Custom
  • 📊PEACE-DutyLog
    • 📜Config File
    • 📂Unlocked File
      • 💻Client
        • QBCore
        • ESX
        • QBOX
        • Custom
        • Target
      • 🖥️Server
        • QBCore
        • ESX
        • QBOX
        • Custom
  • 🖋️PEACE-PropsManager
    • ⬇️Installation
    • 📜Configuration
    • ❓FAQ
    • 📂Unlocked File
      • 🖥️Server
        • QBCore
        • ESX
        • Custom
      • 💻Client
        • QBCore
        • ESX
        • Custom
Powered by GitBook
On this page
  1. PEACE-PropsManager
  2. Unlocked File
  3. Client

QBCore

CreateThread(function()
    LoadFrameworkConfig(function(loadedFramework)
        if loadedFramework ~= 'QBCore' then return end
		
        local QBCore = exports['qb-core']:GetCoreObject()
			
        AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
            FetchPropsOnStart()
        end)
		 
	     -- ReUpdatePlayerData
	
        function UpdatePlayerData()
            PlayerData = QBCore.Functions.GetPlayerData()
        end
		 
	     -- GET JOB NAME
	
        function GetPlayerJobName()
            UpdatePlayerData()
            if PlayerData and PlayerData.job and PlayerData.job.name then
                return PlayerData.job.name
            end
            return nil
        end

	     -- GET JOB GRADE

        function GetPlayerJobGrade()
            UpdatePlayerData()
            if PlayerData and PlayerData.job and PlayerData.job.grade.level then
                return PlayerData.job.grade.level
            end
            return nil
        end
		
		-- Notication

        function Notify(message, messageType, duration)
            QBCore.Functions.Notify(message, messageType, duration or 5000)
        end

    end)
end)
PreviousClientNextESX

Last updated 9 months ago

🖋️
📂
💻