Module sv_job
Job System
Functions
| HasJob (src, jobTable) | HasJob function. |
| GetPlayersWithJob (job) | GetPlayersWithJob function. |
| GetPlayersWithJobs (jobs) | GetPlayersWithJobs function. |
| SendEventToJob (job, event, ...) | SendEventToJob function. |
| SendEventToJobs (jobs, event, ...) | SendEventToJobs function. |
Functions
- HasJob (src, jobTable)
-
HasJob function.
This function checks if a player has a job. Used for gangs as well.
Parameters:
- src The player to check. number
- jobTable The job table. table
Returns:
-
boolean
Usage:
local hasJob = exports.jones_util:HasJob(src, {"police", "ems"})
- GetPlayersWithJob (job)
-
GetPlayersWithJob function.
This function gets all players with a job.
Parameters:
- job The job to check. string
Returns:
-
table
Usage:
local players = exports.jones_util:GetPlayersWithJob("police")
- GetPlayersWithJobs (jobs)
-
GetPlayersWithJobs function.
This function gets all players with multiple jobs.
Parameters:
- jobs The jobs to check. table
Returns:
-
table
Usage:
local players = exports.jones_util:GetPlayersWithJobs({"police", "ems"})
- SendEventToJob (job, event, ...)
-
SendEventToJob function.
This function sends an event to a job.
Parameters:
- job The job to send the event to. string
- event The event to send. string
- ... The arguments to send. any
Usage:
exports.jones_util:SendEventToJob("police", "police:client:sendAlert", {title = "Test", message = "Test"})
- SendEventToJobs (jobs, event, ...)
-
SendEventToJobs function.
This function sends an event to multiple jobs.
Parameters:
- jobs The jobs to send the event to. table
- event The event to send. string
- ... The arguments to send. any
Usage:
exports.jones_util:SendEventToJobs({"police", "ems"}, "police:client:sendAlert", {title = "Test", message = "Test"})