function Load(name) local resourceName = GetCurrentResourceName() local chunk = LoadResourceFile(resourceName, ('data/%s.lua'):format(name)) if chunk then local err chunk, err = load(chunk, ('@@%s/data/%s.lua'):format(resourceName, name), 't') if err then error(('\n^1 %s'):format(err), 0) end return chunk() end end ------------------------------------------------------------------------------- -- Settings ------------------------------------------------------------------------------- Config = {} -- It's possible to interact with entities through walls so this should be low Config.MaxDistance = 1.6 -- Enable debug options Config.Debug = false -- Supported values: true, false Config.Standalone = false -- Enable outlines around the entity you're looking at Config.EnableOutline = false -- Enable default options (Toggling vehicle doors) Config.EnableDefaultOptions = false -- Disable the target eye whilst being in a vehicle Config.DisableInVehicle = false -- Key to open the target Config.OpenKey = 'LMENU' -- Left Alt Config.OpenControlKey = 19 -- Control for keypress detection also Left Alt for the eye itself, controls are found here https://docs.fivem.net/docs/game-references/controls/ -- Key to open the menu Config.MenuControlKey = 237 -- Control for keypress detection on the context menu, this is the Right Mouse Button, controls are found here https://docs.fivem.net/docs/game-references/controls/ ------------------------------------------------------------------------------- -- Target Configs ------------------------------------------------------------------------------- -- These are all empty for you to fill in, refer to the .md files for help in filling these in Config.CircleZones = { } Config.BoxZones = { ["pddashcam"] = { name = "PD Dashcam", coords = vector3(442.31, -999.67, 34.97), length = 1.0, width = 3.4, heading = 359, debugPoly = false, minZ= 34.77, maxZ= 35.37, options = { { type = "client", event = "rp_interact:client:PoliceDashCams", icon = "fas fa-circle", label = "Araç Kameralarını Görüntüle", job = "police", }, }, distance = 1.5 }, ["reapers"] = { name = "reapers", coords = vector3(21.5241, -1105.0564, 29.7970), length = 1.0, width = 1.0, heading = 359, debugPoly = false, minZ= -1105.0564, maxZ= 29.7970, options = { { type = "client", event = "deneme1", icon = "fas fa-circle", label = "Gunshop Market", job = "reapers", }, }, distance = 1.5 }, -- ["pvpzone"] = { -- name = "PVP ZONE", -- coords = vector3(-1708.28, -1120.35, 13.153), -- length = 1.0, -- width = 1.0, -- heading = 359, -- debugPoly = false, -- minZ= -1120.35, -- maxZ= 13.153, -- options = { -- { -- type = "client", -- event = "viber-ffa:client:menu", -- icon = "fas fa-circle", -- label = "Pvp Zone", -- }, -- }, -- distance = 2.0 -- }, } Config.PolyZones = { } Config.TargetBones = { } Config.TargetEntities = { } Config.TargetModels = { } Config.GlobalPedOptions = { } Config.GlobalVehicleOptions = { options = { { type = 'client', event = 'qb-methcar:cook', icon = 'fas fa-blender', label = 'Hadi pişirelim!', canInteract = function(entity) if not entity then return false end if GetVehicleEngineHealth(entity) <= 0 then return false end local model = GetEntityModel(entity) local modelName = GetDisplayNameFromVehicleModel(model) return modelName == 'JOURNEY' end }, { action = function() local QBCore = exports["qb-core"]:GetCoreObject() local playerped = PlayerPedId() if not IsPedInAnyVehicle(playerped) then local PlayerCoords = GetEntityCoords(playerped) local arac, mesafe = QBCore.Functions.GetClosestVehicle(PlayerCoords) if mesafe < 5 then QBCore.Functions.Progressbar("ters-duz", "Araç Çevriliyor", 5000, false, true, { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, {}, {}, {}, function() -- Done SetVehicleOnGroundProperly(arac) end, function() -- Cancel end) else QBCore.Functions.Notify(text["noClosestCar"]) end else QBCore.Functions.Notify("Araç İçindeki İken Bu İşlemi Gerçekleştiremezsin") end end, icon = 'fas fa-car-side', label = 'Aracı Çevir', }, }, distance = 2.0, } Config.GlobalObjectOptions = { } Config.GlobalPlayerOptions = { options = { -- { -- type = "client", -- event = "qb-phone:client:GiveContactDetails", -- icon = "fas fa-address-book", -- label = "Numaranı Ver", -- }, -- { -- type = "command", -- event = "kucakla", -- icon = "fas fa-people-carry", -- label = "Kucakla", -- }, -- { -- type = "command", -- event = "taşı", -- icon = "fas fa-people-carry", -- label = "Yaralıyı Taşı", -- }, -- { -- type = "client", -- event = "police:client:RobPlayer", -- icon = "fas fa-gun", -- label = "Soy", -- }, -- { -- type = "client", -- event = "polisislemleri", -- icon = "fas fa-users", -- label = "Polis İşlemleri", -- job = "police", -- }, -- { -- type = "client", -- event = "doktorislemleri", -- icon = "fas fa-ambulance", -- label = "Doktor İşlemleri", -- job = "ambulance", -- }, }, } Config.Peds = {} ------------------------------------------------------------------------------- -- Functions ------------------------------------------------------------------------------- local function JobCheck() return true end local function GangCheck() return true end local function ItemCount() return true end local function CitizenCheck() return true end CreateThread(function() if not Config.Standalone then local QBCore = exports['qb-core']:GetCoreObject() local PlayerData = QBCore.Functions.GetPlayerData() ItemCount = function(item) for _, v in pairs(PlayerData.items) do if v.name == item then return true end end return false end JobCheck = function(job) if type(job) == 'table' then job = job[PlayerData.job.name] if job and PlayerData.job.grade.level >= job then return true end elseif job == 'all' or job == PlayerData.job.name then return true end return false end GangCheck = function(gang) if type(gang) == 'table' then gang = gang[PlayerData.gang.name] if gang and PlayerData.gang.grade.level >= gang then return true end elseif gang == 'all' or gang == PlayerData.gang.name then return true end return false end CitizenCheck = function(citizenid) return citizenid == PlayerData.citizenid or citizenid[PlayerData.citizenid] end RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() PlayerData = QBCore.Functions.GetPlayerData() SpawnPeds() end) RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() PlayerData = {} DeletePeds() end) RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo) PlayerData.job = JobInfo end) RegisterNetEvent('QBCore:Client:OnGangUpdate', function(GangInfo) PlayerData.gang = GangInfo end) RegisterNetEvent('QBCore:Player:SetPlayerData', function(val) PlayerData = val end) else local firstSpawn = false AddEventHandler('playerSpawned', function() if not firstSpawn then SpawnPeds() firstSpawn = true end end) end end) function CheckOptions(data, entity, distance) if not entity then return false end if distance and data.distance and distance > data.distance then return false end if data.job and not JobCheck(data.job) then return false end if data.gang and not GangCheck(data.gang) then return false end if data.item and not ItemCount(data.item) then return false end if data.citizenid and not CitizenCheck(data.citizenid) then return false end if data.canInteract then local success, result = pcall(data.canInteract, entity, distance, data) if not success then return false end return result end return true end