if Cfg.Framework ~= 'vrp' then return end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ INITIALIZE │ -- └──────────────────────────────────────────────────────────────────┘ -- Check if the framework is loaded function HasFrameworkLoaded() return true end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ PLAYER │ -- └──────────────────────────────────────────────────────────────────┘ --- Get the player object function GetPlayer() return {} end -- Check if the player has loaded (after character selection). function HasPlayerLoadedIn() return NetworkIsSessionStarted() end -- Get the player's identifier function GetIdentifier() return 'ACBD1234' end -- Get if the player is dead or dying --- @return boolean | nil # True if the player is dead or dying, false if not, nil if not supported by the framework. function GetIsPlayerDeadFromFramework() return nil end -- Get if the player is cuffed_or_dead function GetIsPlayerCuffedFromFramework() return nil end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ JOB │ -- └──────────────────────────────────────────────────────────────────┘ -- Get the job name of the player function GetJobName() return 'unemployed' end -- Get the job label of the player function GetJobLabel() return 'Unemployed' end -- Get the job grade of the player function GetJobGrade() return 0 end -- Get the job grade label of the player function GetJobGradeLabel() return 'Unemployed' end -- Get if the player is on duty function GetJobDuty() if Cfg.DisableDuty then return true end local customDuty = GetCustomJobDuty() if customDuty ~= nil then return customDuty end return true end -- Check if a player has the job function HasJob(job) local myJob = GetJobName() if not myJob or not GetJobDuty() or not GetJobGrade() then return false end local myGrade = tonumber(GetJobGrade()) local jobType = type(job) if jobType == 'string' then return myJob == job end if jobType ~= 'table' then return false end local minOnly = tonumber(job.min or job.minimum) if minOnly then return myGrade >= minOnly end local keyed = job[myJob] if keyed ~= nil then if type(keyed) == 'boolean' then return keyed == true end local required = tonumber(keyed) if required then return myGrade >= required end return true end local isGradesOnly = (#job > 0) if isGradesOnly then for cd = 1, #job do if tonumber(job[cd]) == nil then isGradesOnly = false break end end end if isGradesOnly then for cd = 1, #job do if myGrade == tonumber(job[cd]) then return true end end return false end for _, value in ipairs(job) do if value == myJob then return true end end return false end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ GANG │ -- └──────────────────────────────────────────────────────────────────┘ -- Get the gang name of the player function GetGangName() local customGang = GetCustomGang() if customGang ~= nil then return customGang.name end return 'none' end -- Get the gang label of the player function GetGangLabel() local customGang = GetCustomGang() if customGang ~= nil then return customGang.label end return 'No Gang' end -- Get the gang grade of the player function GetGangGrade() local customGang = GetCustomGang() if customGang ~= nil then return customGang.grade end return 0 end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ MONEY │ -- └──────────────────────────────────────────────────────────────────┘ -- Get the amount of money a player has function GetPlayerMoney(money_type) return 0 end -- ┌──────────────────────────────────────────────────────────────────┐ -- │ VEHICLE │ -- └──────────────────────────────────────────────────────────────────┘ function FrameworkCreateVehicle(model, coords) local heading = coords.w or coords.h or 0.0 return CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, false) end