From 60837e170fec2009ce1f1273f48a9d0f43b755c7 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 28 Apr 2021 21:25:10 -0500 Subject: [PATCH] Use cash utils for biz till cmds, use biz info label type --- scripts/server/business.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/server/business.js b/scripts/server/business.js index c330c207..d172ccc8 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -602,7 +602,7 @@ function withdrawFromBusinessCommand(command, params, client) { } getBusinessData(businessId).till -= amount; - getPlayerCurrentSubAccount(client).cash += amount; + givePlayerCash(client, amount); updatePlayerCash(client); messagePlayerSuccess(client, `You withdrew $${amount} from business [#0099FF]${getBusinessData(businessId).name} till`); } @@ -659,7 +659,7 @@ function depositIntoBusinessCommand(command, params, client) { } getBusinessData(businessId).till += amount; - getPlayerCurrentSubAccount(client).cash -= amount; + takePlayerCash(getPlayerCurrentSubAccount(client).cash, amount); updatePlayerCash(client); messagePlayerSuccess(client, `You deposited $${amount} into business [#0099FF]${getBusinessData(businessId).name} [#FFFFFF]till`); } @@ -1535,9 +1535,15 @@ function updateBusinessPickupLabelData(businessId) { setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.type", AG_LABEL_BUSINESS, true); setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.locked", getBusinessData(businessId).locked, true); - if(getBusinessData(businessId).floorItemCache.length > 0) { - setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.buyhelp", true, true); + setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.help", AG_BIZLABEL_INFO_NONE, true); + if(getBusinessData(businessId).hasInterior) { + setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.help", AG_BIZLABEL_INFO_ENTER, true); + } else { + if(getBusinessData(businessId).floorItemCache.length > 0) { + setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.help", AG_BIZLABEL_INFO_BUY, true); + } } + if(getBusinessData(businessId).buyPrice > 0) { setEntityData(getBusinessData(businessId).entrancePickup, "ag.label.price", getBusinessData(businessId).buyPrice, true); }