This is an another my simple resource which allows you to have multiple jobs, switch them using command /changejob and log it to the admin team - to room at the Discord server where admin team will has access to.
Features
Easy install and edit
Have double jobs (be a gangester and waiter)
Change jobs using command
Log it for admins
Allow admins change players second job directly from game
You can read the docs here
Installation
Is is quite simple, there are only few simple steps.
Import sql.sql to your database
Go to /server/main.lua and edit local webhook = 'xxx' to your likings.
Go to /client/main.lua and edit all by your’s liking Mainly the notifications. Optional
Go to /server/main.lua and edit allowedAdminGroups which contains allowed admin groups
You can edit it or use like you like, but you are not allowed to publish it as yours, rename it (other names then sqz_switchjob) or sell/resell it. These are the simple rules.
Yes, anyone can use this command. The point of this script is if for example a mafia member has job mafia to allow him to change his job for a bar and be a barman like.
But if you want, you can restrict it for certain jobs like:
local allowedJobs = {
'mafia',
'gang'
-- Add jobs allowed to use this command here, each job to its own line
}
RegisterCommand("changejob", function (src, args, raw)
for _, allowedJob in pairs(allowedJobs) do
if ESX.PlayerData.job.name == allowedJob then
if timer == 0 and allowCommand then
TriggerServerEvent('sqz_switchjob:getSecondJob')
timer = 30
allowCommand = false
else
ESX.ShowNotification('You have to wait 30 seconds between switching jobs, now you have to wait: (time in seconds) '..timer) -- Here you can change whatewer you want
end
else
-- Some way to inform player he is not allowed to use it.
end
end
end, false)
This editor is not the best for editting lua code, so I hope it is legible and you can read it
Ey, hi, is there a way that only admins can give the second job?
So i can give to a band their role and they can still change their first job in the jobs place.
Any way, thanks a lot and sorry if something is bad written
This is so helpfull mate! Thanks for this release!!
Let me drop an idea, add a /setjob2 command that gives the second job to the player so you dont need to do it manualy in the database.