Send deleted house

This commit is contained in:
Vortrex
2023-02-15 03:16:18 -06:00
parent a098fec203
commit 350a42eef5

View File

@@ -25,10 +25,19 @@ class HouseData {
// =========================================================================== // ===========================================================================
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { function receiveHouseFromServer(houseId, isDeleted, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
logToConsole(LOG_DEBUG, `[V.RP.House] Received house ${houseId} (${name}) from server`); logToConsole(LOG_DEBUG, `[V.RP.House] Received house ${houseId} (${name}) from server`);
if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
if (isDeleted == true) {
if (getGame() == V_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
}
getServerData().houses.splice(houseId, 1);
return false;
}
if (getHouseData(houseId) != false) { if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
houseData.description = description; houseData.description = description;
@@ -46,7 +55,11 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
if (houseData.rentPrice > 0) { if (houseData.rentPrice > 0) {
houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE; houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE;
} else { } else {
houseData.labelInfoType = V_PROPLABEL_INFO_ENTER; if (houseData.hasInterior) {
houseData.labelInfoType = V_PROPLABEL_INFO_ENTER;
} else {
houseData.labelInfoType = V_PROPLABEL_INFO_NONE;
}
} }
} }
@@ -125,3 +138,9 @@ function setAllHouseDataIndexes() {
} }
// =========================================================================== // ===========================================================================
function removeHousesFromClient() {
getServerData().houses.splice(0);
}
// ===========================================================================