Add job list command

This commit is contained in:
Vortrex
2022-05-15 04:19:38 -05:00
parent 5242233841
commit 57c60e1ff6
2 changed files with 22 additions and 0 deletions

View File

@@ -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!");