Is there a way to turn 2 or 3 jobs that are available at City Halls into Side-Jobs? The jobs that i was looking for is the Hotdog Seller, Trucker or Bus Driver. It is to let those who already have a job (like the Police, EMS etc) to do side-jobs (Hotdogs, Bus Driver or Trucker) without letting go their current job.
Currently, those who already have a job (Police or EMS), if they accepted another job, they will lose their current jobs and they need to re-apply to their bosses so that they(the boss) can re-hire them into the force. I want to avoid this.
or, Disable the need to get a Job at the City Hall and anyone can just do the Job (except the whitelisted jobs) at their respective jobcentre (eg, Bus Driver at Bus Station). I know nothing about scripting, so i kinda need help.
-Sorry for my bad English-
1 Like
Yes you can edit those resources and remove the portions of code which typically say
âif PlayerJob == âjobnameâ thenâ
do i replace âjobnameâ to ânoneâ or âallâ ?
No you just remove the line and the accompanying end
Tried removing all portions of code that contains this, nothing happens. Now, if a player apply for the job, it wonât even appear at the base.
The changes i made
Original
â Events
RegisterNetEvent(âQBCore:Client:OnPlayerLoadedâ, function()
PlayerJob = QBCore.Functions.GetPlayerData().job
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
if PlayerJob.name == âtruckerâ then
CreateElements()
end
end)
RegisterNetEvent(âQBCore:Client:OnPlayerUnloadâ, function()
RemoveTruckerBlips()
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
end)
RegisterNetEvent(âQBCore:Client:OnJobUpdateâ, function(JobInfo)
local OldPlayerJob = PlayerJob.name
PlayerJob = JobInfo
if PlayerJob.name == "trucker" then
CreateElements()
end
if OldPlayerJob == "trucker" then
RemoveTruckerBlips()
end
end)
RegisterNetEvent(âqb-truckerjob:client:ShowMarkerâ, function(active)
if PlayerJob.name == âtruckerâ then
showMarker = active
end
end)
RegisterNetEvent(âqb-truckerjob:client:SetDeliveringâ, function(active)
if PlayerJob.name == âtruckerâ then
Delivering = active
end
end)
main.lua (16.5 KB)
To
â Events
RegisterNetEvent(âQBCore:Client:OnPlayerLoadedâ, function()
PlayerJob = QBCore.Functions.GetPlayerData().job
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
end)
RegisterNetEvent(âQBCore:Client:OnPlayerUnloadâ, function()
RemoveTruckerBlips()
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
end)
RegisterNetEvent(âQBCore:Client:OnJobUpdateâ, function(JobInfo)
local OldPlayerJob = PlayerJob.name
PlayerJob = JobInfo
end)
RegisterNetEvent(âqb-truckerjob:client:ShowMarkerâ, function(active)
end)
RegisterNetEvent(âqb-truckerjob:client:SetDeliveringâ, function(active)
end)
main.lua (16.1 KB)
Only thing is, i only saw the lines at client/main.lua. The rest was untouched (so basically like the original).
mrraftex:
â Events
RegisterNetEvent(âQBCore:Client:OnPlayerLoadedâ, function()
PlayerJob = QBCore.Functions.GetPlayerData().job
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
if PlayerJob.name == âtruckerâ then
CreateElements()
end
end)
RegisterNetEvent(âQBCore:Client:OnPlayerUnloadâ, function()
RemoveTruckerBlips()
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
end)
RegisterNetEvent(âQBCore:Client:OnJobUpdateâ, function(JobInfo)
local OldPlayerJob = PlayerJob.name
PlayerJob = JobInfo
if PlayerJob.name == "trucker" then
CreateElements()
end
if OldPlayerJob == "trucker" then
RemoveTruckerBlips()
end
end)
RegisterNetEvent(âqb-truckerjob:client:ShowMarkerâ, function(active)
if PlayerJob.name == âtruckerâ then
showMarker = active
end
end)
RegisterNetEvent(âqb-truckerjob:client:SetDeliveringâ, function(active)
if PlayerJob.name == âtruckerâ then
Delivering = active
end
end)
You removed code inside the if statement.
Example
RegisterNetEvent(âqb-truckerjob:client:SetDeliveringâ, function(active)
if PlayerJob.name == "truckker" then--remove this line
Delivering = active --keep this line
end--remove this line
end)
Follow this throughout.
Thanks for the reply, i want to confirm.
â Events
RegisterNetEvent(âQBCore:Client:OnPlayerLoadedâ, function()
PlayerJob = QBCore.Functions.GetPlayerData().job
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
--if PlayerJob.name == âtruckerâ then
CreateElements()
--end
end)
RegisterNetEvent(âQBCore:Client:OnPlayerUnloadâ, function()
RemoveTruckerBlips()
CurrentLocation = nil
CurrentBlip = nil
hasBox = false
isWorking = false
JobsDone = 0
end)
RegisterNetEvent(âQBCore:Client:OnJobUpdateâ, function(JobInfo)
local OldPlayerJob = PlayerJob.name
PlayerJob = JobInfo
--if PlayerJob.name == "trucker" then
CreateElements()
--end
--if OldPlayerJob == "trucker" then
RemoveTruckerBlips()
--end
end)
RegisterNetEvent(âqb-truckerjob:client:ShowMarkerâ, function(active)
--if PlayerJob.name == âtruckerâ then
showMarker = active
--end
end)
RegisterNetEvent(âqb-truckerjob:client:SetDeliveringâ, function(active)
--if PlayerJob.name == âtruckerâ then
Delivering = active
--end
end)
is this correct? but thereâs line that i have doubt, itâs this
--if OldPlayerJob == "trucker" then
RemoveTruckerBlips()
--end
should i remove all 3 lines or do the same like what you said?
Or just get a multijob script then pd can switch jobs anyway
system
Closed
July 13, 2022, 4:48am
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.