Use new inHouse in player data
This commit is contained in:
@@ -404,8 +404,8 @@ function getClosestHouseEntrance(position) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function getPlayerHouse(client) {
|
function getPlayerHouse(client) {
|
||||||
if(doesEntityDataExist(client, "ag.inHouse")) {
|
if(getPlayerData(client).inHouse > 0) {
|
||||||
return getEntityData(client, "ag.inHouse");
|
return getPlayerData(client).inHouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -648,7 +648,11 @@ function getHouseInfoCommand(command, params, client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function isPlayerInAnyHouse(client) {
|
function isPlayerInAnyHouse(client) {
|
||||||
return doesEntityDataExist(client, "ag.inHouse");
|
if(getPlayerData(client).inHouse > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -739,7 +743,7 @@ function exitHouse(client) {
|
|||||||
setPlayerDimension(client, getServerData().house[houseId].entranceDimension);
|
setPlayerDimension(client, getServerData().house[houseId].entranceDimension);
|
||||||
setPlayerPosition(client, getServerData().house[houseId].entrancePosition);
|
setPlayerPosition(client, getServerData().house[houseId].entrancePosition);
|
||||||
}
|
}
|
||||||
removeEntityData(client, "ag.inHouse");
|
getPlayerData(client).inHouse = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -770,4 +774,16 @@ function cacheHouseItems(houseId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getHouseIdFromDatabaseId(databaseId) {
|
||||||
|
for(let i in getServerData().houses) {
|
||||||
|
if(getHouseData(i).databaseId == databaseId) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user