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

ESX

CreateThread(function()
    LoadFrameworkConfig(function(loadedFramework)
        if loadedFramework ~= 'ESX' then return end

        ESX = nil
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

	    AddEventHandler('esx:playerLoaded', function()
            FetchPropsOnStart()
        end)
		 
	    -- ReUpdatePlayerData
	
	    function UpdatePlayerData()
            ESX.PlayerData = ESX.GetPlayerData()
	    end
		 
	    -- GET JOB NAME
	
	    function GetPlayerJobName()
            UpdatePlayerData()
            if ESX.PlayerData and ESX.PlayerData.job and ESX.PlayerData.job.name then
                return ESX.PlayerData.job.name
            end
            return nil
	    end

	    -- GET JOB GRADE

	    function GetPlayerJobGrade()
            UpdatePlayerData()
            if ESX.PlayerData and ESX.PlayerData.job and ESX.PlayerData.job.grade then
                return ESX.PlayerData.job.grade
            end
            return nil
	    end
		
		-- Notication
		
	    function Notify(message, messageType, duration)
            ESX.ShowNotification(message, duration, messageType)
	    end

	
    end)
end)
PreviousQBCoreNextCustom

Last updated 9 months ago

🖋️
📂
💻