├── fxmanifest.lua ├── README.md ├── config.lua ├── server └── sv_main.lua └── client └── cl_main.lua /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games { 'rdr3', 'gta5' } 3 | 4 | author 'L0rdw1z' 5 | description 'Applicaitons for jobs' 6 | 7 | shared_scripts { 8 | "@ox_lib/init.lua", 9 | "config.lua", 10 | } 11 | 12 | client_scripts { 13 | 'client/cl_main.lua', 14 | } 15 | 16 | server_scripts { 17 | 'server/sv_main.lua', 18 | } 19 | 20 | lua54 "yes" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [QB/ESX] 💼 Job Applies [FiveM] 2 | 3 | 4 | 5 | >### If you want to support me. Appreciate it! 🙌 🙌 Buy Me a Coffee at ko-fi.com 6 | ### Join in our discord: https://discord.gg/sHzYEcvhNE 7 | --- 8 | 9 | ### [Dependencies]:
10 | * [ox_lib](https://github.com/overextended/ox_lib) 11 | * [ox_target](https://github.com/overextended/ox_target) or [qb-target](https://github.com/qbcore-framework/qb-target) 12 | 13 | ### [Preview]:
14 | https://youtu.be/8LJJq5tj5YU 15 | -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.Target = "OX" -- QB / OX 4 | 5 | Config.PDWebHook = "" -- Your webhook for police applications 6 | Config.EMSWebHook = "" -- Your webhook for EMS applications 7 | Config.MechanicWebHook = "" -- Your webhook for mechanic applications 8 | 9 | Config.Applys = { 10 | -- [1] = { 11 | -- type = "Type of job - police/ems/mechanic", 12 | -- name = "Name for apply", 13 | -- label = "Label to display", 14 | -- coords = vector4(), 15 | -- ped = false/true, 16 | -- pedModel = "Ped model", 17 | -- }, 18 | 19 | -- FOR EXAMPLE: 20 | [1] = { 21 | type = "police", 22 | name = "mrpd", 23 | label = "Police applicaiton", 24 | coords = vector4(441.0, -980.25, 31.0, 0.0), 25 | ped = false, 26 | pedModel = "", 27 | }, 28 | [2] = { 29 | type = "ems", 30 | name = "pillbox_hospital", 31 | label = "EMS applicaiton", 32 | coords = vector4(299.08, -584.64, 43.26, 71.61), 33 | ped = true, 34 | pedModel = "s_m_m_scientist_01", 35 | }, 36 | [3] = { 37 | type = "mechanic", 38 | name = "ls_customs", 39 | label = "Mechanic applicaiton", 40 | coords = vector4(-355.44, -129.54, 39.43, 86.9), 41 | ped = true, 42 | pedModel = "s_m_m_lathandy_01", 43 | }, 44 | } -------------------------------------------------------------------------------- /server/sv_main.lua: -------------------------------------------------------------------------------- 1 | RegisterServerEvent('ld_jobapplys:sendApply', function(input, type) 2 | local src = source 3 | local ped = GetPlayerPed(src) 4 | local pedCoords = GetEntityCoords(ped) 5 | local date = os.date('%d-%m-%Y') 6 | if input then 7 | if type == "police" then 8 | local embed = { 9 | { 10 | ["thumbnail"] = { 11 | ["url"] = "https://static.wikia.nocookie.net/alterlifepolicedepartement/images/5/51/R_%281%29.png/revision/latest?cb=20220111090530" 12 | }, 13 | ["color"] = 1127128, 14 | ["title"] = 'Police application', 15 | ["description"] = '**First and Last Names:** '..input[1]..'\n **Age:** '..input[2]..'\n **Date of Birth:** '..date..'\n **Phone number:** '..input[4]..'\n **Gender:** '..input[5]..'\n **Do you have experience in this work?:** '..input[6]..'\n **Why you want to become a police officer?:** '..input[7]..'\n\n **Discord: **'..input[8], 16 | } 17 | } 18 | 19 | PerformHttpRequest(Config.PDWebHook, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' }) 20 | elseif type == "ems" then 21 | local embed = { 22 | { 23 | ["thumbnail"] = { 24 | ["url"] = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Star_of_life2.svg/1200px-Star_of_life2.svg.png" 25 | }, 26 | ["color"] = 15991041, 27 | ["title"] = 'EMS application', 28 | ["description"] = '**First and Last Names:** '..input[1]..'\n **Age:** '..input[2]..'\n **Date of Birth:** '..date..'\n **Phone number:** '..input[4]..'\n **Gender:** '..input[5]..'\n **Do you have experience in this work?:** '..input[6]..'\n **Why you want to become a EMS?:** '..input[7]..'\n\n **Discord: **'..input[8], 29 | } 30 | } 31 | 32 | PerformHttpRequest(Config.EMSWebHook, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' }) 33 | elseif type == "mechanic" then 34 | local embed = { 35 | { 36 | ["thumbnail"] = { 37 | ["url"] = "https://static.wikia.nocookie.net/logopedia/images/6/69/Los_Santos_Customs_%28Alt%29.png/revision/latest?cb=20221125234438" 38 | }, 39 | ["color"] = 16030209, 40 | ["title"] = 'Mechanic application', 41 | ["description"] = '**First and Last Names:** '..input[1]..'\n **Age:** '..input[2]..'\n **Date of Birth:** '..date..'\n **Phone number:** '..input[4]..'\n **Gender:** '..input[5]..'\n **Do you have experience in this work?:** '..input[6]..'\n **Why you want to become a mechanic?:** '..input[7]..'\n\n **Discord: **'..input[8], 42 | } 43 | } 44 | 45 | PerformHttpRequest(Config.MechanicWebHook, function(err, text, headers) end, 'POST', json.encode({username = name, embeds = embed}), { ['Content-Type'] = 'application/json' }) 46 | end 47 | end 48 | end) -------------------------------------------------------------------------------- /client/cl_main.lua: -------------------------------------------------------------------------------- 1 | CreateThread(function() 2 | for k,v in pairs(Config.Applys) do 3 | if Config.Target == "OX" then 4 | exports.ox_target:addBoxZone({ 5 | name = v.name, 6 | coords = vec4(v.coords.x, v.coords.y, v.coords.z, v.coords.w), 7 | size = vec3(0.75, 0.75, 4.0), 8 | rotation = 0.0, 9 | options = { 10 | { 11 | onSelect = function() 12 | TriggerEvent('ld_jobapplys:openApply', v.type) 13 | end, 14 | icon = 'fa-solid fa-circle', 15 | label = 'Job application', 16 | } 17 | } 18 | }) 19 | elseif Config.Target == "QB" then 20 | exports['qb-target']:AddBoxZone(v.name, vector3(v.coords.x, v.coords.y, v.coords.z-1), 1, 1, { 21 | name = v.name, 22 | heading = v.coords.w, 23 | debugPoly = false, 24 | minZ = v.coords.z-1, 25 | maxZ = v.coords.z+1, 26 | }, { 27 | options = { 28 | { 29 | name = 'v.name', 30 | action = function() 31 | TriggerEvent('ld_jobapplys:openApply', v.type) 32 | end, 33 | icon = 'fa-solid fa-shield', 34 | label = "Job application", 35 | } 36 | }, 37 | distance = 2.3 38 | }) 39 | end 40 | if v.ped then 41 | local modelHash = GetHashKey(v.pedModel) 42 | RequestModel(modelHash) 43 | while not HasModelLoaded(modelHash) do 44 | Wait(1) 45 | end 46 | local ped = CreatePed(1, modelHash, v.coords.x, v.coords.y, v.coords.z-1, v.coords.w, false, true) 47 | FreezeEntityPosition(ped, true) 48 | SetEntityInvincible(ped, true) 49 | SetBlockingOfNonTemporaryEvents(ped, true) 50 | end 51 | end 52 | end) 53 | 54 | RegisterNetEvent('ld_jobapplys:openApply', function(type) 55 | if type == "ems" then 56 | local input = lib.inputDialog('Application for EMS', { 57 | {type = 'input', label = 'First and last names', description = 'Your names here...', required = true}, 58 | {type = 'number', label = 'Whats your age?', description = 'Your age here..', required = true}, 59 | {type = 'date', label = 'Date Of Birth', icon = {'far', 'calendar'}, format = "DD/MM/YYYY", required = true}, 60 | {type = 'input', label = 'Your phone number', description = 'Your phone number here...', required = true}, 61 | {type = 'select', label = 'Gender', options = { 62 | {value = 'Male', label = 'Male'}, 63 | {value = 'Woman', label = 'Woman'} 64 | }, required = true}, 65 | {type = 'select', label = 'Do you have experience in this work?', options = { 66 | {value = 'Yes', label = 'Yes'}, 67 | {value = 'No', label = 'No'} 68 | }, required = true}, 69 | {type = 'textarea', label = 'Why you want to become a EMS?', required = true, min = 10, max = 300}, 70 | {type = 'input', label = 'Discord:', required = true}, 71 | }) 72 | 73 | TriggerServerEvent('ld_jobapplys:sendApply', input, "ems") 74 | elseif type == "police" then 75 | local input = lib.inputDialog('Application for Police Job', { 76 | {type = 'input', label = 'First and last names', description = 'Your names here...', required = true}, 77 | {type = 'number', label = 'Whats your age?', description = 'Your age here..', required = true}, 78 | {type = 'date', label = 'Date Of Birth', icon = {'far', 'calendar'}, format = "DD/MM/YYYY", required = true}, 79 | {type = 'input', label = 'Your phone number', description = 'Your phone number here...', required = true}, 80 | {type = 'select', label = 'Gender', options = { 81 | {value = 'Male', label = 'Male'}, 82 | {value = 'Woman', label = 'Woman'} 83 | }, required = true}, 84 | {type = 'select', label = 'Do you have experience in this work?', options = { 85 | {value = 'Yes', label = 'Yes'}, 86 | {value = 'No', label = 'No'} 87 | }, required = true}, 88 | {type = 'textarea', label = 'Why you want to become a police officer?', required = true, min = 10, max = 300}, 89 | {type = 'input', label = 'Discord:', required = true}, 90 | }) 91 | 92 | TriggerServerEvent('ld_jobapplys:sendApply', input, "police") 93 | elseif type == "mechanic" then 94 | local input = lib.inputDialog('Application for Mechanic', { 95 | {type = 'input', label = 'First and last names', description = 'Your names here...', required = true}, 96 | {type = 'number', label = 'Whats your age?', description = 'Your age here..', required = true}, 97 | {type = 'date', label = 'Date Of Birth', icon = {'far', 'calendar'}, format = "DD/MM/YYYY", required = true}, 98 | {type = 'input', label = 'Your phone number', description = 'Your phone number here...', required = true}, 99 | {type = 'select', label = 'Gender', options = { 100 | {value = 'Male', label = 'Male'}, 101 | {value = 'Woman', label = 'Woman'} 102 | }, required = true}, 103 | {type = 'select', label = 'Do you have experience in this work?', options = { 104 | {value = 'Yes', label = 'Yes'}, 105 | {value = 'No', label = 'No'} 106 | }, required = true}, 107 | {type = 'textarea', label = 'Why you want to become a mechanic?', required = true, min = 10, max = 300}, 108 | {type = 'input', label = 'Discord:', required = true}, 109 | }) 110 | 111 | TriggerServerEvent('ld_jobapplys:sendApply', input, "mechanic") 112 | end 113 | end) --------------------------------------------------------------------------------