diff --git a/scripts/server/moderation.js b/scripts/server/moderation.js index 020acb02..de6adeec 100644 --- a/scripts/server/moderation.js +++ b/scripts/server/moderation.js @@ -516,3 +516,24 @@ function adminChatCommand(command, params, client) { } // --------------------------------------------------------------------------- + +function givePlayerMoneyCommand(command, params, client) { + if(areParamsEmpty(params)) { + messageClientSyntax(client, getCommandSyntaxText(command)); + return false; + } + + let splitParams = params.split(" "); + let targetClient = getClientFromParams(splitParams[0]); + let amount = toInteger(splitParams[1]); + + if(!targetClient) { + messageClientError(client, "That player is not connected!"); + return false; + } + + getClientCurrentSubAccount(targetClient).cash += amount; + updatePlayerCash(targetClient); + messageClientSuccess(client, `You gave [#AAAAAA]$${amount} [#FFFFFF]to [#AAAAAA]${getCharacterFullName(targetClient)}`); + messageClientAlert(client, `An admin gave you [#AAAAAA]$${amount}`); +}