Add addrace command

This commit is contained in:
Vortrex
2022-04-26 10:21:23 -05:00
parent e4ef0c4dfa
commit 443418f340

View File

@@ -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}`);
}
// ===========================================================================