Skip to content

Commit

Permalink
refactor: convert esx_joblisting > bpt_joblisting
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Aug 23, 2024
1 parent 15210c6 commit 3afd03c
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

esx_joblisting
Copyright (C) 2015-2023 Jérémie N'gadi
bpt_joblisting Copyright (C) 2024 bitpredator

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +651,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

esx_joblisting Copyright (C) 2015-2023 Jérémie N'gadi
bpt_joblisting Copyright (C) 2024 bitpredator
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This Simple resource lets you finally contribute to Society and make a differenc

## Legal

esx_joblisting - virtual Job Center!
bpt_joblisting - virtual Job Center!

Copyright (C) 2015-2023 Jérémie N'gadi, ESX-Framework
Copyright (C) 2024 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ local menuIsShowed, TextUIdrawing = false, false

function ShowJobListingMenu()
menuIsShowed = true
ESX.TriggerServerCallback("esx_joblisting:getJobsList", function(jobs)
ESX.TriggerServerCallback("bpt_joblisting:getJobsList", function(jobs)
local elements = { { unselectable = "true", title = TranslateCap("job_center"), icon = "fas fa-briefcase" } }

for i = 1, #jobs do
elements[#elements + 1] = { title = jobs[i].label, name = jobs[i].name }
end

ESX.OpenContext("right", elements, function(menu, SelectJob)
TriggerServerEvent("esx_joblisting:setJob", SelectJob.name)
TriggerServerEvent("bpt_joblisting:setJob", SelectJob.name)
ESX.CloseContext()
ESX.ShowNotification(TranslateCap("new_job", SelectJob.title), "success")
menuIsShowed = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ game("gta5")

description("Provides a way for players to select a job")
lua54("yes")
version("1.0")
legacyversion("1.9.1")
version("1.0.2")

shared_scripts({
"@es_extended/imports.lua",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function getJobs()
return availableJobs
end

ESX.RegisterServerCallback("esx_joblisting:getJobsList", function(source, cb)
ESX.RegisterServerCallback("bpt_joblisting:getJobsList", function(source, cb)
local jobs = getJobs()
cb(jobs)
end)
Expand Down Expand Up @@ -37,8 +37,8 @@ function IsNearCentre(player)
return Close
end

RegisterServerEvent("esx_joblisting:setJob")
AddEventHandler("esx_joblisting:setJob", function(job)
RegisterServerEvent("bpt_joblisting:setJob")
AddEventHandler("bpt_joblisting:setJob", function(job)
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
local jobs = getJobs()
Expand All @@ -50,6 +50,6 @@ AddEventHandler("esx_joblisting:setJob", function(job)
print("[^1ERROR^7] Tried Setting User ^5" .. source .. "^7 To Invalid Job - ^5" .. job .. "^7!")
end
else
print("[^3WARNING^7] User ^5" .. source .. "^7 Attempted to Exploit ^5`esx_joblisting:setJob`^7!")
print("[^3WARNING^7] User ^5" .. source .. "^7 Attempted to Exploit ^5`bpt_joblisting:setJob`^7!")
end
end)

0 comments on commit 3afd03c

Please sign in to comment.