Add job list command
This commit is contained in:
@@ -298,6 +298,10 @@ function loadCommands() {
|
||||
new CommandData("uniform", jobUniformCommand, "[uniform]", getStaffFlagValue("None"), true, false, "Use a job uniform"),
|
||||
new CommandData("equip", jobEquipmentCommand, "[equipment]", getStaffFlagValue("None"), true, false, "Get equipment for your job"),
|
||||
|
||||
new CommandData("jobs", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
|
||||
new CommandData("joblist", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
|
||||
new CommandData("alljobs", jobListCommand, "", getStaffFlagValue("None"), true, false, "Shows a list of all jobs"),
|
||||
|
||||
// Emergency Services (Police, Fire, EMS, etc)
|
||||
new CommandData("department", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false, "Communicate with all emergency services (radio must be on and able to transmit)"),
|
||||
new CommandData("d", jobDepartmentRadioCommand, "", getStaffFlagValue("None"), true, false, "Communicate with all emergency services (radio must be on and able to transmit)"),
|
||||
|
||||
@@ -394,6 +394,24 @@ function showJobInformationToPlayer(client, jobType) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function jobListCommand(command, params, client) {
|
||||
if(!canPlayerUseJobs(client)) {
|
||||
messagePlayerError(client, "You are not allowed to use any jobs!");
|
||||
return false;
|
||||
}
|
||||
|
||||
let jobList = getServerData().jobs.map(function(x) { return `${x.name}`});
|
||||
let chunkedList = splitArrayIntoChunks(jobList, 4);
|
||||
|
||||
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderJobList")));
|
||||
for(let i in chunkedList) {
|
||||
messagePlayerInfo(client, chunkedList[i].join(", "));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function takeJobCommand(command, params, client) {
|
||||
if(!canPlayerUseJobs(client)) {
|
||||
messagePlayerError(client, "You are not allowed to use any jobs!");
|
||||
|
||||
Reference in New Issue
Block a user