Change prefix of consts

This commit is contained in:
Vortrex
2022-07-02 23:38:31 -05:00
parent c5cef51655
commit df949a35f7
23 changed files with 719 additions and 719 deletions

View File

@@ -217,7 +217,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
if (characterSelect.skinImage != null) {
characterSelect.skinImage.remove();
}
characterSelect.skinImage = (getGame() == VRR_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.skinImage = (getGame() == AGRP_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.window.shown = true;

View File

@@ -78,7 +78,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
return false;
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
return false;
@@ -93,7 +93,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight;
let screenPosition = new Vec3(0.0, 0.0, 0.0);
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
} else {
screenPosition = getScreenFromWorldPosition(tempPosition);
@@ -127,10 +127,10 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked"));
}
if (!locked && labelInfoType != VRR_PROPLABEL_INFO_NONE) {
if (!locked && labelInfoType != AGRP_PROPLABEL_INFO_NONE) {
let infoText = "";
switch (labelInfoType) {
case VRR_PROPLABEL_INFO_ENTER: {
case AGRP_PROPLABEL_INFO_ENTER: {
if (enterPropertyKey) {
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
} else {
@@ -139,27 +139,27 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
break;
}
case VRR_PROPLABEL_INFO_BUY: {
case AGRP_PROPLABEL_INFO_BUY: {
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
break;
}
case VRR_PROPLABEL_INFO_BUYBIZ: {
case AGRP_PROPLABEL_INFO_BUYBIZ: {
infoText = getLocaleString("BuyBusinessLabel", "/bizbuy");
break;
}
case VRR_PROPLABEL_INFO_BUYHOUSE: {
case AGRP_PROPLABEL_INFO_BUYHOUSE: {
infoText = getLocaleString("BuyHouseLabel", "/housebuy");
break;
}
case VRR_PROPLABEL_INFO_RENTHOUSE: {
case AGRP_PROPLABEL_INFO_RENTHOUSE: {
infoText = getLocaleString("RentHouseLabel", "/houserent");
break;
}
case VRR_PROPLABEL_INFO_ENTERVEHICLE: {
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: {
infoText = getLocaleString("VehicleDealershipLabel");
break;
}
@@ -205,7 +205,7 @@ function renderPropertyExitLabel(position) {
return false;
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
return false;
@@ -220,7 +220,7 @@ function renderPropertyExitLabel(position) {
let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight;
let screenPosition = new Vec3(0.0, 0.0, 0.0);
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
} else {
screenPosition = getScreenFromWorldPosition(tempPosition);
@@ -250,7 +250,7 @@ function renderJobLabel(name, position, jobType) {
return false;
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[VRR.Label]: Game viewport does not exist!");
return false;
@@ -265,7 +265,7 @@ function renderJobLabel(name, position, jobType) {
let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight;
let screenPosition = new Vec3(0.0, 0.0, 0.0);
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
} else {
screenPosition = getScreenFromWorldPosition(tempPosition);
@@ -338,7 +338,7 @@ function processLabelRendering() {
if (!pickups[i].isOnScreen) {
let price = "0";
let rentPrice = "0";
let labelInfoType = VRR_PROPLABEL_INFO_NONE;
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
if (pickups[i].getData("agrp.label.price") != null) {
price = makeLargeNumberReadable(pickups[i].getData("agrp.label.price"));
}
@@ -352,22 +352,22 @@ function processLabelRendering() {
}
switch (pickups[i].getData("agrp.label.type")) {
case VRR_LABEL_BUSINESS: {
case AGRP_LABEL_BUSINESS: {
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType);
break;
}
case VRR_LABEL_HOUSE: {
case AGRP_LABEL_HOUSE: {
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), false, price, rentPrice, labelInfoType);
break;
}
case VRR_LABEL_JOB: {
case AGRP_LABEL_JOB: {
renderJobLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.jobType"));
break;
}
case VRR_LABEL_EXIT: {
case AGRP_LABEL_EXIT: {
renderPropertyExitLabel(pickups[i].position);
break;
}

View File

@@ -37,7 +37,7 @@ function getPlayerPosition() {
// ===========================================================================
function setPlayerPosition(position) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.setCharCoordinates(localPlayer, position);
} else {
localPlayer.position = position;
@@ -187,7 +187,7 @@ function getVehiclesInRange(position, range) {
// ===========================================================================
function createGameBlip(blipModel, position, name = "") {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
let blipId = natives.addBlipForCoord(position);
if (blipId) {
natives.changeBlipSprite(blipId, blipModel);
@@ -266,7 +266,7 @@ function syncVehicleProperties(vehicle) {
vehicle.setSuspensionHeight(suspensionHeight);
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
for (let i in allUpgrades) {
vehicle.removeUpgrade(i);
@@ -282,12 +282,12 @@ function syncVehicleProperties(vehicle) {
}
}
if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(vehicle, "agrp.livery")) {
let livery = getEntityData(vehicle, "agrp.livery");
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
vehicle.setPaintJob(livery);
} else if (getGame() == VRR_GAME_GTA_IV) {
} else if (getGame() == AGRP_GAME_GTA_IV) {
vehicle.livery = livery;
}
}
@@ -315,7 +315,7 @@ function doesEntityDataExist(entity, dataName) {
// ===========================================================================
function syncCivilianProperties(civilian) {
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.scale")) {
let scaleFactor = getEntityData(civilian, "agrp.scale");
let tempMatrix = civilian.matrix;
@@ -327,21 +327,21 @@ function syncCivilianProperties(civilian) {
}
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
let fightStyle = getEntityData(civilian, "agrp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
}
}
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
civilian.walkStyle = walkStyle;
}
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
@@ -413,7 +413,7 @@ function preventDefaultEventAction(event) {
// ===========================================================================
function syncPlayerProperties(player) {
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(player, "agrp.scale")) {
let scaleFactor = getEntityData(player, "agrp.scale");
let tempMatrix = player.matrix;
@@ -425,21 +425,21 @@ function syncPlayerProperties(player) {
}
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
if (doesEntityDataExist(player, "agrp.fightStyle")) {
let fightStyle = getEntityData(player, "agrp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]);
}
}
//if(getGame() == VRR_GAME_GTA_SA) {
//if(getGame() == AGRP_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "agrp.walkStyle")) {
// let walkStyle = getEntityData(player, "agrp.walkStyle");
// player.walkStyle = walkStyle;
// }
//}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
@@ -461,7 +461,7 @@ function syncPlayerProperties(player) {
}
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
@@ -522,7 +522,7 @@ function syncPlayerProperties(player) {
// ===========================================================================
function syncObjectProperties(object) {
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
if (doesEntityDataExist(object, "agrp.scale")) {
let scaleFactor = getEntityData(object, "agrp.scale");
let tempMatrix = object.matrix;
@@ -626,21 +626,21 @@ function getScreenHeight() {
function openAllGarages() {
switch (getGame()) {
case VRR_GAME_GTA_III:
case AGRP_GAME_GTA_III:
for (let i = 0; i <= 26; i++) {
openGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
}
break;
case VRR_GAME_GTA_VC:
case AGRP_GAME_GTA_VC:
for (let i = 0; i <= 32; i++) {
openGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
}
break;
case VRR_GAME_GTA_SA:
case AGRP_GAME_GTA_SA:
for (let i = 0; i <= 44; i++) {
openGarage(i);
}
@@ -655,21 +655,21 @@ function openAllGarages() {
function closeAllGarages() {
switch (getGame()) {
case VRR_GAME_GTA_III:
case AGRP_GAME_GTA_III:
for (let i = 0; i <= 26; i++) {
closeGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
}
break;
case VRR_GAME_GTA_VC:
case AGRP_GAME_GTA_VC:
for (let i = 0; i <= 32; i++) {
closeGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
}
break;
case VRR_GAME_GTA_SA:
case AGRP_GAME_GTA_SA:
for (let i = 0; i <= 44; i++) {
closeGarage(i);
}
@@ -689,7 +689,7 @@ function setPedInvincible(ped, state) {
// ===========================================================================
function setPedLookAt(ped, position) {
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
ped.lookAt(position, 10000);
return true;
} else {

View File

@@ -180,7 +180,7 @@ function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardS
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
renderHUD = hudState;
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.displayCash(hudState);
natives.displayAmmo(hudState);
natives.displayHud(hudState);
@@ -326,7 +326,7 @@ function setLogLevel(level) {
function setLocalPlayerInfiniteRun(state) {
if (localPlayer != null) {
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
}
}
@@ -336,7 +336,7 @@ function setLocalPlayerInfiniteRun(state) {
function setLocalPlayerSkin(skinId) {
logToConsole(LOG_INFO, `[VRR.Server] Setting locale player skin to ${skinId}`);
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.changePlayerModel(natives.getPlayerId(), skinId);
} else {
localPlayer.skin = skinId;
@@ -346,7 +346,7 @@ function setLocalPlayerSkin(skinId) {
// ===========================================================================
function makePedHoldObject(pedId, modelIndex) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
}
}
@@ -360,7 +360,7 @@ function sendLocalPlayerNetworkIdToServer() {
// ===========================================================================
function setCutsceneInterior(cutsceneName) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (cutsceneName == "") {
natives.clearCutscene();
} else {
@@ -375,7 +375,7 @@ function setCutsceneInterior(cutsceneName) {
// ===========================================================================
function makeLocalPlayerPedSpeak(speechName) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
// if player is in vehicle, allow megaphone (if last arg is "1", it will cancel megaphone echo)
// Only speeches with _MEGAPHONE will have the bullhorn effect
// Afaik it only works on police voices anyway
@@ -384,7 +384,7 @@ function makeLocalPlayerPedSpeak(speechName) {
} else {
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1);
}
} else if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
} else if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
// Don't have a way to get the ped ref ID and can't use ped in arg
//game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int);
}
@@ -393,7 +393,7 @@ function makeLocalPlayerPedSpeak(speechName) {
// ===========================================================================
function setLocalPlayerAsCopState(state) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.setPlayerAsCop(natives.getPlayerId(), state);
natives.setPoliceIgnorePlayer(natives.getPlayerId(), state);
}
@@ -402,7 +402,7 @@ function setLocalPlayerAsCopState(state) {
// ===========================================================================
function serverRequestedLocalPlayerSpawn(skinId, position) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.createPlayer(skinId, position);
//if(isCustomCameraSupported()) {
// game.restoreCamera(true);

View File

@@ -53,7 +53,7 @@ function processSkinSelectKeyPress(keyCode) {
}
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0];
if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId);
@@ -73,7 +73,7 @@ function processSkinSelectKeyPress(keyCode) {
}
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0];
if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId);
@@ -131,7 +131,7 @@ function toggleSkinSelect(state) {
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0];
if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId);

View File

@@ -53,13 +53,13 @@ function setVehicleEngine(vehicleId, state) {
// ===========================================================================
function setVehicleLights(vehicleId, state) {
if (getGame() != VRR_GAME_MAFIA_ONE) {
if (getGame() != AGRP_GAME_MAFIA_ONE) {
if (!state) {
getElementFromId(vehicleId).lightStatus = 2;
} else {
getElementFromId(vehicleId).lightStatus = 1;
}
} else if (getGame() == VRR_GAME_GTA_IV) {
} else if (getGame() == AGRP_GAME_GTA_IV) {
if (!state) {
natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
} else {
@@ -127,7 +127,7 @@ function syncVehicleProperties(vehicle) {
vehicle.setSuspensionHeight(suspensionHeight);
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
//for(let i in allUpgrades) {
// vehicle.removeUpgrade(i);
@@ -143,12 +143,12 @@ function syncVehicleProperties(vehicle) {
}
}
if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(vehicle, "agrp.livery")) {
let livery = getEntityData(vehicle, "agrp.livery");
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
vehicle.setPaintJob(livery);
} else if (getGame() == VRR_GAME_GTA_IV) {
} else if (getGame() == AGRP_GAME_GTA_IV) {
vehicle.livery = livery;
}
}
@@ -162,7 +162,7 @@ function syncCivilianProperties(civilian) {
return false;
}
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.scale")) {
let scaleFactor = getEntityData(civilian, "agrp.scale");
let tempMatrix = civilian.matrix;
@@ -174,21 +174,21 @@ function syncCivilianProperties(civilian) {
}
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
let fightStyle = getEntityData(civilian, "agrp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
}
}
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
civilian.walkStyle = walkStyle;
}
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
@@ -259,7 +259,7 @@ function syncPlayerProperties(player) {
return false;
}
if (getGame() == VRR_GAME_GTA_III) {
if (getGame() == AGRP_GAME_GTA_III) {
if (doesEntityDataExist(player, "agrp.scale")) {
let scaleFactor = getEntityData(player, "agrp.scale");
let tempMatrix = player.matrix;
@@ -271,21 +271,21 @@ function syncPlayerProperties(player) {
}
}
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
if (doesEntityDataExist(player, "agrp.fightStyle")) {
let fightStyle = getEntityData(player, "agrp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]);
}
}
//if(getGame() == VRR_GAME_GTA_SA) {
//if(getGame() == AGRP_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "agrp.walkStyle")) {
// let walkStyle = getEntityData(player, "agrp.walkStyle");
// player.walkStyle = walkStyle;
// }
//}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
@@ -307,7 +307,7 @@ function syncPlayerProperties(player) {
}
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
@@ -378,7 +378,7 @@ function syncElementProperties(element) {
}
}
if (getGame() == VRR_GAME_MAFIA_ONE) {
if (getGame() == AGRP_GAME_MAFIA_ONE) {
switch (element.type) {
case ELEMENT_VEHICLE:
syncVehicleProperties(element);
@@ -419,7 +419,7 @@ function syncElementProperties(element) {
// ===========================================================================
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
}
}

View File

@@ -17,9 +17,9 @@ function setLocalPlayerFrozenState(state) {
function setLocalPlayerControlState(controlState, cursorState = false) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
controlsEnabled = controlState;
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) {
game.SET_PLAYER_CONTROL(game.GET_PLAYER_ID(), boolToInt(controlState));
} else if (getGame() != VRR_GAME_GTA_IV) {
} else if (getGame() != AGRP_GAME_GTA_IV) {
setElementCollisionsEnabled(localPlayer, controlState);
setPedInvincible(localPlayer, true);
}
@@ -75,9 +75,9 @@ function setCityAmbienceState(state, clearElements = false) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
game.setTrafficEnabled(state);
if (getMultiplayerMod() == VRR_MPMOD_GTAC) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
game.setGenerateCarsAroundCamera(state);
if (getGame() != VRR_GAME_GTA_SA) {
if (getGame() != AGRP_GAME_GTA_SA) {
game.setCiviliansEnabled(state);
}
@@ -112,7 +112,7 @@ function runClientCode(code, returnTo) {
function enterVehicleAsPassenger() {
if (localPlayer.vehicle == null) {
let tempVehicle = getClosestVehicle(localPlayer.position);
if (getGame() != VRR_GAME_GTA_IV) {
if (getGame() != AGRP_GAME_GTA_IV) {
if (tempVehicle != null) {
localPlayer.enterVehicle(tempVehicle, false);
}
@@ -134,13 +134,13 @@ function enterVehicleAsPassenger() {
function giveLocalPlayerWeapon(weaponId, ammo, active) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
forceWeapon = weaponId;
if (getGame() == VRR_GAME_MAFIA_ONE) {
if (getGame() == AGRP_GAME_MAFIA_ONE) {
localPlayer.giveWeapon(weaponId, 0, ammo);
forceWeaponAmmo = 0;
forceWeaponClipAmmo = ammo;
} else {
localPlayer.giveWeapon(weaponId, ammo, active);
if (getGame() < VRR_GAME_GTA_IV) {
if (getGame() < AGRP_GAME_GTA_IV) {
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
} else {
@@ -194,7 +194,7 @@ function setLocalPlayerHeading(heading) {
function setLocalPlayerInterior(interior) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting interior to ${interior}`);
if (getMultiplayerMod() == VRR_MPMOD_GTAC) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if (!isGTAIV()) {
localPlayer.interior = interior;
game.cameraInterior = interior;
@@ -240,7 +240,7 @@ function setLocalPlayerHealth(health) {
function playPedSpeech(pedName, speechId) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Making ${pedName}'s ped talk (${speechId})`);
if (getMultiplayerMod() == VRR_MPMOD_GTAC) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
game.SET_CHAR_SAY(int, int);
}
}
@@ -261,7 +261,7 @@ function getWeaponSlot(weaponId) {
// ===========================================================================
function setLocalPlayerDrunkEffect(amount, duration) {
if (getMultiplayerMod() == VRR_MPMOD_GTAC) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
drunkEffectAmount = 0;
drunkEffectDurationTimer = setInterval(function () {
@@ -353,7 +353,7 @@ function setLocalPlayerCash(amount) {
localPlayer.money = toInteger(amount);
}
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
natives.setMultiplayerHudCash(amount);
}
}
@@ -452,7 +452,7 @@ function processLocalPlayerSphereEntryExitHandling() {
// ===========================================================================
function processJobRouteSphere() {
if (getGame() == VRR_GAME_GTA_SA) {
if (getGame() == AGRP_GAME_GTA_SA) {
let position = getLocalPlayerPosition();
if (jobRouteLocationSphere != null) {
if (getDistance(position, jobRouteLocationSphere.position) <= 2.0) {
@@ -469,12 +469,12 @@ function forceLocalPlayerEquippedWeaponItem() {
if (forceWeapon != 0) {
if (localPlayer.weapon != forceWeapon) {
localPlayer.weapon = forceWeapon;
if (getGame() < VRR_GAME_GTA_IV) {
if (getGame() < AGRP_GAME_GTA_IV) {
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
}
} else {
//if(getGame() < VRR_GAME_GTA_IV) {
//if(getGame() < AGRP_GAME_GTA_IV) {
// forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
// forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
//}
@@ -519,7 +519,7 @@ function processLocalPlayerVehicleEntryExitHandling() {
// ===========================================================================
function getVehicleForNetworkEvent(vehicle) {
if (getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
return natives.getNetworkIdFromVehicle(vehicle);
}
return vehicle.id;
@@ -602,7 +602,7 @@ function processNearbyPickups() {
// ===========================================================================
function processGameSpecifics() {
if (getGame() < VRR_GAME_GTA_IV) {
if (getGame() < AGRP_GAME_GTA_IV) {
game.clearMessages();
}

View File

@@ -32,7 +32,7 @@ class VehicleData {
function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, colour3 = 0, colour4 = 0, locked = false, lights = false, engine = false, licensePlate = "") {
logToConsole(LOG_DEBUG, `[VRR.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
if (getGame() != VRR_GAME_GTA_IV) {
if (getGame() != AGRP_GAME_GTA_IV) {
return false;
}
@@ -63,20 +63,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
// ===========================================================================
function processVehiclePurchasing() {
if (vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
if (vehiclePurchaseState == AGRP_VEHBUYSTATE_TESTDRIVE) {
if (getLocalPlayerVehicle() == false) {
vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
vehiclePurchaseState = AGRP_VEHBUYSTATE_EXITVEH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_EXITVEH);
return false;
} else {
if (vehiclePurchasing == getLocalPlayerVehicle()) {
if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
vehiclePurchaseState = AGRP_VEHBUYSTATE_FARENOUGH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_FARENOUGH);
}
} else {
vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH;
sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH);
vehiclePurchaseState = AGRP_VEHBUYSTATE_WRONGVEH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_WRONGVEH);
}
}
}