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-JobMenu
  2. Unlocked File
  3. Client

ESX

CreateThread(function()
    if Config.framework ~= 'ESX' then return end
    ESX = exports['es_extended']:getSharedObject()

    local PlayerData = ESX.GetPlayerData()

-- ReUpdatePlayerData

    function UpdatePlayerData()
        PlayerData = ESX.GetPlayerData()
    end
	
-- 	GetPlayerJobName

    function GetPlayerJobName()
        UpdatePlayerData()
        if PlayerData and PlayerData.job and PlayerData.job.name then
            return PlayerData.job.name
        end
        return nil
    end

-- 	GetPlayerJobGrade

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

-- GetPlayerData

    function GetPlayerData(callback)
        UpdatePlayerData()
        if callback ~= nil then
            callback(PlayerData)
        end
    end

    local callback = nil

-- GetPlayer character.lastname, character.firstname

    function GetPlayerCharInfo(cb)
        callback = cb
        UpdatePlayerData()
        local identifier = PlayerData.identifier

        TriggerServerEvent('peace-speedcamera:GetPlayerCharInfo', identifier)
    end

end)

PreviousQBCoreNextCustom

Last updated 1 year ago

📄
📂
💻