Merge branch 'nightly' into ragemp
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -84,6 +84,15 @@ let profanityFilterEnabled = false;
|
||||
|
||||
let localLocaleId = 0;
|
||||
|
||||
/**
|
||||
* @typedef {Object} ServerData
|
||||
* @property {Array.<HouseData>} houses
|
||||
* @property {Array.<BusinessData>} businesses
|
||||
* @property {Array.<VehicleData>} vehicles
|
||||
* @property {Array} localeStrings
|
||||
* @property {Array} localeOptions
|
||||
* @property {Object} cvars
|
||||
*/
|
||||
let serverData = {
|
||||
houses: [],
|
||||
businesses: [],
|
||||
@@ -91,6 +100,7 @@ let serverData = {
|
||||
localeOptions: [],
|
||||
vehicles: [],
|
||||
jobs: [],
|
||||
cvars: {},
|
||||
};
|
||||
|
||||
let localPlayerMoney = 0;
|
||||
@@ -176,10 +176,10 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
|
||||
if (areServerElementsSupported()) {
|
||||
if (inVehicleSeat == 0) {
|
||||
//setVehicleEngine(vehicle.id, false);
|
||||
if (!inVehicle.engine) {
|
||||
parkedVehiclePosition = false;
|
||||
parkedVehicleHeading = false;
|
||||
}
|
||||
//if (!inVehicle.engine) {
|
||||
// parkedVehiclePosition = false;
|
||||
// parkedVehicleHeading = false;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||
//parkedVehiclePosition = inVehicle.position;
|
||||
//parkedVehicleHeading = inVehicle.heading;
|
||||
if (doesEntityDataExist(vehicle, "agrp.server") == true) {
|
||||
setVehicleEngine(vehicle.id, false);
|
||||
//setVehicleEngine(vehicle.id, false);
|
||||
setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine"));
|
||||
//setLocalPlayerControlState(false, false);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -464,4 +464,10 @@ function updatePlayerPing(playerName, ping) {
|
||||
playerPing[playerName] = ping;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function receiveClientVariablesFromServer(clientVariablesString) {
|
||||
serverData.cvars = JSON.parse(clientVariablesString);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -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")) {
|
||||
|
||||
@@ -224,13 +224,16 @@ function setLocalPlayerInterior(interior) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setSnowState(falling, ground) {
|
||||
function setSnowState(falling, ground, forceGround) {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting falling snow to ${falling} and ground snow to ${ground}`);
|
||||
snowing = falling;
|
||||
if (ground) {
|
||||
forceSnowing(false);
|
||||
forceSnowing(ground);
|
||||
}
|
||||
//snow.force = ground;
|
||||
//if (forceGround == true) {
|
||||
// forceSnowing(forceGround);
|
||||
// groundSnow.flush();
|
||||
//} else {
|
||||
// snow.enabled = ground;
|
||||
//}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -602,7 +605,7 @@ function updateLocalPlayerMoney() {
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||
natives.setMultiplayerHudCash(amount);
|
||||
natives.setMultiplayerHudCash(localPlayerMoney);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user