Show item list on empty buy command
This commit is contained in:
@@ -1155,13 +1155,15 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function buyFromBusinessCommand(command, params, client) {
|
function buyFromBusinessCommand(command, params, client) {
|
||||||
|
let businessId = getBusinessFromParams(isPlayerInAnyBusiness(client)) ? getPlayerBusiness(client) : getClosestBusinessEntrance(getPlayerPosition(client));
|
||||||
|
|
||||||
if(areParamsEmpty(params)) {
|
if(areParamsEmpty(params)) {
|
||||||
|
showBusinessFloorInventoryToPlayer(client, businessId);
|
||||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let splitParams = params.split(" ");
|
let splitParams = params.split(" ");
|
||||||
let businessId = getBusinessFromParams(splitParams[2]) || (isPlayerInAnyBusiness(client)) ? getPlayerBusiness(client) : getClosestBusinessEntrance(getPlayerPosition(client));
|
|
||||||
|
|
||||||
if(!getBusinessData(businessId)) {
|
if(!getBusinessData(businessId)) {
|
||||||
messagePlayerError(client, "Business not found!");
|
messagePlayerError(client, "Business not found!");
|
||||||
|
|||||||
Reference in New Issue
Block a user