Add addrace command
This commit is contained in:
@@ -54,4 +54,23 @@ function saveRaceToDatabase(raceData) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function createRaceCommand(command, params, client) {
|
||||
if(areParamsEmpty(params)) {
|
||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||
return false;
|
||||
}
|
||||
|
||||
let raceId = getRaceFromParams(params);
|
||||
|
||||
if(raceId == false) {
|
||||
messagePlayerError(client, "A race with that name already exists!");
|
||||
return false;
|
||||
}
|
||||
|
||||
createRace(params);
|
||||
messageAdmins(`{adminRed}${getPlayerName(client)}{MAINCOLOUR} created race {ALTCOLOUR}${params}`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user