From 1f6f90968f9ab06fd08a89a596f306af19ef09b0 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:57:43 -0600 Subject: [PATCH] Add bizdelowner cmd, convert to locale strings --- scripts/server/business.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/scripts/server/business.js b/scripts/server/business.js index 0619678f..87775966 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -496,6 +496,27 @@ function setBusinessPublicCommand(command, params, client) { // =========================================================================== +function removeBusinessOwnerCommand(command, params, client) { + let businessId = getPlayerBusiness(client); + + if(!areParamsEmpty(params)) { + businessId = getBusinessFromParams(params); + } + + if(!getBusinessData(businessId)) { + messagePlayerError(client, getLocaleString(client, "InvalidBusiness")); + return false; + } + + getBusinessData(businessId).ownerType = VRR_BIZOWNER_NONE; + getBusinessData(businessId).ownerId = -1; + + getBusinessData(businessId).needsSaved = true; + messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}removed business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}owner`); +} + +// =========================================================================== + function lockUnlockBusinessCommand(command, params, client) { let businessId = getPlayerBusiness(client); @@ -1060,12 +1081,12 @@ function buyBusinessCommand(command, params, client) { } if(getBusinessData(businessId).buyPrice <= 0) { - messagePlayerError(client, `Business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}is not for sale!`); + messagePlayerError(client, getLocaleString(client, "BusinessNotForSale")); return false; } if(getPlayerCurrentSubAccount(client).cash < getBusinessData(businessId).buyPrice) { - messagePlayerError(client, `You don't have enough money to buy business {businessBlue}${getBusinessData(businessId).name}!`); + messagePlayerError(client, getLocaleString(client, "BusinessPurchaseNotEnoughMoney")); return false; } @@ -1456,8 +1477,8 @@ function exitBusiness(client) { let businessId = getPlayerBusiness(client); if(isPlayerSpawned(client)) { setPlayerInterior(client, getServerData().businesses[businessId].entranceInterior); - setPlayerDimension(client, client, getServerData().businesses[businessId].entranceDimension); - setPlayerPosition(client, client, getServerData().businesses[businessId].entrancePosition); + setPlayerDimension(client, getServerData().businesses[businessId].entranceDimension); + setPlayerPosition(client, getServerData().businesses[businessId].entrancePosition); } }