Fix add biz and get player biz funcs
This commit is contained in:
@@ -192,7 +192,7 @@ function createBusinessLocationCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, exitInteriorId = -1, exitVirtualWorld = -1, exitPickupModel = -1, exitBlipModel = -1, entranceCutscene = "") {
|
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInteriorId = 0, entranceVirtualWorld = 0, entranceCutscene = "", exitCutscene = "") {
|
||||||
let tempBusinessData = new BusinessData(false);
|
let tempBusinessData = new BusinessData(false);
|
||||||
tempBusinessData.name = name;
|
tempBusinessData.name = name;
|
||||||
|
|
||||||
@@ -206,10 +206,11 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
|
|||||||
|
|
||||||
tempBusinessData.exitPosition = exitPosition;
|
tempBusinessData.exitPosition = exitPosition;
|
||||||
tempBusinessData.exitRotation = 0.0;
|
tempBusinessData.exitRotation = 0.0;
|
||||||
tempBusinessData.exitPickupModel = exitPickupModel;
|
tempBusinessData.exitPickupModel = 0;
|
||||||
tempBusinessData.exitBlipModel = exitBlipModel;
|
tempBusinessData.exitBlipModel = -1;
|
||||||
tempBusinessData.exitInterior = exitInteriorId;
|
tempBusinessData.exitInterior = 0;
|
||||||
tempBusinessData.exitDimension = exitVirtualWorld;
|
tempBusinessData.exitDimension = 0;
|
||||||
|
tempBusinessData.exitCutscene = "";
|
||||||
|
|
||||||
return tempBusinessData;
|
return tempBusinessData;
|
||||||
}
|
}
|
||||||
@@ -840,7 +841,7 @@ function setBusinessInteriorTypeCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof getGameData().interiors[getGame()] == "undefined") {
|
if(typeof getGameConfig().interiors[getGame()] == "undefined") {
|
||||||
messagePlayerError(client, `There are no interiors available for this game!`);
|
messagePlayerError(client, `There are no interiors available for this game!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1513,17 +1514,23 @@ function isPlayerInAnyBusiness(client) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function getPlayerBusiness(client) {
|
function getPlayerBusiness(client) {
|
||||||
let closestEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
if(getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()]) {
|
||||||
if(getDistance(getPlayerPosition(client), getBusinessData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
|
let closestEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
return getBusinessData(closestEntrance).index;
|
if(getDistance(getPlayerPosition(client), getBusinessData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
}
|
return getBusinessData(closestEntrance).index;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let closestEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||||
|
if(getDistance(getPlayerPosition(client), getBusinessData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
|
||||||
|
return getBusinessData(closestEntrance).index;
|
||||||
|
}
|
||||||
|
|
||||||
for(let i in getServerData().businesses) {
|
for(let i in getServerData().businesses) {
|
||||||
if(getServerData().businesses[i].hasInterior && getServerData().businesses[i].exitDimension == getPlayerDimension(client)) {
|
if(getServerData().businesses[i].hasInterior && getServerData().businesses[i].exitDimension == getPlayerDimension(client)) {
|
||||||
return i;
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user