Fixes for new IV sync

This commit is contained in:
Vortrex
2022-11-07 13:35:49 -06:00
parent 01ba414e9c
commit 2aefa09340
8 changed files with 37 additions and 38 deletions

View File

@@ -38,7 +38,7 @@ function initBusinessScript() {
function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`);
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (getBusinessData(businessId) != false) {
let businessData = getBusinessData(businessId);
businessData.name = name;

View File

@@ -29,7 +29,7 @@ class HouseData {
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
logToConsole(LOG_DEBUG, `[AGRP.House] Received house ${houseId} (${name}) from server`);
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId);
houseData.description = description;

View File

@@ -140,7 +140,7 @@ function hideJobRouteLocation() {
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Received job ${jobId} (${name}) from server`);
if (getGame() == AGRP_GAME_GTA_IV) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) {
if (getJobData(jobId) != false) {
let jobData = getJobData(jobId);
jobData.jobLocationId = jobLocationId;

View File

@@ -47,15 +47,15 @@ function processSync(event, deltaTime) {
// ===========================================================================
function setVehicleLights(vehicleId, state) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (!state) {
natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
} else {
natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
}
} else {
getElementFromId(vehicleId).lights = state;
}
//if (getGame() == AGRP_GAME_GTA_IV) {
// if (!state) {
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
// } else {
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
// }
//} else {
getElementFromId(vehicleId).lights = state;
//}
}
// ===========================================================================
@@ -73,11 +73,12 @@ function syncVehicleProperties(vehicle) {
if (doesEntityDataExist(vehicle, "agrp.lights")) {
let lightStatus = getEntityData(vehicle, "agrp.lights");
if (!lightStatus) {
vehicle.lightStatus = 2;
} else {
vehicle.lightStatus = 1;
}
vehicle.lights = lightStatus;
}
if (doesEntityDataExist(vehicle, "agrp.locked")) {
let lockStatus = getEntityData(vehicle, "agrp.locked");
vehicle.locked = lockStatus;
}
if (doesEntityDataExist(vehicle, "agrp.invincible")) {