From 8397bc3f696ca0b7fed7b35c438e7c57143b295a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 22 Mar 2021 03:13:03 -0500 Subject: [PATCH] Add set/get health & armour utils --- scripts/server/native.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/server/native.js b/scripts/server/native.js index 5d40e4fe..5b3018a3 100644 --- a/scripts/server/native.js +++ b/scripts/server/native.js @@ -188,6 +188,32 @@ function getPlayerSkin(client) { // =========================================================================== +function setPlayerHealth(client, health) { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${health}`); + sendPlayerSetHealth(client, health); +} + +// =========================================================================== + +function getPlayerHealth(client) { + return client.player.health; +} + +// =========================================================================== + +function setPlayerArmour(client, armour) { + logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${armour}`); + sendPlayerSetArmour(client, armour); +} + +// =========================================================================== + +function getPlayerArmour(client) { + return client.player.armour; +} + +// =========================================================================== + function setPlayerCash(client, amount) { getPlayerCurrentSubAccount(client).cash = amount; updatePlayerCash(client);