DirkScripts
Docs
πΆ Player
#Ready
lua--## Used instead of playerLoaded events Citizen.CreateThread(function() while not Core do Wait(500); end while not Core.Player.Ready() do Wait(500); end print('Hello World') --## This print will execute when the player has gotten past the multi-char and is in-game end)
#Job
lualocal myJob = Core.Player.Job() --[[ returns; { name = "job_name", label = "Job Label", rank = 2, rankL = "Rank Label", duty = true, isBoss = false, isCop = true, } ]]
#Identifier
lualocal characterID = Core.Player.Identifier() --## Returns characterID dependant on framework e.g QBCore - CitizenID | ESX - CharID
#Gang
lualocal gangName = Core.Player.Gang() --## Will simply return gang_name if using qb-core. May add rcore_gangs support
#IsCop
lualocal isCop = Core.Player.IsCop() --## Returns true if player is a cop
#GetJob
lualocal myJob = Core.Player.GetJob() --## Will return the same as Core.Player.Job() but will make sure table is up to date by gathering the job
#Job Change Event
luaAddEventHandler("Dirk-Core:JobChange", function(job) --## job; is the same return as GetJob() and Job() this event will run if the framework fires the job change event end)
#PlayAnim
luaCore.Player.PlayAnim({ ent = entity, dict = "anim_dict", anim = "anim_name", freeze = true, time = 10000, }) --## This will load the anim dict for you
