๐ฎ This script shows how to use all the client-side functions provided by CodexCore. These can be used for accessing player info, jobs, currencies, map blips, and communicating with the server.
local CodexCore = exports['codex_core']:getLibClient()
-- ๐ Check if player is loaded
Citizen.CreateThread(function()
while not CodexCore.IsLoaded() do
Wait(500)
end
print('โ Player is loaded into the session.')
end)
-- ๐ชช Get Character Identifier
RegisterCommand("mycid", function()
local cid = CodexCore.GetCharacterIdentifier()
print("๐ Your Character Identifier is:", cid)
end)
-- ๐ทโโ๏ธ Get Job and Grade
RegisterCommand("myjob", function()
local job = CodexCore.GetJob()
local grade = CodexCore.GetJobGrade()
print("๐ท Job:", job, "| ๐ Grade:", grade)
end)
-- ๐ฐ Get Money & Gold
RegisterCommand("mymoney", function()
local cash = CodexCore.GetMoney()
local gold = CodexCore.GetGold()
print("๐ต Cash:", cash, "| ๐ช Gold:", gold)
end)
-- ๐ญ Get Group
RegisterCommand("mygroup", function()
local group = CodexCore.GetGroup()
print("๐ก๏ธ Group:", group)
end)
-- ๐ Add a Blip
RegisterCommand("addblip", function()
local blip = CodexCore.AddBlipForCoords(2500.0, -1300.0, 48.0, 212, "My Blip", 1)
print("๐ Blip added at location!")
end)
-- ๐ Use Server Callback
RegisterCommand("getcidfromsv", function()
CodexCore.TriggerServerCallback('CodexCore-lib:fetchUserCharacterIdentifier', function(cid)
print("๐ก Server returned Character ID:", cid)
end)
end)