Add/remove accent cmd for server managers

This commit is contained in:
Vortrex
2022-01-17 07:42:42 -06:00
parent 0cdcb73a01
commit 0b38e8218e

View File

@@ -89,3 +89,50 @@ function getAccentFromParams(params) {
}
// ===========================================================================
function reloadAccentConfigurationCommand(command, params, client) {
getGlobalConfig().accents = loadAccentConfig();
messageAdmins(`${client.name} {MAINCOLOUR}has reloaded the accent list`);
}
// ===========================================================================
function addAccentCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let newAccentName = params;
if(getAccentFromParams(newAccentName) != false) {
messagePlayerError(client, `That accent already exists!`)
return false;
}
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
}
// ===========================================================================
function removeAccentCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let newAccentName = params;
if(!getAccentFromParams(newAccentName)) {
messagePlayerError(client, `That accent doesn't exist!`)
return false;
}
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
}
// ===========================================================================