mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Added ESX.DeleteJob for Runtime
Added a function 'ESX.DeleteJob' to be used in runtime to delete jobs.
This commit is contained in:
@@ -417,6 +417,17 @@ function ESX.CreateJob(name, label, grades)
|
||||
ESX.Jobs[name] = job
|
||||
end
|
||||
|
||||
--- Delete Job at Runtime
|
||||
function ESX.DeleteJob(name)
|
||||
--- @param name string
|
||||
if not name then
|
||||
return print('[^3WARNING^7] missing argument `name(string)` while deleting a job')
|
||||
end
|
||||
MySQL.update('DELETE FROM jobs WHERE name = ?', {name})
|
||||
MySQL.update('DELETE FROM job_grades WHERE job_name = ?', {name})
|
||||
ESX.Jobs[name] = nil
|
||||
end
|
||||
|
||||
function ESX.RefreshJobs()
|
||||
local Jobs = {}
|
||||
local jobs = MySQL.query.await('SELECT * FROM jobs')
|
||||
|
||||
Reference in New Issue
Block a user