From df949a35f7b5ed8469dd9ca93852a473e1d1ac8c Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 2 Jul 2022 23:38:31 -0500 Subject: [PATCH] Change prefix of consts --- scripts/client/gui/charselect.js | 2 +- scripts/client/label.js | 36 +-- scripts/client/native/connected.js | 46 ++-- scripts/client/netevents.js | 18 +- scripts/client/skin-select.js | 6 +- scripts/client/sync.js | 34 +-- scripts/client/utilities.js | 32 +-- scripts/client/vehicle.js | 16 +- scripts/server/account.js | 60 ++--- scripts/server/animation.js | 8 +- scripts/server/bank.js | 14 +- scripts/server/business.js | 160 ++++++------ scripts/server/event.js | 34 +-- scripts/server/gui.js | 50 ++-- scripts/server/house.js | 90 +++---- scripts/server/item.js | 404 ++++++++++++++--------------- scripts/server/job.js | 114 ++++---- scripts/server/misc.js | 82 +++--- scripts/server/native/connected.js | 24 +- scripts/server/native/ragemp.js | 10 +- scripts/server/netevents.js | 14 +- scripts/server/npc.js | 48 ++-- scripts/server/vehicle.js | 136 +++++----- 23 files changed, 719 insertions(+), 719 deletions(-) diff --git a/scripts/client/gui/charselect.js b/scripts/client/gui/charselect.js index 46e16e7d..f2068da7 100644 --- a/scripts/client/gui/charselect.js +++ b/scripts/client/gui/charselect.js @@ -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; diff --git a/scripts/client/label.js b/scripts/client/label.js index 6c665b32..9259bca6 100644 --- a/scripts/client/label.js +++ b/scripts/client/label.js @@ -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; } diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index 4788f0b2..60bd2dc6 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -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 { diff --git a/scripts/client/netevents.js b/scripts/client/netevents.js index 6e9292dd..b1011fc1 100644 --- a/scripts/client/netevents.js +++ b/scripts/client/netevents.js @@ -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); diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index a84f73a0..3ddb9923 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -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); diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 86d46bf3..9c7dd501 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -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) { } } diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index af7f5043..e73174a6 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -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(); } diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js index 40eba8c9..60260eb2 100644 --- a/scripts/client/vehicle.js +++ b/scripts/client/vehicle.js @@ -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); } } } diff --git a/scripts/server/account.js b/scripts/server/account.js index 0f0e3ec1..07907d16 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -8,35 +8,35 @@ // =========================================================================== // Account Contact Types -const VRR_CONTACT_NONE = 0; -const VRR_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features -const VRR_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online. -const VRR_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP +const AGRP_CONTACT_NONE = 0; +const AGRP_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features +const AGRP_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online. +const AGRP_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP // =========================================================================== // Account Authentication Methods -const VRR_ACCT_AUTHMETHOD_NONE = 0; // None -const VRR_ACCT_AUTHMETHOD_EMAIL = 1; // Email -const VRR_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number -const VRR_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc) -const VRR_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use) -const VRR_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created) +const AGRP_ACCT_AUTHMETHOD_NONE = 0; // None +const AGRP_ACCT_AUTHMETHOD_EMAIL = 1; // Email +const AGRP_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number +const AGRP_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc) +const AGRP_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use) +const AGRP_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created) // =========================================================================== // Two-Factor Authentication States -const VRR_2FA_STATE_NONE = 0; // None -const VRR_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play -const VRR_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app -const VRR_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up +const AGRP_2FA_STATE_NONE = 0; // None +const AGRP_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play +const AGRP_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app +const AGRP_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up // =========================================================================== // Reset Password States -const VRR_RESETPASS_STATE_NONE = 0; // None -const VRR_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email -const VRR_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password +const AGRP_RESETPASS_STATE_NONE = 0; // None +const AGRP_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email +const AGRP_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password // =========================================================================== @@ -811,7 +811,7 @@ function loginSuccess(client) { if (getPlayerData(client).subAccounts.length == 0) { if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR; + getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR; logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`); } else { messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`)); @@ -1209,7 +1209,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { showPlayerRegistrationSuccessGUI(client); showPlayerPrompt(client, getLocaleString(client, "NoCharactersMessage"), getLocaleString(client, "NoCharactersWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_CREATEFIRSTCHAR; + getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR; } else { messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage"), `{ALTCOLOUR}/newchar{MAINCOLOUR}`); } @@ -1224,7 +1224,7 @@ function checkAccountResetPasswordRequest(client, inputText) { } switch (getPlayerData(client).passwordResetState) { - case VRR_RESETPASS_STATE_EMAILCONFIRM: { + case AGRP_RESETPASS_STATE_EMAILCONFIRM: { if (toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) { logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`); showPlayerErrorGUI(client, getLocaleString(client, "GUIErrorResetPasswordFailedInvalidEmail"), getLocaleString(client, "GUIErrorTitle"), getLocaleString(client, "GUIOkButton")); @@ -1232,7 +1232,7 @@ function checkAccountResetPasswordRequest(client, inputText) { } let passwordResetCode = toUpperCase(generateEmailVerificationCode()); - getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_CODEINPUT; + getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_CODEINPUT; getPlayerData(client).passwordResetCode = passwordResetCode; showPlayerResetPasswordCodeInputGUI(client); sendPasswordResetEmail(client, passwordResetCode); @@ -1240,11 +1240,11 @@ function checkAccountResetPasswordRequest(client, inputText) { break; } - case VRR_RESETPASS_STATE_CODEINPUT: { + case AGRP_RESETPASS_STATE_CODEINPUT: { logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} submitted code for password reset (${inputText}) ...`); if (inputText != "") { if (getPlayerData(client).passwordResetCode == toUpperCase(inputText)) { - getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_SETPASS; + getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_SETPASS; showPlayerChangePasswordGUI(client); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`); } else { @@ -1261,10 +1261,10 @@ function checkAccountResetPasswordRequest(client, inputText) { break; } - case VRR_RESETPASS_STATE_NONE: { + case AGRP_RESETPASS_STATE_NONE: { logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`); showPlayerResetPasswordEmailInputGUI(client); - getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_EMAILCONFIRM; + getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_EMAILCONFIRM; break; } } @@ -1276,8 +1276,8 @@ function checkAccountResetPasswordRequest(client, inputText) { function checkAccountChangePassword(client, newPassword, confirmNewPassword) { if (!isPlayerLoggedIn(client)) { - if (getPlayerData(client).passwordResetState != VRR_RESETPASS_STATE_SETPASS) { - //getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_NONE; + if (getPlayerData(client).passwordResetState != AGRP_RESETPASS_STATE_SETPASS) { + //getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; //disconnectPlayer(client); logToConsole(LOG_DEBUG | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to change their password (not logged in or not using reset password)`); return false; @@ -1313,8 +1313,8 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) { saveAccountToDatabase(getPlayerData(client).accountData); - if (getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_SETPASS) { - getPlayerData(client).passwordResetState = VRR_RESETPASS_STATE_NONE; + if (getPlayerData(client).passwordResetState == AGRP_RESETPASS_STATE_SETPASS) { + getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; } messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged")); @@ -1355,7 +1355,7 @@ function savePlayerToDatabase(client) { //let subAccountData = getPlayerCurrentSubAccount(client); if (getPlayerPed(client) != null) { - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != VRR_RETURNTO_TYPE_ADMINGET) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != AGRP_RETURNTO_TYPE_ADMINGET) { getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition; getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z; getPlayerCurrentSubAccount(client).interior = getPlayerData(client).returnToInterior; diff --git a/scripts/server/animation.js b/scripts/server/animation.js index c7512a78..399a7a6a 100644 --- a/scripts/server/animation.js +++ b/scripts/server/animation.js @@ -34,8 +34,8 @@ function playPlayerAnimationCommand(command, params, client) { return false; } - if (getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) { - getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP; + if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) { + getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP; } if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) { @@ -98,8 +98,8 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) { makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition); setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true); - //if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) { - // if(getGame() < VRR_GAME_GTA_SA) { + //if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) { + // if(getGame() < AGRP_GAME_GTA_SA) { // setPlayerMouseCameraState(client, true); // } //} diff --git a/scripts/server/bank.js b/scripts/server/bank.js index 2f2a7d48..6bb70bf0 100644 --- a/scripts/server/bank.js +++ b/scripts/server/bank.js @@ -8,13 +8,13 @@ // =========================================================================== // House Owner Types -const VRR_BANK_ACCT_OWNER_NONE = 0; // Not owned -const VRR_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) -const VRR_BANK_ACCT_OWNER_JOB = 2; // Owned by a job -const VRR_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan -const VRR_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction -const VRR_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction -const VRR_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used. +const AGRP_BANK_ACCT_OWNER_NONE = 0; // Not owned +const AGRP_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) +const AGRP_BANK_ACCT_OWNER_JOB = 2; // Owned by a job +const AGRP_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan +const AGRP_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction +const AGRP_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction +const AGRP_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used. // =========================================================================== diff --git a/scripts/server/business.js b/scripts/server/business.js index ce3009aa..7155a2e9 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -8,33 +8,33 @@ // =========================================================================== // Business Types -const VRR_BIZ_TYPE_NONE = 0; // None (invalid) -const VRR_BIZ_TYPE_NORMAL = 1; // Normal business (sells items) -const VRR_BIZ_TYPE_BANK = 2; // Bank -const VRR_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc) -const VRR_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter +const AGRP_BIZ_TYPE_NONE = 0; // None (invalid) +const AGRP_BIZ_TYPE_NORMAL = 1; // Normal business (sells items) +const AGRP_BIZ_TYPE_BANK = 2; // Bank +const AGRP_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc) +const AGRP_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter // =========================================================================== // Business Location Types -const VRR_BIZ_LOC_NONE = 0; // None -const VRR_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz -const VRR_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped -const VRR_BIZ_LOC_FUEL = 3; // Fuel pump -const VRR_BIZ_LOC_DRIVETHRU = 4; // Drivethrough -const VRR_BIZ_LOC_VENDMACHINE = 5; // Vending machine -const VRR_BIZ_LOC_ATM = 6; // ATM -const VRR_BIZ_LOC_PAYPHONE = 7; // Payphone +const AGRP_BIZ_LOC_NONE = 0; // None +const AGRP_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz +const AGRP_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped +const AGRP_BIZ_LOC_FUEL = 3; // Fuel pump +const AGRP_BIZ_LOC_DRIVETHRU = 4; // Drivethrough +const AGRP_BIZ_LOC_VENDMACHINE = 5; // Vending machine +const AGRP_BIZ_LOC_ATM = 6; // ATM +const AGRP_BIZ_LOC_PAYPHONE = 7; // Payphone // =========================================================================== // Business Owner Types -const VRR_BIZ_OWNER_NONE = 0; // Not owned -const VRR_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) -const VRR_BIZ_OWNER_JOB = 2; // Owned by a job -const VRR_BIZ_OWNER_CLAN = 3; // Owned by a clan -const VRR_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) -const VRR_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc +const AGRP_BIZ_OWNER_NONE = 0; // Not owned +const AGRP_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const AGRP_BIZ_OWNER_JOB = 2; // Owned by a job +const AGRP_BIZ_OWNER_CLAN = 3; // Owned by a clan +const AGRP_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const AGRP_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc // =========================================================================== @@ -48,7 +48,7 @@ class BusinessData { constructor(dbAssoc = false) { this.databaseId = 0; this.name = ""; - this.ownerType = VRR_BIZ_OWNER_NONE; + this.ownerType = AGRP_BIZ_OWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.locked = false; @@ -56,7 +56,7 @@ class BusinessData { this.index = -1; this.needsSaved = false; this.interiorLights = true; - this.type = VRR_BIZ_TYPE_NONE; + this.type = AGRP_BIZ_TYPE_NONE; this.floorItemCache = []; this.storageItemCache = []; @@ -87,7 +87,7 @@ class BusinessData { this.streamingRadioStation = 0; //this.streamingRadioStationIndex = -1; - this.labelHelpType = VRR_PROPLABEL_INFO_NONE; + this.labelHelpType = AGRP_PROPLABEL_INFO_NONE; if (dbAssoc) { this.databaseId = toInteger(dbAssoc["biz_id"]); @@ -495,7 +495,7 @@ function setBusinessOwnerCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PLAYER; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId; getBusinessData(businessId).needsSaved = true; @@ -537,7 +537,7 @@ function setBusinessJobCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_JOB; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).needsSaved = true; @@ -570,7 +570,7 @@ function setBusinessClanCommand(command, params, client) { return false; } - if (getBusinessData(business).ownerType != VRR_VEHOWNER_PLAYER) { + if (getBusinessData(business).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnBusiness")); return false; } @@ -581,9 +581,9 @@ function setBusinessClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_BIZGIVETOCLAN; + getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN; - //getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_CLAN; + //getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN; //getBusinessData(businessId).ownerId = getClanData(clanId).databaseId; //getBusinessData(businessId).needsSaved = true; } @@ -614,7 +614,7 @@ function setBusinessRankCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_CLAN) { + if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { let clanId = getClanIdFromDatabaseId(getBusinessData(businessId).ownerId); rankId = getClanRankFromParams(clanId, params); if (!getClanRankData(clanId, rankId)) { @@ -623,7 +623,7 @@ function setBusinessRankCommand(command, params, client) { } getBusinessData(businessId).rank = getClanRankData(clanId, rankId).databaseId; messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); - } else if (getBusinessData(businessId).ownerType == VRR_VEHOWNER_JOB) { + } else if (getBusinessData(businessId).ownerType == AGRP_VEHOWNER_JOB) { getBusinessData(businessId).rank = rankId; messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getBusinessData(businessId).ownerId)).name} {MAINCOLOUR}job!`); } @@ -720,7 +720,7 @@ function setBusinessJobCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_JOB; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).needsSaved = true; @@ -750,7 +750,7 @@ function setBusinessPublicCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PUBLIC; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PUBLIC; getBusinessData(businessId).ownerId = 0; getBusinessData(businessId).needsSaved = true; @@ -780,7 +780,7 @@ function removeBusinessOwnerCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_NONE; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_NONE; getBusinessData(businessId).ownerId = -1; getBusinessData(businessId).needsSaved = true; @@ -872,7 +872,7 @@ function setBusinessPaintBallCommand(command, params, client) { return false; } - getBusinessData(businessId).entranceType = VRR_BIZ_ENTRANCE_TYPE_PAINTBALL; + getBusinessData(businessId).entranceType = AGRP_BIZ_ENTRANCE_TYPE_PAINTBALL; getBusinessData(businessId).needsSaved = true; messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall")); } @@ -904,24 +904,24 @@ function getBusinessInfoCommand(command, params, client) { let ownerName = "Unknown"; switch (businessData.ownerType) { - case VRR_BIZ_OWNER_CLAN: + case AGRP_BIZ_OWNER_CLAN: ownerName = getClanData(businessData.ownerId).name; break; - case VRR_BIZ_OWNER_JOB: + case AGRP_BIZ_OWNER_JOB: ownerName = getJobData(businessData.ownerId).name; break; - case VRR_BIZ_OWNER_PLAYER: + case AGRP_BIZ_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(businessData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; break; - case VRR_BIZ_OWNER_PUBLIC: + case AGRP_BIZ_OWNER_PUBLIC: ownerName = "Public"; break; - case VRR_BIZ_OWNER_NONE: + case AGRP_BIZ_OWNER_NONE: //submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`); ownerName = "None"; break; @@ -1274,7 +1274,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) { let itemTypeId = getItemTypeFromParams(getGameConfig().defaultBusinessItems[getGame()][typeParam][i][0]); let itemTypeData = getItemTypeData(itemTypeId); if (itemTypeData) { - let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]); + let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]); getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2]; } } @@ -1303,7 +1303,7 @@ function setBusinessEntranceLabelToDealershipCommand(command, params, client) { return false; } - getBusinessData(businessId).labelHelpType == VRR_PROPLABEL_INFO_ENTERVEHICLE; + getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE; updateBusinessPickupLabelData(businessId); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`); } @@ -1545,7 +1545,7 @@ function orderItemForBusinessCommand(command, params, client) { let orderTotalCost = pricePerItem * amount; - //getPlayerData(client).promptType = VRR_PROMPT_BIZORDER; + //getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; getPlayerData(client).businessOrderAmount = amount; getPlayerData(client).businessOrderBusiness = businessId; getPlayerData(client).businessOrderItem = itemType; @@ -1554,7 +1554,7 @@ function orderItemForBusinessCommand(command, params, client) { getBusinessData(businessId).needsSaved = true; showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${makeLargeNumberReadable(pricePerItem)} each will cost a total of $${makeLargeNumberReadable(orderTotalCost)}`, "Business Order Cost"); - getPlayerData(client).promptType = VRR_PROMPT_BIZORDER; + getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; } // =========================================================================== @@ -1641,7 +1641,7 @@ function buyBusinessCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_BIZBUY; + getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY; } // =========================================================================== @@ -2341,17 +2341,17 @@ function exitBusiness(client) { */ function getBusinessOwnerTypeText(ownerType) { switch (ownerType) { - case VRR_BIZ_OWNER_CLAN: + case AGRP_BIZ_OWNER_CLAN: return "clan"; - case VRR_BIZ_OWNER_JOB: + case AGRP_BIZ_OWNER_JOB: return "job"; - case VRR_BIZ_OWNER_PLAYER: + case AGRP_BIZ_OWNER_PLAYER: return "player"; - case VRR_BIZ_OWNER_NONE: - case VRR_BIZ_OWNER_PUBLIC: + case AGRP_BIZ_OWNER_NONE: + case AGRP_BIZ_OWNER_PUBLIC: return "not owned"; default: @@ -2537,7 +2537,7 @@ function setBusinessDataIndexes() { //} for (let j in getServerData().businesses[i].locations) { - if (getServerData().businesses[i].locations[j].type == VRR_BIZ_LOC_ATM) { + if (getServerData().businesses[i].locations[j].type == AGRP_BIZ_LOC_ATM) { getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]); } } @@ -2553,7 +2553,7 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) { tempItemData.buyPrice = buyPrice; tempItemData.itemType = getItemTypeData(itemType).databaseId; tempItemData.ownerId = getBusinessData(business).databaseId; - tempItemData.ownerType = VRR_ITEMOWNER_BIZ; + tempItemData.ownerType = AGRP_ITEMOWNER_BIZ; tempItemData.ownerIndex = businessId; tempItemData.itemTypeIndex = itemType; saveItemToDatabase(tempItemData); @@ -2645,7 +2645,7 @@ function buyFromBusinessCommand(command, params, client) { } takePlayerCash(client, totalCost); - createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); + createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); cachePlayerHotBarItems(client); getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost; @@ -2655,7 +2655,7 @@ function buyFromBusinessCommand(command, params, client) { } let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType; - if (useType == VRR_ITEM_USE_TYPE_WEAPON || VRR_ITEM_USE_TYPE_TAZER || useType == VRR_ITEM_USE_TYPE_AMMO_CLIP) { + if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) { messagePlayerError(client, getLocaleString(client, "WeaponBanned")); return false; @@ -2754,7 +2754,7 @@ function storeItemInBusinessStorageCommand(command, params, client) { return false; } - getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = VRR_ITEM_OWNER_BIZSTORAGE; + getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE; getBusinessData(businessId).storageItemCache[firstSlot] = getBusinessData(businessId).floorItemCache[itemSlot - 1]; getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1; messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`); @@ -2798,7 +2798,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) { return false; } - getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = VRR_ITEM_OWNER_BIZFLOOR; + getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR; getBusinessData(businessId).floorItemCache[firstSlot] = getBusinessData(businessId).storageItemCache[itemSlot - 1]; getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1; messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`); @@ -2838,14 +2838,14 @@ function cacheBusinessItems(businessId) { //let businessData = getBusinessData(businessId); //logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${businessData.name}) ...`); - //getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == VRR_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index); - //getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == VRR_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId); + //getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index); + //getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId); logToConsole(LOG_VERBOSE, `[VRR.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`); for (let i in getServerData().items) { - if (getItemData(i).ownerType == VRR_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { + if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { getBusinessData(businessId).floorItemCache.push(i); - } else if (getItemData(i).ownerType == VRR_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { + } else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { getBusinessData(businessId).storageItemCache.push(i); } } @@ -2869,41 +2869,41 @@ function updateBusinessPickupLabelData(businessId) { } if (getBusinessData(businessId).exitPickup != null) { - setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_EXIT, false); + setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_EXIT, false); setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.id", businessId, false); - setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true); + setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true); } if (getBusinessData(businessId).entrancePickup != null) { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false); + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_ENTRANCE, false); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.id", businessId, false); - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", VRR_LABEL_BUSINESS, true); + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", AGRP_LABEL_BUSINESS, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.locked", getBusinessData(businessId).locked, true); - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_NONE, true); + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_NONE, true); switch (getBusinessData(businessId).labelHelpType) { - case VRR_PROPLABEL_INFO_ENTERVEHICLE: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTERVEHICLE, true); + case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true); break; } - case VRR_PROPLABEL_INFO_ENTER: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true); + case AGRP_PROPLABEL_INFO_ENTER: { + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); break; } - case VRR_PROPLABEL_INFO_REPAIR: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_REPAIR, true); + case AGRP_PROPLABEL_INFO_REPAIR: { + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true); break; } default: { if (getBusinessData(businessId).hasInterior) { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true); + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); } else { if (doesBusinessHaveAnyItemsToBuy(businessId)) { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUY, true); + setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true); } else { removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help"); } @@ -2990,7 +2990,7 @@ function doesBusinessHaveAnyItemsToBuy(businessId) { //function clearPlayerBusinessGameScripts(client, businessId) { // for(let i in getBusinessData(businessId).gameScripts) { -// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY); +// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); // } //} @@ -3012,11 +3012,11 @@ function canPlayerWithdrawFromBusinessTill(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3032,11 +3032,11 @@ function canPlayerSetBusinessInteriorLights(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3052,11 +3052,11 @@ function canPlayerLockUnlockBusiness(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3072,13 +3072,13 @@ function canPlayerManageBusiness(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_PLAYER) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) { if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (getBusinessData(businessId).ownerType == VRR_BIZ_OWNER_CLAN) { + if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN) { if (getBusinessData(businessId).ownerId == getPlayerClan(client)) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; diff --git a/scripts/server/event.js b/scripts/server/event.js index 06f6d79c..ccd96a49 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -162,7 +162,7 @@ function onEntityProcess(event, entity) { function onPedEnteringVehicle(event, ped, vehicle, seat) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGVEHICLE; + getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGVEHICLE; if (!getVehicleData(vehicle)) { return false; @@ -197,7 +197,7 @@ function onPedExitingVehicle(event, ped, vehicle) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGVEHICLE; + getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE; } if (!getVehicleData(vehicle).spawnLocked) { @@ -256,7 +256,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) { return false; } - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { vehicle = getVehicleFromIVNetworkId(clientVehicle); } //else { @@ -276,7 +276,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) { getPlayerData(client).lastVehicle = vehicle; getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); - if (getPlayerVehicleSeat(client) == VRR_VEHSEAT_DRIVER) { + if (getPlayerVehicleSeat(client) == AGRP_VEHSEAT_DRIVER) { vehicle.engine = getVehicleData(vehicle).engine; if (getVehicleData(vehicle).buyPrice > 0) { @@ -294,23 +294,23 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) { let ownerType = getLocaleString(client, "NotOwned"); ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType)); switch (getVehicleData(vehicle).ownerType) { - case VRR_VEHOWNER_CLAN: + case AGRP_VEHOWNER_CLAN: ownerName = getClanData(getClanIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerType = getLocaleString(client, "Clan"); break; - case VRR_VEHOWNER_JOB: + case AGRP_VEHOWNER_JOB: ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerType = getLocaleString(client, "Job"); break; - case VRR_VEHOWNER_PLAYER: + case AGRP_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`; ownerType = getLocaleString(client, "Player"); break; - case VRR_VEHOWNER_BIZ: + case AGRP_VEHOWNER_BIZ: ownerName = getBusinessData(getVehicleData(vehicle).ownerId).name; ownerType = getLocaleString(client, "Business"); break; @@ -340,7 +340,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) { let currentSubAccount = getPlayerCurrentSubAccount(client); if (isPlayerWorking(client)) { - if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { + if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) { getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle; messagePlayerInfo(client, `Use /startroute to start working in this vehicle`); @@ -367,7 +367,7 @@ async function onPlayerEnteredVehicle(client, vehicle, seat) { // =========================================================================== function onPlayerExitedVehicle(client, vehicle) { - getPlayerData(client).pedState = VRR_PEDSTATE_READY; + getPlayerData(client).pedState = AGRP_PEDSTATE_READY; stopRadioStreamForPlayer(client); @@ -392,7 +392,7 @@ function onPlayerExitedVehicle(client, vehicle) { function onPlayerDeath(client, position) { logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`); - getPlayerData(client).pedState = VRR_PEDSTATE_DEAD; + getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD; updatePlayerSpawnedState(client, false); setPlayerControlState(client, false); setTimeout(function () { @@ -413,7 +413,7 @@ function onPlayerDeath(client, position) { stopWorking(client); } - if (getGame() == VRR_GAME_MAFIA_ONE) { + if (getGame() == AGRP_GAME_MAFIA_ONE) { spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestJail.position, closestJail.heading); } else { spawnPlayer(client, closestJail.position, closestJail.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); @@ -436,7 +436,7 @@ function onPlayerDeath(client, position) { stopWorking(client); } - if (getGame() == VRR_GAME_MAFIA_ONE) { + if (getGame() == AGRP_GAME_MAFIA_ONE) { spawnPlayer(client, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0], closestHospital.position, closestHospital.heading); } else { spawnPlayer(client, closestHospital.position, closestHospital.heading, getGameConfig().skins[getGame()][getPlayerCurrentSubAccount(client).skin][0]); @@ -525,7 +525,7 @@ async function onPlayerSpawn(client) { // return false; //} - if (isCustomCameraSupported() && getGame() != VRR_GAME_GTA_IV && getGame() != VRR_GAME_GTA_IV_EFLC) { + if (isCustomCameraSupported() && getGame() != AGRP_GAME_GTA_IV && getGame() != AGRP_GAME_GTA_IV_EFLC) { restorePlayerCamera(client); } @@ -539,7 +539,7 @@ async function onPlayerSpawn(client) { //messagePlayerNormal(client, "This server is in early development and may restart at any time for updates.", getColourByName("orange")); //messagePlayerNormal(client, "Please report any bugs using /bug and suggestions using /idea", getColourByName("yellow")); - if (getGame() == VRR_GAME_MAFIA_ONE) { + if (getGame() == AGRP_GAME_MAFIA_ONE) { setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition); setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading); setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension); @@ -572,7 +572,7 @@ async function onPlayerSpawn(client) { updatePlayerSnowState(client); } - if (areServerElementsSupported() && getGame() == VRR_GAME_GTA_SA) { + if (areServerElementsSupported() && getGame() == AGRP_GAME_GTA_SA) { logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`); setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); @@ -621,7 +621,7 @@ async function onPlayerSpawn(client) { } logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`); - getPlayerData(client).pedState = VRR_PEDSTATE_READY; + getPlayerData(client).pedState = AGRP_PEDSTATE_READY; if (areServerElementsSupported()) { syncPlayerProperties(client); diff --git a/scripts/server/gui.js b/scripts/server/gui.js index b4b9cfb8..d463b2d7 100644 --- a/scripts/server/gui.js +++ b/scripts/server/gui.js @@ -8,9 +8,9 @@ // =========================================================================== // Prompts (used for client GUI prompt responses) -const VRR_PROMPT_NONE = 0; -const VRR_PROMPT_CREATEFIRSTCHAR = 1; -const VRR_PROMPT_BIZORDER = 2; +const AGRP_PROMPT_NONE = 0; +const AGRP_PROMPT_CREATEFIRSTCHAR = 1; +const AGRP_PROMPT_BIZORDER = 2; // =========================================================================== @@ -22,21 +22,21 @@ function initGUIScript() { // =========================================================================== function playerPromptAnswerNo(client) { - if (getPlayerData(client).promptType == VRR_PROMPT_NONE) { + if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) { return false; } logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`); switch (getPlayerData(client).promptType) { - case VRR_PROMPT_CREATEFIRSTCHAR: + case AGRP_PROMPT_CREATEFIRSTCHAR: logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`); showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters"); getPlayerData(targetClient).customDisconnectReason = `Kicked - Didn't create a character`; setTimeout(function () { disconnectPlayer(client); }, 5000); break; - case VRR_PROMPT_BIZORDER: + case AGRP_PROMPT_BIZORDER: if (getPlayerData(client).businessOrderAmount > 0) { if (canPlayerUseGUI(client)) { showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled"); @@ -53,25 +53,25 @@ function playerPromptAnswerNo(client) { break; } - getPlayerData(client).promptType = VRR_PROMPT_NONE; + getPlayerData(client).promptType = AGRP_PROMPT_NONE; } // =========================================================================== function playerPromptAnswerYes(client) { - if (getPlayerData(client).promptType == VRR_PROMPT_NONE) { + if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) { return false; } logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`); switch (getPlayerData(client).promptType) { - case VRR_PROMPT_CREATEFIRSTCHAR: { + case AGRP_PROMPT_CREATEFIRSTCHAR: { showPlayerNewCharacterGUI(client); break; } - case VRR_PROMPT_BIZORDER: { + case AGRP_PROMPT_BIZORDER: { if (getPlayerData(client).businessOrderAmount > 0) { if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) { logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`); @@ -83,7 +83,7 @@ function playerPromptAnswerYes(client) { } else { logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost / getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`); showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful"); - createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount); + createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount); cacheBusinessItems(getPlayerData(client).businessOrderBusiness); getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost; updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness); @@ -98,7 +98,7 @@ function playerPromptAnswerYes(client) { break; } - case VRR_PROMPT_GIVEVEHTOCLAN: { + case AGRP_PROMPT_GIVEVEHTOCLAN: { if (!isPlayerInAnyVehicle(client)) { messagePlayerError(client, getLocaleString(client, "MustBeInVehicle")); return false; @@ -109,7 +109,7 @@ function playerPromptAnswerYes(client) { return false; } - if (getVehicleData(getPlayerVehicle(client)).ownerType != VRR_VEHOWNER_PLAYER) { + if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnVehicle")); return false; } @@ -119,21 +119,21 @@ function playerPromptAnswerYes(client) { return false; } - getVehicleData(getPlayerVehicle(client)).ownerType = VRR_VEHOWNER_CLAN; + getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN; getVehicleData(getPlayerVehicle(client)).ownerId = getPlayerCurrentSubAccount(client).clan; messagePlayerSuccess(client, getLocaleString(client, "GaveVehicleToClan", getVehicleName(getPlayerVehicle(client)))); //messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`); break; } - case VRR_PROMPT_GIVEHOUSETOCLAN: { + case AGRP_PROMPT_GIVEHOUSETOCLAN: { let houseId = getPlayerHouse(client); if (!houseId) { messagePlayerError(client, getLocaleString(client, "InvalidHouse")); return false; } - if (getHouseData(houseId).ownerType != VRR_VEHOWNER_PLAYER) { + if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnHouse")); return false; } @@ -143,21 +143,21 @@ function playerPromptAnswerYes(client) { return false; } - getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_CLAN; + getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).clan; messagePlayerSuccess(client, getLocaleString(client, "GaveHouseToClan")); //messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`); break; } - case VRR_PROMPT_GIVEBIZTOCLAN: { + case AGRP_PROMPT_GIVEBIZTOCLAN: { let businessId = getPlayerBusiness(client); if (!businessId) { messagePlayerError(client, getLocaleString(client, "InvalidBusiness")); return false; } - if (getBusinessData(businessId).ownerType != VRR_VEHOWNER_PLAYER) { + if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnBusiness")); return false; } @@ -167,14 +167,14 @@ function playerPromptAnswerYes(client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_CLAN; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).clan; messagePlayerSuccess(client, getLocaleString(client, "GaveBusinessToClan")); //messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} {MAINCOLOUR}set their {vehiclePurple}${getVehicleName(vehicle)} {MAINCOLOUR}owner to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan`); break; } - case VRR_PROMPT_BUYHOUSE: { + case AGRP_PROMPT_BUYHOUSE: { let houseId = getPlayerHouse(client); if (!houseId) { messagePlayerError(client, getLocaleString(client, "InvalidHouse")); @@ -191,7 +191,7 @@ function playerPromptAnswerYes(client) { return false; } - getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_PLAYER; + getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getHouseData(houseId).buyPrice = 0; getHouseData(houseId).needsSaved = true; @@ -202,7 +202,7 @@ function playerPromptAnswerYes(client) { break; } - case VRR_PROMPT_BUYBIZ: { + case AGRP_PROMPT_BUYBIZ: { let businessId = getPlayerBusiness(client); if (!businessId) { messagePlayerError(client, getLocaleString(client, "InvalidBusiness")); @@ -219,7 +219,7 @@ function playerPromptAnswerYes(client) { return false; } - getBusinessData(businessId).ownerType = VRR_BIZ_OWNER_PLAYER; + getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getBusinessData(businessId).buyPrice = 0; getBusinessData(businessId).needsSaved = true; @@ -236,7 +236,7 @@ function playerPromptAnswerYes(client) { } } - getPlayerData(client).promptType = VRR_PROMPT_NONE; + getPlayerData(client).promptType = AGRP_PROMPT_NONE; } // =========================================================================== diff --git a/scripts/server/house.js b/scripts/server/house.js index 72ae4f9a..ca1d990a 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -8,19 +8,19 @@ // =========================================================================== // House Location Types -const VRR_HOUSE_LOC_NONE = 0; // None -const VRR_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house -const VRR_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped +const AGRP_HOUSE_LOC_NONE = 0; // None +const AGRP_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house +const AGRP_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped // =========================================================================== // House Owner Types -const VRR_HOUSE_OWNER_NONE = 0; // Not owned -const VRR_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) -const VRR_HOUSE_OWNER_JOB = 2; // Owned by a job -const VRR_HOUSE_OWNER_CLAN = 3; // Owned by a clan -const VRR_HOUSE_OWNER_FACTION = 4; // Owned by a faction -const VRR_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used. +const AGRP_HOUSE_OWNER_NONE = 0; // Not owned +const AGRP_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) +const AGRP_HOUSE_OWNER_JOB = 2; // Owned by a job +const AGRP_HOUSE_OWNER_CLAN = 3; // Owned by a clan +const AGRP_HOUSE_OWNER_FACTION = 4; // Owned by a faction +const AGRP_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used. // =========================================================================== @@ -31,7 +31,7 @@ class HouseData { constructor(dbAssoc = false) { this.databaseId = 0 this.description = ""; - this.ownerType = VRR_HOUSE_OWNER_NONE; + this.ownerType = AGRP_HOUSE_OWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.rentPrice = 0; @@ -297,7 +297,7 @@ function setHouseOwnerCommand(command, params, client) { } if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; } @@ -305,7 +305,7 @@ function setHouseOwnerCommand(command, params, client) { getHouseData(houseId).needsSaved = true; - getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_PLAYER; + getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId; messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to {ALTCOLOUR}${newHouseOwner.name}`); } @@ -328,13 +328,13 @@ function removeHouseOwnerCommand(command, params, client) { } if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; } } - getHouseData(houseId).ownerType = VRR_HOUSE_OWNER_NONE; + getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE; getHouseData(houseId).ownerId = -1; getHouseData(houseId).needsSaved = true; @@ -367,7 +367,7 @@ function setHouseClanCommand(command, params, client) { return false; } - if (getHouseData(houseId).ownerType != VRR_VEHOWNER_PLAYER) { + if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnHouse")); return false; } @@ -378,7 +378,7 @@ function setHouseClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_HOUSEGIVETOCLAN; + getPlayerData(client).promptType = AGRP_PROMPT_HOUSEGIVETOCLAN; //messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); } @@ -1100,7 +1100,7 @@ function createHouseEntranceBlip(houseId) { setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance); } - setEntityData(entranceBlip, "agrp.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false); + setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false); setEntityData(entranceBlip, "agrp.owner.id", houseId, false); houseData.entranceBlip = entranceBlip; @@ -1206,7 +1206,7 @@ function createHouseExitBlip(houseId) { setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance); } setElementTransient(exitBlip, false); - setEntityData(exitBlip, "agrp.owner.type", VRR_BLIP_HOUSE_EXIT, false); + setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false); setEntityData(exitBlip, "agrp.owner.id", houseId, false); getHouseData(houseId).exitBlip = exitBlip; } @@ -1216,22 +1216,22 @@ function createHouseExitBlip(houseId) { function getHouseOwnerTypeText(ownerType) { switch (ownerType) { - case VRR_HOUSE_OWNER_CLAN: + case AGRP_HOUSE_OWNER_CLAN: return "clan"; - case VRR_HOUSE_OWNER_PLAYER: + case AGRP_HOUSE_OWNER_PLAYER: return "player"; - case VRR_HOUSE_OWNER_NONE: + case AGRP_HOUSE_OWNER_NONE: return "not owned"; - case VRR_HOUSE_OWNER_PUBLIC: + case AGRP_HOUSE_OWNER_PUBLIC: return "not owned"; - case VRR_HOUSE_OWNER_JOB: + case AGRP_HOUSE_OWNER_JOB: return "job"; - case VRR_HOUSE_OWNER_BIZ: + case AGRP_HOUSE_OWNER_BIZ: return "business"; default: @@ -1266,28 +1266,28 @@ function getHouseInfoCommand(command, params, client) { let ownerName = "Unknown"; switch (getHouseData(houseId).ownerType) { - case VRR_HOUSE_OWNER_CLAN: + case AGRP_HOUSE_OWNER_CLAN: ownerName = getClanData(houseData).name; break; - case VRR_HOUSE_OWNER_PLAYER: + case AGRP_HOUSE_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(houseData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; break; - case VRR_HOUSE_OWNER_NONE: + case AGRP_HOUSE_OWNER_NONE: ownerName = "None"; break; - case VRR_HOUSE_OWNER_PUBLIC: + case AGRP_HOUSE_OWNER_PUBLIC: ownerName = "Public"; break; - case VRR_HOUSE_OWNER_BIZ: + case AGRP_HOUSE_OWNER_BIZ: ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name; break; - case VRR_HOUSE_OWNER_JOB: + case AGRP_HOUSE_OWNER_JOB: ownerName = getJobData(houseData.ownerId).name; break; } @@ -1423,7 +1423,7 @@ function buyHouseCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_HOUSEBUY; + getPlayerData(client).promptType = AGRP_PROMPT_HOUSEBUY; } // =========================================================================== @@ -1581,7 +1581,7 @@ function cacheHouseItems(houseId) { getHouseData(houseId).itemCache = []; for (let i in getServerData().items) { - if (getItemData(i).ownerType == VRR_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) { + if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) { getHouseData(houseId).itemCache.push(i); } } @@ -1610,7 +1610,7 @@ function getHouseIdFromDatabaseId(databaseId) { //function clearPlayerHouseGameScripts(client, houseId) { // for(let i in getHouseData(houseId).gameScripts) { -// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY); +// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); // } //} @@ -1632,11 +1632,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; } @@ -1652,11 +1652,11 @@ function canPlayerLockUnlockHouse(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; } @@ -1706,13 +1706,13 @@ function canPlayerManageHouse(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_PLAYER) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) { if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (getHouseData(houseId).ownerType == VRR_HOUSE_OWNER_CLAN) { + if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) { if (getHouseData(houseId).ownerId == getPlayerClan(client)) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; @@ -1753,26 +1753,26 @@ function updateHousePickupLabelData(houseId) { let houseData = getHouseData(houseId); if (houseData.entrancePickup != null) { - setEntityData(houseData.entrancePickup, "agrp.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false); + setEntityData(houseData.entrancePickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_ENTRANCE, false); setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false); - setEntityData(houseData.entrancePickup, "agrp.label.type", VRR_LABEL_HOUSE, true); + setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true); setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true); if (houseData.buyPrice > 0) { setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true); - setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true); + setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true); } else { if (houseData.rentPrice > 0) { setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true); - setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true); + setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true); } } } if (houseData.exitPickup != null) { - setEntityData(houseData.exitPickup, "agrp.owner.type", VRR_PICKUP_HOUSE_EXIT, false); + setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false); setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false); - setEntityData(houseData.exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true); + setEntityData(houseData.exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true); } } diff --git a/scripts/server/item.js b/scripts/server/item.js index 5d207112..7b0e453b 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -8,110 +8,110 @@ // =========================================================================== // Item Owners -const VRR_ITEM_OWNER_NONE = 0; // None -const VRR_ITEM_OWNER_PLAYER = 1; // Item is in a player's inventory -const VRR_ITEM_OWNER_VEHTRUNK = 2; // Item is in a vehicle's trunk -const VRR_ITEM_OWNER_VEHDASH = 3; // Item is in a vehicle's glove compartment -const VRR_ITEM_OWNER_BIZFLOOR = 4; // Item is in the public area of a business (on the floor = ready to buy) -const VRR_ITEM_OWNER_BIZSTORAGE = 5; // Item is in a business's storage area (stock room) -const VRR_ITEM_OWNER_HOUSE = 6; // Item is in a house -const VRR_ITEM_OWNER_SAFE = 7; // Item is in a safe (safes can be anywhere) -const VRR_ITEM_OWNER_ITEM = 8; // Item is in another item (trashbag, briefcase, wallet, suitcase, crate/box, barrel, etc) -const VRR_ITEM_OWNER_GROUND = 9; // Item is on the ground -const VRR_ITEM_OWNER_TEMPLOCKER = 10; // Item is in player's temp locker (used for paintball, jobs, etc) -const VRR_ITEM_OWNER_LOCKER = 10; // Item is in player's locker +const AGRP_ITEM_OWNER_NONE = 0; // None +const AGRP_ITEM_OWNER_PLAYER = 1; // Item is in a player's inventory +const AGRP_ITEM_OWNER_VEHTRUNK = 2; // Item is in a vehicle's trunk +const AGRP_ITEM_OWNER_VEHDASH = 3; // Item is in a vehicle's glove compartment +const AGRP_ITEM_OWNER_BIZFLOOR = 4; // Item is in the public area of a business (on the floor = ready to buy) +const AGRP_ITEM_OWNER_BIZSTORAGE = 5; // Item is in a business's storage area (stock room) +const AGRP_ITEM_OWNER_HOUSE = 6; // Item is in a house +const AGRP_ITEM_OWNER_SAFE = 7; // Item is in a safe (safes can be anywhere) +const AGRP_ITEM_OWNER_ITEM = 8; // Item is in another item (trashbag, briefcase, wallet, suitcase, crate/box, barrel, etc) +const AGRP_ITEM_OWNER_GROUND = 9; // Item is on the ground +const AGRP_ITEM_OWNER_TEMPLOCKER = 10; // Item is in player's temp locker (used for paintball, jobs, etc) +const AGRP_ITEM_OWNER_LOCKER = 10; // Item is in player's locker // =========================================================================== // Item Use Types -const VRR_ITEM_USE_TYPE_NONE = 0; // Has no effect -const VRR_ITEM_USE_TYPE_WEAPON = 1; // Equips weapon -const VRR_ITEM_USE_TYPE_AMMO_CLIP = 2; // Magazine for weapon. If in inventory, R will load it into gun -const VRR_ITEM_USE_TYPE_PHONE = 3; // Pulls out phone -const VRR_ITEM_USE_TYPE_GPS = 4; // Not sure how I want this to work yet -const VRR_ITEM_USE_TYPE_MAP = 5; // Shows minimap on HUD -const VRR_ITEM_USE_TYPE_SKIN = 6; // Changes skin (uses skin changer) -const VRR_ITEM_USE_TYPE_PEDPART = 7; // Changes ped part (clothing, skin, hair, etc) (UNUSED) -const VRR_ITEM_USE_TYPE_PEDPROP = 8; // Changes ped prop (watches, glasses, hats, etc) (UNUSED) -const VRR_ITEM_USE_TYPE_STORAGE = 9; // Shows stored items. Backpack, crate, briefcase, wallet, etc -const VRR_ITEM_USE_TYPE_VEHKEY = 10; // Locks/unlocks a vehicle and allows starting engine without hotwire -const VRR_ITEM_USE_TYPE_BIZKEY = 11; // Locks/unlocks a business -const VRR_ITEM_USE_TYPE_HOUSEKEY = 12; // Locks/unlocks a house -const VRR_ITEM_USE_TYPE_SEED = 13; // Plants a seed -const VRR_ITEM_USE_TYPE_WEED = 14; // Light drug effect (short term relief of addiction symptoms?) -const VRR_ITEM_USE_TYPE_COKE = 15; // Medium drug effect (medium term relief of addiction symptoms?) -const VRR_ITEM_USE_TYPE_METH = 16; // Heavy drug effect (extended term relief of addiction symptoms?) -const VRR_ITEM_USE_TYPE_CIGAR = 17; // Just for appearance. Makes people look cool I guess -const VRR_ITEM_USE_TYPE_WATER = 18; // Replenishes small amount of health -const VRR_ITEM_USE_TYPE_FOOD = 19; // Eat food. Replenishes a small amount of health -const VRR_ITEM_USE_TYPE_BEER = 20; // Subtle drunk effect. Replenishes small amount of health. -const VRR_ITEM_USE_TYPE_WINE = 21; // Moderate drunk effect. Replenishes moderate amount of health. -const VRR_ITEM_USE_TYPE_LIQUOR = 22; // Heavy drunk effect. Replenishes large amount of health. -const VRR_ITEM_USE_TYPE_COFFEE = 23; // Replenishes moderate amount of health. -const VRR_ITEM_USE_TYPE_AMMO_ROUND = 23; // Bullet. Loads into magazine. Not used at the moment -const VRR_ITEM_USE_TYPE_HANDCUFF = 24; // -const VRR_ITEM_USE_TYPE_ROPE = 25; // -const VRR_ITEM_USE_TYPE_BLINDFOLD = 26; // -const VRR_ITEM_USE_TYPE_TAZER = 27; // -const VRR_ITEM_USE_TYPE_ARMOUR = 28; // -const VRR_ITEM_USE_TYPE_HEALTH = 29; // -const VRR_ITEM_USE_TYPE_AED = 30; // -const VRR_ITEM_USE_TYPE_WALKIETALKIE = 31; // -const VRR_ITEM_USE_TYPE_BOOMBOX = 32; // -const VRR_ITEM_USE_TYPE_EARBUDS = 33; // -const VRR_ITEM_USE_TYPE_BADGE = 34; // -const VRR_ITEM_USE_TYPE_DRINK = 35; // Drinkable item. Action output shows "Player_Name drinks some (drink name)" -const VRR_ITEM_USE_TYPE_EXTINGUISHER = 36; // Extinguisher item. Allows putting out fires -const VRR_ITEM_USE_TYPE_SPRAYPAINT = 37; // Spraypaint item. Allows spraying custom clan tags on walls -const VRR_ITEM_USE_TYPE_PEPPERSPRAY = 38; // Pepper spray item. Incapacitates nearby player -const VRR_ITEM_USE_TYPE_FLASHLIGHT = 39; // Flashlight item. Unusable for now, but plan to cast a custom light beam -const VRR_ITEM_USE_TYPE_AIRPLANETICKET = 40; // Airplane ticket. Allows a character to move to another server -const VRR_ITEM_USE_TYPE_TRAINTICKET = 41; // Train ticket. Allows a character to move to another server -const VRR_ITEM_USE_TYPE_VEHUPGRADE_PART = 42; // Vehicle update part item. Allows adding custom parts like spoilers, side skirts, roof scoops, etc -const VRR_ITEM_USE_TYPE_VEHTIRE = 43; // Vehicle tire item. Allows changing the tire/rim types -const VRR_ITEM_USE_TYPE_FUELCAN = 44; // Fuel can item. Allows refueling of a nearby vehicle anywhere -const VRR_ITEM_USE_TYPE_VEHCOLOUR = 45; // Vehicle colour item. Changes primary and secondary vehicle colours -const VRR_ITEM_USE_TYPE_VEHLIVERY = 46; // Vehicle livery/paintjob item. Applies decals and special paint jobs -const VRR_ITEM_USE_TYPE_VEHREPAIR = 47; // Vehicle repair item. Much longer use time -const VRR_ITEM_USE_TYPE_SMOKEDRUG = 48; // Smokable drug like weed. Action output shows "Player_Name smokes some (drug)" -const VRR_ITEM_USE_TYPE_SNORTDRUG = 49; // Snortable drug like cocaine. Action output shows "Player_Name snorts some (drug)" -const VRR_ITEM_USE_TYPE_PLANT = 50; // Plantable item. Pot plants, coke plants, etc -const VRR_ITEM_USE_TYPE_MEGAPHONE = 51; // Megaphone item. Allows shouting over greater distances. Also called a bullhorn -const VRR_ITEM_USE_TYPE_INJECTDRUG = 52; // Injectable drug like heroine. Action output shows "Player_Name injects some (drug)" -const VRR_ITEM_USE_TYPE_ALCOHOL = 53; // Alcohol. Applies an intoxication/drunkness effect -const VRR_ITEM_USE_TYPE_METH_LAB = 54; // Meth lab item. Allows creating meth -const VRR_ITEM_USE_TYPE_PLANTER = 55; // Plant pot. Can be used to plant item of use type VRR_ITEM_USE_TYPE_PLANT where terrain is not available -const VRR_ITEM_USE_TYPE_FISH = 56; // Fishing catch ... bass, catfish, etc -const VRR_ITEM_USE_TYPE_JUNK = 57; // Worthless junk. Some used as fishing catches -const VRR_ITEM_USE_TYPE_BAIT = 58; // Bait. Used for fishing +const AGRP_ITEM_USE_TYPE_NONE = 0; // Has no effect +const AGRP_ITEM_USE_TYPE_WEAPON = 1; // Equips weapon +const AGRP_ITEM_USE_TYPE_AMMO_CLIP = 2; // Magazine for weapon. If in inventory, R will load it into gun +const AGRP_ITEM_USE_TYPE_PHONE = 3; // Pulls out phone +const AGRP_ITEM_USE_TYPE_GPS = 4; // Not sure how I want this to work yet +const AGRP_ITEM_USE_TYPE_MAP = 5; // Shows minimap on HUD +const AGRP_ITEM_USE_TYPE_SKIN = 6; // Changes skin (uses skin changer) +const AGRP_ITEM_USE_TYPE_PEDPART = 7; // Changes ped part (clothing, skin, hair, etc) (UNUSED) +const AGRP_ITEM_USE_TYPE_PEDPROP = 8; // Changes ped prop (watches, glasses, hats, etc) (UNUSED) +const AGRP_ITEM_USE_TYPE_STORAGE = 9; // Shows stored items. Backpack, crate, briefcase, wallet, etc +const AGRP_ITEM_USE_TYPE_VEHKEY = 10; // Locks/unlocks a vehicle and allows starting engine without hotwire +const AGRP_ITEM_USE_TYPE_BIZKEY = 11; // Locks/unlocks a business +const AGRP_ITEM_USE_TYPE_HOUSEKEY = 12; // Locks/unlocks a house +const AGRP_ITEM_USE_TYPE_SEED = 13; // Plants a seed +const AGRP_ITEM_USE_TYPE_WEED = 14; // Light drug effect (short term relief of addiction symptoms?) +const AGRP_ITEM_USE_TYPE_COKE = 15; // Medium drug effect (medium term relief of addiction symptoms?) +const AGRP_ITEM_USE_TYPE_METH = 16; // Heavy drug effect (extended term relief of addiction symptoms?) +const AGRP_ITEM_USE_TYPE_CIGAR = 17; // Just for appearance. Makes people look cool I guess +const AGRP_ITEM_USE_TYPE_WATER = 18; // Replenishes small amount of health +const AGRP_ITEM_USE_TYPE_FOOD = 19; // Eat food. Replenishes a small amount of health +const AGRP_ITEM_USE_TYPE_BEER = 20; // Subtle drunk effect. Replenishes small amount of health. +const AGRP_ITEM_USE_TYPE_WINE = 21; // Moderate drunk effect. Replenishes moderate amount of health. +const AGRP_ITEM_USE_TYPE_LIQUOR = 22; // Heavy drunk effect. Replenishes large amount of health. +const AGRP_ITEM_USE_TYPE_COFFEE = 23; // Replenishes moderate amount of health. +const AGRP_ITEM_USE_TYPE_AMMO_ROUND = 23; // Bullet. Loads into magazine. Not used at the moment +const AGRP_ITEM_USE_TYPE_HANDCUFF = 24; // +const AGRP_ITEM_USE_TYPE_ROPE = 25; // +const AGRP_ITEM_USE_TYPE_BLINDFOLD = 26; // +const AGRP_ITEM_USE_TYPE_TAZER = 27; // +const AGRP_ITEM_USE_TYPE_ARMOUR = 28; // +const AGRP_ITEM_USE_TYPE_HEALTH = 29; // +const AGRP_ITEM_USE_TYPE_AED = 30; // +const AGRP_ITEM_USE_TYPE_WALKIETALKIE = 31; // +const AGRP_ITEM_USE_TYPE_BOOMBOX = 32; // +const AGRP_ITEM_USE_TYPE_EARBUDS = 33; // +const AGRP_ITEM_USE_TYPE_BADGE = 34; // +const AGRP_ITEM_USE_TYPE_DRINK = 35; // Drinkable item. Action output shows "Player_Name drinks some (drink name)" +const AGRP_ITEM_USE_TYPE_EXTINGUISHER = 36; // Extinguisher item. Allows putting out fires +const AGRP_ITEM_USE_TYPE_SPRAYPAINT = 37; // Spraypaint item. Allows spraying custom clan tags on walls +const AGRP_ITEM_USE_TYPE_PEPPERSPRAY = 38; // Pepper spray item. Incapacitates nearby player +const AGRP_ITEM_USE_TYPE_FLASHLIGHT = 39; // Flashlight item. Unusable for now, but plan to cast a custom light beam +const AGRP_ITEM_USE_TYPE_AIRPLANETICKET = 40; // Airplane ticket. Allows a character to move to another server +const AGRP_ITEM_USE_TYPE_TRAINTICKET = 41; // Train ticket. Allows a character to move to another server +const AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART = 42; // Vehicle update part item. Allows adding custom parts like spoilers, side skirts, roof scoops, etc +const AGRP_ITEM_USE_TYPE_VEHTIRE = 43; // Vehicle tire item. Allows changing the tire/rim types +const AGRP_ITEM_USE_TYPE_FUELCAN = 44; // Fuel can item. Allows refueling of a nearby vehicle anywhere +const AGRP_ITEM_USE_TYPE_VEHCOLOUR = 45; // Vehicle colour item. Changes primary and secondary vehicle colours +const AGRP_ITEM_USE_TYPE_VEHLIVERY = 46; // Vehicle livery/paintjob item. Applies decals and special paint jobs +const AGRP_ITEM_USE_TYPE_VEHREPAIR = 47; // Vehicle repair item. Much longer use time +const AGRP_ITEM_USE_TYPE_SMOKEDRUG = 48; // Smokable drug like weed. Action output shows "Player_Name smokes some (drug)" +const AGRP_ITEM_USE_TYPE_SNORTDRUG = 49; // Snortable drug like cocaine. Action output shows "Player_Name snorts some (drug)" +const AGRP_ITEM_USE_TYPE_PLANT = 50; // Plantable item. Pot plants, coke plants, etc +const AGRP_ITEM_USE_TYPE_MEGAPHONE = 51; // Megaphone item. Allows shouting over greater distances. Also called a bullhorn +const AGRP_ITEM_USE_TYPE_INJECTDRUG = 52; // Injectable drug like heroine. Action output shows "Player_Name injects some (drug)" +const AGRP_ITEM_USE_TYPE_ALCOHOL = 53; // Alcohol. Applies an intoxication/drunkness effect +const AGRP_ITEM_USE_TYPE_METH_LAB = 54; // Meth lab item. Allows creating meth +const AGRP_ITEM_USE_TYPE_PLANTER = 55; // Plant pot. Can be used to plant item of use type AGRP_ITEM_USE_TYPE_PLANT where terrain is not available +const AGRP_ITEM_USE_TYPE_FISH = 56; // Fishing catch ... bass, catfish, etc +const AGRP_ITEM_USE_TYPE_JUNK = 57; // Worthless junk. Some used as fishing catches +const AGRP_ITEM_USE_TYPE_BAIT = 58; // Bait. Used for fishing // =========================================================================== // Item Drop Types -const VRR_ITEM_DROP_TYPE_NONE = 0; // Can't be dropped -const VRR_ITEM_DROP_TYPE_OBJECT = 1; // Drops as an object on the ground -const VRR_ITEM_DROP_TYPE_PICKUP = 2; // Drops as a pickup -const VRR_ITEM_DROP_TYPE_OBJECTLIGHT = 3; // Object that produces an area light effect (lamp, flashlight, etc) -const VRR_ITEM_DROP_TYPE_DESTROY = 4; // Will destroy the item on drop (keys mostly but for any tiny object) -const VRR_ITEM_DROP_TYPE_OBJECTSTACK = 5; // Stackable objects (crates and such). Will sit on top of closest other stackable +const AGRP_ITEM_DROP_TYPE_NONE = 0; // Can't be dropped +const AGRP_ITEM_DROP_TYPE_OBJECT = 1; // Drops as an object on the ground +const AGRP_ITEM_DROP_TYPE_PICKUP = 2; // Drops as a pickup +const AGRP_ITEM_DROP_TYPE_OBJECTLIGHT = 3; // Object that produces an area light effect (lamp, flashlight, etc) +const AGRP_ITEM_DROP_TYPE_DESTROY = 4; // Will destroy the item on drop (keys mostly but for any tiny object) +const AGRP_ITEM_DROP_TYPE_OBJECTSTACK = 5; // Stackable objects (crates and such). Will sit on top of closest other stackable // =========================================================================== // Item Occupied States -const VRR_ITEM_ACTION_NONE = 0; // None -const VRR_ITEM_ACTION_USE = 1; // Using item -const VRR_ITEM_ACTION_PICKUP = 2; // Picking up item -const VRR_ITEM_ACTION_DROP = 3; // Dropping item -const VRR_ITEM_ACTION_SWITCH = 4; // Switching item -const VRR_ITEM_ACTION_PUT = 5; // Putting item (into trunk, dash, crate, etc) -const VRR_ITEM_ACTION_TAKE = 6; // Taking item (from trunk, dash, crate, etc) +const AGRP_ITEM_ACTION_NONE = 0; // None +const AGRP_ITEM_ACTION_USE = 1; // Using item +const AGRP_ITEM_ACTION_PICKUP = 2; // Picking up item +const AGRP_ITEM_ACTION_DROP = 3; // Dropping item +const AGRP_ITEM_ACTION_SWITCH = 4; // Switching item +const AGRP_ITEM_ACTION_PUT = 5; // Putting item (into trunk, dash, crate, etc) +const AGRP_ITEM_ACTION_TAKE = 6; // Taking item (from trunk, dash, crate, etc) // =========================================================================== // Player Temporary Locker Types -const VRR_TEMP_LOCKER_TYPE_NONE = 0; // None -const VRR_TEMP_LOCKER_TYPE_JOB = 1; // Job locker -const VRR_TEMP_LOCKER_TYPE_PAINTBALL = 2; // Paintball locker +const AGRP_TEMP_LOCKER_TYPE_NONE = 0; // None +const AGRP_TEMP_LOCKER_TYPE_JOB = 1; // Job locker +const AGRP_TEMP_LOCKER_TYPE_PAINTBALL = 2; // Paintball locker // =========================================================================== @@ -121,7 +121,7 @@ class ItemData { this.index = 0; this.itemTypeIndex = 0; this.itemType = 0; - this.ownerType = VRR_ITEM_OWNER_NONE; + this.ownerType = AGRP_ITEM_OWNER_NONE; this.ownerId = 0; this.ownerIndex = -1; this.position = toVector3(0.0, 0.0, 0.0); @@ -163,11 +163,11 @@ class ItemTypeData { this.index = 0; this.name = "Unknown"; this.enabled = false; - this.useType = VRR_ITEM_USE_TYPE_NONE; + this.useType = AGRP_ITEM_USE_TYPE_NONE; this.useId = 0; this.useValue = 0; this.maxValue = 0; - this.dropType = VRR_ITEM_DROP_TYPE_NONE; + this.dropType = AGRP_ITEM_DROP_TYPE_NONE; this.useId = 0; this.dropPosition = toVector3(0.0, 0.0, 0.0); this.dropRotation = toVector3(0.0, 0.0, 0.0); @@ -322,7 +322,7 @@ function createItem(itemTypeId, value, ownerType, ownerId, amount = 1) { // =========================================================================== function createGroundItem(itemTypeId, value, position, dimension = 0) { - let itemIndex = createItem(itemTypeId, value, VRR_ITEM_OWNER_GROUND, 0); + let itemIndex = createItem(itemTypeId, value, AGRP_ITEM_OWNER_GROUND, 0); getItemData(itemIndex).position = position; getItemData(itemIndex).dimension = dimension; createGroundItemObject(itemIndex); @@ -421,7 +421,7 @@ function createItemCommand(command, params, client) { // return false; //} - let itemId = createItem(itemType, toInteger(value), VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); + let itemId = createItem(itemType, toInteger(value), AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); cachePlayerHotBarItems(client); messagePlayerSuccess(client, `You created a ${getItemTypeData(itemType).name} in your inventory`); } @@ -468,7 +468,7 @@ function useItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -482,7 +482,7 @@ function useItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).useAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_USE; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_USE; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemUseDelay(client, hotBarSlot); @@ -561,7 +561,7 @@ function pickupItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -575,7 +575,7 @@ function pickupItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).pickupAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_PICKUP; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_PICKUP; getPlayerData(client).itemActionItem = itemId; showPlayerItemPickupDelay(client, itemId); @@ -626,7 +626,7 @@ function dropItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -645,7 +645,7 @@ function dropItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).dropAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_DROP; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_DROP; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemDropDelay(client, hotBarSlot); @@ -692,7 +692,7 @@ function putItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -711,7 +711,7 @@ function putItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_PUT; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_PUT; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemPutDelay(client, hotBarSlot); @@ -743,12 +743,12 @@ function takeItemCommand(command, params, client) { let bestOwner = getBestItemToTake(client, itemSlot); let itemId = bestOwner[2]; - if (bestOwner[1] == VRR_ITEM_OWNER_NONE) { + if (bestOwner[1] == AGRP_ITEM_OWNER_NONE) { messagePlayerError(client, getLocaleString(client, "NothingToTakeItemFrom")); return false; } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -768,7 +768,7 @@ function takeItemCommand(command, params, client) { } getPlayerData(client).itemActionItem = itemId; - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_TAKE; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_TAKE; showPlayerItemTakeDelay(client, itemId); //clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset); @@ -1279,20 +1279,20 @@ function playerUseItem(client, hotBarSlot) { logToConsole(LOG_DEBUG, `[VRR.Item] ${getPlayerDisplayForConsole(client)} used a ${itemTypeData.name} (use type ${itemTypeData.useType} - ${typeof itemTypeData.useType}) item (ID: ${itemData.index}/${itemData.databaseId}, TypeID: ${itemTypeData.index}/${itemTypeData.databaseId})`); switch (toInteger(itemTypeData.useType)) { - case VRR_ITEM_USE_TYPE_SKIN: { + case AGRP_ITEM_USE_TYPE_SKIN: { getPlayerData(client).itemActionItem = itemIndex; forcePlayerIntoSkinSelect(client); break; } - case VRR_ITEM_USE_TYPE_WEAPON: { + case AGRP_ITEM_USE_TYPE_WEAPON: { if (isMeleeWeapon(itemTypeData.useId, getGame()) == true) { messagePlayerError(client, getLocaleString(client, "WeaponDoesNotUseAmmo", itemTypeData.name)); } else { for (let i in hotBarItems) { if (hotBarItems[i] != -1) { if (getItemData(hotBarItems[i]) != false) { - if (getItemTypeData(getItemData(hotBarItems[i]).itemTypeIndex).useType == VRR_ITEM_USE_TYPE_AMMO_CLIP) { + if (getItemTypeData(getItemData(hotBarItems[i]).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { let ammoItemData = getItemData(hotBarItems[i]); let ammoItemTypeData = getItemTypeData(ammoItemData.itemTypeIndex); if (ammoItemTypeData.useId == itemTypeData.databaseId) { @@ -1311,7 +1311,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_AMMO_CLIP: { + case AGRP_ITEM_USE_TYPE_AMMO_CLIP: { if (doesPlayerHaveKeyBindForCommand(client, "use")) { messagePlayerError(client, getLocaleString(client, "LoadAmmoIntoWeaponHelpKeyPress", `{ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "use").key))}{MAINCOLOUR}`)); } else { @@ -1320,12 +1320,12 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_STORAGE: { + case AGRP_ITEM_USE_TYPE_STORAGE: { showItemInventoryToPlayer(client, itemIndex); break; } - case VRR_ITEM_USE_TYPE_FOOD: { + case AGRP_ITEM_USE_TYPE_FOOD: { meActionToNearbyPlayers(client, `eats some of their ${itemTypeData.name}`); givePlayerHealth(client, itemTypeData.useValue); itemData.value = itemData.value - itemTypeData.useValue; @@ -1336,7 +1336,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_DRINK: { + case AGRP_ITEM_USE_TYPE_DRINK: { meActionToNearbyPlayers(client, `drinks some of their ${itemTypeData.name}`); givePlayerHealth(client, itemTypeData.useValue); itemData.value = itemData.value - itemTypeData.useValue; @@ -1347,7 +1347,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_ARMOUR: { + case AGRP_ITEM_USE_TYPE_ARMOUR: { meActionToNearbyPlayers(client, `puts on a ${itemTypeData.name}`); givePlayerArmour(client, itemTypeData.useValue); deleteItem(itemIndex); @@ -1355,7 +1355,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_ROPE: { + case AGRP_ITEM_USE_TYPE_ROPE: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1388,7 +1388,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_HANDCUFF: { + case AGRP_ITEM_USE_TYPE_HANDCUFF: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1416,7 +1416,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_VEHREPAIR: { + case AGRP_ITEM_USE_TYPE_VEHREPAIR: { let vehicle = getClosestVehicle(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) { meActionToNearbyPlayers(client, `takes their repair kit and fixes the vehicle`); @@ -1432,7 +1432,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_VEHUPGRADE_PART: { + case AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART: { let vehicle = getClosestVehicle(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) { meActionToNearbyPlayers(client, `takes their upgrade kit and adds a ${itemTypeData.name} to the vehicle.`); @@ -1441,7 +1441,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_VEHLIVERY: { + case AGRP_ITEM_USE_TYPE_VEHLIVERY: { let vehicle = getClosestVehicle(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) { meActionToNearbyPlayers(client, `takes their decal kit and adds some decals to the vehicle.`); @@ -1450,7 +1450,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_VEHCOLOUR: { + case AGRP_ITEM_USE_TYPE_VEHCOLOUR: { let vehicle = getClosestVehicle(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) { if (itemData.useId == 1) { @@ -1466,7 +1466,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_FUELCAN: { + case AGRP_ITEM_USE_TYPE_FUELCAN: { let vehicle = getClosestVehicle(getPlayerPosition(client)); let fuelPump = getClosestFuelPump(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getDistance(getPlayerPosition(client), getFuelPumpData(fuelPump).position)) { @@ -1499,13 +1499,13 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_WALKIETALKIE: { + case AGRP_ITEM_USE_TYPE_WALKIETALKIE: { itemData.enabled = !itemData.enabled; meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(itemData.enabled))} their walkie-talkie`); break; } - case VRR_ITEM_USE_TYPE_PHONE: { + case AGRP_ITEM_USE_TYPE_PHONE: { if (itemData.value == 0) { let phoneNumber = generateRandomPhoneNumber(); itemData.value = phoneNumber; @@ -1523,7 +1523,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_SMOKEDRUG: { + case AGRP_ITEM_USE_TYPE_SMOKEDRUG: { meActionToNearbyPlayers(client, `smokes some ${itemTypeData.name}`); getPlayerData(client).incomingDamageMultiplier = getPlayerData(client).incomingDamageMultiplier - (itemTypeData.useValue / 100); if (getPlayerData(client).incomingDamageMultiplier < 0.25) { @@ -1534,7 +1534,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_SNORTDRUG: { + case AGRP_ITEM_USE_TYPE_SNORTDRUG: { meActionToNearbyPlayers(client, `snorts some ${itemTypeData.name}`); getPlayerData(client).incomingDamageMultiplier = getPlayerData(client).incomingDamageMultiplier - (itemTypeData.useValue / 100); if (getPlayerData(client).incomingDamageMultiplier < 0.25) { @@ -1545,7 +1545,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_INJECTDRUG: { + case AGRP_ITEM_USE_TYPE_INJECTDRUG: { meActionToNearbyPlayers(client, `shoots up some ${itemTypeData.name}`); getPlayerData(client).incomingDamageMultiplier = getPlayerData(client).incomingDamageMultiplier - (itemTypeData.useValue / 100); if (getPlayerData(client).incomingDamageMultiplier < 0.25) { @@ -1556,7 +1556,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_PLANT: { + case AGRP_ITEM_USE_TYPE_PLANT: { meActionToNearbyPlayers(client, `bends down and plants a ${itemTypeData.name} in the ground`); createGroundPlant(itemIndex); if (itemData.value == 0) { @@ -1566,7 +1566,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_BADGE: { + case AGRP_ITEM_USE_TYPE_BADGE: { meActionToNearbyPlayers(client, `shows their badge to everyone nearby.`); let clients = getClients(); for (let i in clients) { @@ -1580,12 +1580,12 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_AMMO_CLIP: { + case AGRP_ITEM_USE_TYPE_AMMO_CLIP: { messagePlayerError(client, `Equip a compatible weapon and press R to use an ammo clip/magazine`); break; } - case VRR_ITEM_USE_TYPE_HEALTH: { + case AGRP_ITEM_USE_TYPE_HEALTH: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1600,26 +1600,26 @@ function playerUseItem(client, hotBarSlot) { break; } - case VRR_ITEM_USE_TYPE_LOTTOTICKET: { + case AGRP_ITEM_USE_TYPE_LOTTOTICKET: { messagePlayerError(client, getLocaleString(client, "ItemDoesntDoAnythingOnUse", itemTypeData.name)); break; } - case VRR_ITEM_USE_TYPE_AREARADIO: { + case AGRP_ITEM_USE_TYPE_AREARADIO: { itemData.enabled = !itemData.enabled; meActionToNearbyPlayers(client, `turns ${getOnOffFromBool(itemData.enabled)} the boombox radio`); messagePlayerAlert(client, getLocaleString(client, "ItemRadioStationTip", `{ALTCOLOUR}/radiostation{MAINCOLOUR}`)); break; } - case VRR_ITEM_USE_TYPE_PERSONALRADIO: { + case AGRP_ITEM_USE_TYPE_PERSONALRADIO: { itemData.enabled = !itemData.enabled; meActionToNearbyPlayers(client, `turns ${getOnOffFromBool(itemData.enabled)} their personal radio`); messagePlayerAlert(client, getLocaleString(client, "ItemRadioStationTip", `{ALTCOLOUR}/radiostation{MAINCOLOUR}`)); break; } - case VRR_ITEM_USE_TYPE_NONE: { + case AGRP_ITEM_USE_TYPE_NONE: { messagePlayerError(client, getLocaleString(client, "ItemDoesntDoAnythingOnUse", itemTypeData.name)); break; } @@ -1652,7 +1652,7 @@ function playerDropItem(client, hotBarSlot) { updatePlayerHotBar(client); clearPlayerWeapons(client); - getItemData(itemId).ownerType = VRR_ITEM_OWNER_GROUND; + getItemData(itemId).ownerType = AGRP_ITEM_OWNER_GROUND; getItemData(itemId).ownerId = 0; getItemData(itemId).position = getPosInFrontOfPos(getPlayerPosition(client), getPlayerHeading(client), getItemTypeData(getItemData(itemId).itemTypeIndex).dropFrontDistance); getItemData(itemId).dimension = getPlayerDimension(client); @@ -1670,42 +1670,42 @@ function playerPutItem(client, hotBarSlot) { let bestNewOwner = getBestNewOwnerToPutItem(client); - //if (bestNewOwner[0] == VRR_ITEM_OWNER_NONE) { + //if (bestNewOwner[0] == AGRP_ITEM_OWNER_NONE) { // return false; //} switch (bestNewOwner[0]) { - case VRR_ITEM_OWNER_ITEM: + case AGRP_ITEM_OWNER_ITEM: getItemData(itemId).ownerId = getItemData(bestNewOwner[1]).databaseId; getItemData(bestNewOwner[1]).itemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} in the ${getItemName(bestNewOwner[1])}`); break; - case VRR_ITEM_OWNER_VEHTRUNK: + case AGRP_ITEM_OWNER_VEHTRUNK: getItemData(itemId).ownerId = getVehicleData(bestNewOwner[1]).databaseId; getVehicleData(bestNewOwner[1]).trunkItemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} in the ${getVehicleName(getVehicleFromDatabaseId(bestNewOwner[1]))}'s trunk`); break; - case VRR_ITEM_OWNER_VEHDASH: + case AGRP_ITEM_OWNER_VEHDASH: getItemData(itemId).ownerId = getVehicleData(bestNewOwner[1]).databaseId; getVehicleData(bestNewOwner[1]).dashItemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} in the ${getVehicleName(getVehicleFromDatabaseId(bestNewOwner[1]))}'s dash compartment`); break; - case VRR_ITEM_OWNER_HOUSE: + case AGRP_ITEM_OWNER_HOUSE: getItemData(itemId).ownerId = getHouseData(bestNewOwner[1]).databaseId; getHouseData(bestNewOwner[1]).itemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} in the house`); break; - case VRR_ITEM_OWNER_BIZFLOOR: + case AGRP_ITEM_OWNER_BIZFLOOR: getItemData(itemId).ownerId = getBusinessData(bestNewOwner[1]).databaseId; getBusinessData(bestNewOwner[1]).floorItemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} for sale in the business`); break; - case VRR_ITEM_OWNER_BIZSTORAGE: + case AGRP_ITEM_OWNER_BIZSTORAGE: getItemData(itemId).ownerId = getBusinessData(bestNewOwner[1]).databaseId; getBusinessData(bestNewOwner[1]).storageItemCache.push(itemId); meActionToNearbyPlayers(client, `puts ${getProperDeterminerForName(getItemName(itemId))} ${getItemName(itemId)} in the business storage room`); @@ -1731,7 +1731,7 @@ function playerPickupItem(client, itemId) { let firstSlot = getPlayerFirstEmptyHotBarSlot(client); if (firstSlot != -1) { - getItemData(itemId).ownerType = VRR_ITEM_OWNER_PLAYER; + getItemData(itemId).ownerType = AGRP_ITEM_OWNER_PLAYER; getItemData(itemId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getItemData(itemId).position = toVector3(0.0, 0.0, 0.0); getItemData(itemId).dimension = 0; @@ -1753,34 +1753,34 @@ function playerTakeItem(client, itemId) { let ownerId = getItemIdFromDatabaseId(getItemData(itemId).ownerId); - getItemData(itemId).ownerType = VRR_ITEM_OWNER_PLAYER; + getItemData(itemId).ownerType = AGRP_ITEM_OWNER_PLAYER; getItemData(itemId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getPlayerData(client).hotBarItems[firstSlot] = itemId; updatePlayerHotBar(client); switch (bestOwner[1]) { - case VRR_ITEM_OWNER_HOUSE: + case AGRP_ITEM_OWNER_HOUSE: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromHouse", getItemName(itemId))); break; - case VRR_ITEM_OWNER_BIZFLOOR: + case AGRP_ITEM_OWNER_BIZFLOOR: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromBusiness", getItemName(itemId))); break; - case VRR_ITEM_OWNER_BIZSTORAGE: + case AGRP_ITEM_OWNER_BIZSTORAGE: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromBusinessStorage", getItemName(itemId))); break; - case VRR_ITEM_OWNER_VEHTRUNK: + case AGRP_ITEM_OWNER_VEHTRUNK: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromVehicleTrunk", getItemName(itemId))); break; - case VRR_ITEM_OWNER_VEHDASH: + case AGRP_ITEM_OWNER_VEHDASH: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromVehicleDash", getItemName(itemId))); break; - case VRR_ITEM_OWNER_ITEM: + case AGRP_ITEM_OWNER_ITEM: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromItem", getItemName(itemId)), getItemName(ownerId)); break; } @@ -1828,28 +1828,28 @@ function playerSwitchItem(client, newHotBarSlot) { if (newHotBarItem != -1) { if (getItemData(newHotBarItem)) { - if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == VRR_ITEM_USE_TYPE_WEAPON) { + if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WEAPON) { if (getItemData(newHotBarItem).value > 0 || isMeleeWeapon(toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId))) { givePlayerWeapon(client, toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId), toInteger(getItemData(newHotBarItem).value), true, true); setPlayerWeaponDamageEnabled(client, true); - setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_NORMAL); + setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); } else { let ammoItemSlot = getPlayerFirstAmmoItemForWeapon(client, getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId); if (ammoItemSlot != false) { getItemData(newHotBarItem).value = getItemData(getPlayerData(client).hotBarItems[ammoItemSlot]).value; givePlayerWeapon(client, toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId), toInteger(getItemData(newHotBarItem).value), true, true); setPlayerWeaponDamageEnabled(client, true); - setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_NORMAL); + setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); deleteItem(getPlayerData(client).hotBarItems[ammoItemSlot]); } else { messagePlayerError(client, getLocaleString(client, "ItemUnequippableNoAmmo", getItemName(newHotBarItem), newHotBarSlot)); } } - } else if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == VRR_ITEM_USE_TYPE_TAZER) { + } else if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_TAZER) { if (getItemData(newHotBarItem).value > 0) { givePlayerWeapon(client, toInteger(getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useId), toInteger(getItemData(newHotBarItem).value), true, true); setPlayerWeaponDamageEnabled(client, false); - setPlayerWeaponDamageEvent(client, VRR_WEAPON_DAMAGE_EVENT_TAZER); + setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_TAZER); } else { messagePlayerError(client, getLocaleString(client, "ItemUnequippableNoAmmo", getItemName(newHotBarItem), newHotBarSlot)); } @@ -1912,7 +1912,7 @@ function playerSwitchHotBarSlotCommand(command, params, client) { } } - if (getPlayerData(client).itemActionState != VRR_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -1976,7 +1976,7 @@ function setAllItemTypeDataIndexes() { function cacheAllGroundItems() { clearArray(getServerData().groundItemCache); for (let i in getServerData().items) { - if (getServerData().items[i].ownerType == VRR_ITEM_OWNER_GROUND) { + if (getServerData().items[i].ownerType == AGRP_ITEM_OWNER_GROUND) { getServerData().groundItemCache.push(i); } } @@ -2020,7 +2020,7 @@ function cachePlayerHotBarItems(client) { } for (let i in getServerData().items) { - if (getItemData(i).ownerType == VRR_ITEM_OWNER_PLAYER) { + if (getItemData(i).ownerType == AGRP_ITEM_OWNER_PLAYER) { if (getItemData(i).ownerId == getPlayerCurrentSubAccount(client).databaseId) { let firstSlot = getPlayerFirstEmptyHotBarSlot(client); if (firstSlot != -1) { @@ -2037,13 +2037,13 @@ function deleteItem(itemId, whoDeleted = -1) { let owner = -1; let ownerTypeString = "Unknown"; switch (getItemData(itemId).ownerType) { - case VRR_ITEM_OWNER_GROUND: + case AGRP_ITEM_OWNER_GROUND: ownerTypeString = "Ground/Dropped"; deleteGroundItemObject(itemId); getServerData().groundItemCache.splice(getServerData().groundItemCache.indexOf(itemId), 1); break; - case VRR_ITEM_OWNER_PLAYER: + case AGRP_ITEM_OWNER_PLAYER: ownerTypeString = "Player"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2053,7 +2053,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_TEMPLOCKER: + case AGRP_ITEM_OWNER_TEMPLOCKER: ownerTypeString = "Job Locker"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2061,7 +2061,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_LOCKER: + case AGRP_ITEM_OWNER_LOCKER: ownerTypeString = "Locker"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2069,7 +2069,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_VEHTRUNK: + case AGRP_ITEM_OWNER_VEHTRUNK: ownerTypeString = "Vehicle Trunk"; owner = getVehicleFromDatabaseId(getItemData(itemId).ownerId) if (getVehicleData(owner) != false) { @@ -2077,7 +2077,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_BIZFLOOR: + case AGRP_ITEM_OWNER_BIZFLOOR: ownerTypeString = "Business Floor"; owner = getBusinessIdFromDatabaseId(getItemData(itemId).ownerId); if (getBusinessData(owner) != false) { @@ -2085,7 +2085,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_BIZSTORAGE: + case AGRP_ITEM_OWNER_BIZSTORAGE: ownerTypeString = "Business Storage"; owner = getBusinessIdFromDatabaseId(getItemData(itemId).ownerId); if (getBusinessData(owner) != false) { @@ -2093,7 +2093,7 @@ function deleteItem(itemId, whoDeleted = -1) { } break; - case VRR_ITEM_OWNER_HOUSE: + case AGRP_ITEM_OWNER_HOUSE: ownerTypeString = "House"; owner = getHouseIdFromDatabaseId(getItemData(itemId).ownerId); if (getHouseData(owner) != false) { @@ -2118,32 +2118,32 @@ function getBestNewOwnerToPutItem(client) { let possibleHouse = getPlayerHouse(client); if (possibleHouse != -1) { if (getHouseData(possibleHouse) != false) { - return [VRR_ITEM_OWNER_HOUSE, possibleHouse]; + return [AGRP_ITEM_OWNER_HOUSE, possibleHouse]; } } let possibleBusiness = getPlayerBusiness(client); if (possibleBusiness != -1) { if (getBusinessData(possibleBusiness) != false) { - return [VRR_ITEM_OWNER_BIZSTORAGE, possibleBusiness]; + return [AGRP_ITEM_OWNER_BIZSTORAGE, possibleBusiness]; } } let possibleVehicle = getClosestVehicle(position); if (possibleVehicle != false) { if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) { - return [VRR_ITEM_OWNER_VEHTRUNK, possibleVehicle]; + return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle]; } } let possibleItem = getClosestItemOnGround(position); if (possibleItem != -1) { if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) { - return [VRR_ITEM_OWNER_ITEM, possibleItem]; + return [AGRP_ITEM_OWNER_ITEM, possibleItem]; } } - return [VRR_ITEM_OWNER_NONE, 0]; + return [AGRP_ITEM_OWNER_NONE, 0]; } // =========================================================================== @@ -2152,14 +2152,14 @@ function getBestItemToTake(client, slot) { let closestDistance = 100.0; let position = getPlayerPosition(client); let itemId = -1; - let ownerType = VRR_ITEM_OWNER_NONE; + let ownerType = AGRP_ITEM_OWNER_NONE; let ownerId = 0; let possibleHouse = getPlayerHouse(client); if (getHouseData(possibleHouse)) { if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") { itemId = getHouseData(possibleHouse).itemCache[slot]; - ownerType = VRR_ITEM_OWNER_HOUSE; + ownerType = AGRP_ITEM_OWNER_HOUSE; ownerId = possibleHouse; } } @@ -2168,7 +2168,7 @@ function getBestItemToTake(client, slot) { if (getBusinessData(possibleBusiness)) { if (typeof getBusinessData(possibleBusiness).floorItemCache[slot] != "undefined") { itemId = getBusinessData(possibleBusiness).floorItemCache[slot]; - ownerType = VRR_ITEM_OWNER_BIZFLOOR; + ownerType = AGRP_ITEM_OWNER_BIZFLOOR; ownerId = possibleBusiness; } } @@ -2178,7 +2178,7 @@ function getBestItemToTake(client, slot) { if (getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= closestDistance) { if (typeof getVehicleData(possibleVehicle).trunkItemCache[slot] != "undefined") { itemId = getVehicleData(possibleVehicle).trunkItemCache[slot]; - ownerType = VRR_ITEM_OWNER_VEHTRUNK; + ownerType = AGRP_ITEM_OWNER_VEHTRUNK; ownerId = possibleVehicle; } } @@ -2315,7 +2315,7 @@ function listItemInventoryCommand(command, params, client) { return false; } - if (getItemTypeData(getItemData(itemId).itemTypeIndex).useType != VRR_ITEM_USE_TYPE_STORAGE) { + if (getItemTypeData(getItemData(itemId).itemTypeIndex).useType != AGRP_ITEM_USE_TYPE_STORAGE) { messagePlayerError(client, "This item can't hold anything!"); return false; } @@ -2558,7 +2558,7 @@ function restorePlayerTempLockerItems(client) { cachePlayerHotBarItems(client); updatePlayerHotBar(client); - getPlayerData(client).tempLockerType = VRR_TEMP_LOCKER_TYPE_NONE; + getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE; } // =========================================================================== @@ -2588,27 +2588,27 @@ function getItemTypeIndexFromDatabaseId(databaseId) { function playerItemActionDelayComplete(client) { logToConsole(LOG_VERBOSE, `[VRR.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`); switch (getPlayerData(client).itemActionState) { - case VRR_ITEM_ACTION_USE: + case AGRP_ITEM_ACTION_USE: playerUseItem(client, getPlayerData(client).itemActionItem); break; - case VRR_ITEM_ACTION_DROP: + case AGRP_ITEM_ACTION_DROP: playerDropItem(client, getPlayerData(client).itemActionItem); break; - case VRR_ITEM_ACTION_TAKE: + case AGRP_ITEM_ACTION_TAKE: playerTakeItem(client, getPlayerData(client).itemActionItem); break; - case VRR_ITEM_ACTION_PUT: + case AGRP_ITEM_ACTION_PUT: playerPutItem(client, getPlayerData(client).itemActionItem); break; - case VRR_ITEM_ACTION_PICKUP: + case AGRP_ITEM_ACTION_PICKUP: playerPickupItem(client, getPlayerData(client).itemActionItem); break; - case VRR_ITEM_ACTION_SWITCH: + case AGRP_ITEM_ACTION_SWITCH: playerSwitchItem(client, getPlayerData(client).itemActionItem); break; @@ -2636,20 +2636,20 @@ function getItemValueDisplayForItem(itemId) { // =========================================================================== function getItemValueDisplay(itemType, value) { - if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_SKIN) { + if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_SKIN) { return "any"; - } else if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_FOOD || getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_DRINK || getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_EXTINGUISHER || getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_SPRAYPAINT || getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_PEPPERSPRAY) { + } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_FOOD || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_DRINK || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_EXTINGUISHER || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_SPRAYPAINT || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_PEPPERSPRAY) { return getPercentage(toString(value), getItemTypeData(itemType).capacity) + "%"; - } else if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_PHONE) { + } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_PHONE) { return toString(value); - } else if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_WEAPON || getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_TAZER) { + } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_WEAPON || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_TAZER) { if (isMeleeWeapon(getItemTypeData(itemType).useId)) { return false; } return toString(value) + " rounds"; - } else if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_WALKIETALKIE) { + } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { return toString(toString(value).slice(0, -2) + "." + toString(value).slice(-1) + "MHz"); - } else if (getItemTypeData(itemType).useType == VRR_ITEM_USE_TYPE_VEHCOLOUR) { + } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_VEHCOLOUR) { return `[${getGameConfig().vehicleColourHex[value]}]SAMPLE[#FFFFFF]`; } else { return value; @@ -2838,42 +2838,42 @@ function getOrderPriceForItemType(itemType) { function clearPlayerItemActionState(client) { if (getPlayerData(client).itemActionItem != -1) { switch (getPlayerData(client).itemActionState) { - case VRR_ITEM_ACTION_DROP: { + case AGRP_ITEM_ACTION_DROP: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).dropAnimationIndex != -1) { makePlayerStopAnimation(client); } break; } - case VRR_ITEM_ACTION_USE: { + case AGRP_ITEM_ACTION_USE: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).useAnimationIndex != -1) { makePlayerStopAnimation(client); } break; } - case VRR_ITEM_ACTION_PICKUP: { + case AGRP_ITEM_ACTION_PICKUP: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).pickupAnimationIndex != -1) { makePlayerStopAnimation(client); } break; } - case VRR_ITEM_ACTION_TAKE: { + case AGRP_ITEM_ACTION_TAKE: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).takeAnimationIndex != -1) { makePlayerStopAnimation(client); } break; } - case VRR_ITEM_ACTION_PUT: { + case AGRP_ITEM_ACTION_PUT: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).putAnimationIndex != -1) { makePlayerStopAnimation(client); } break; } - case VRR_ITEM_ACTION_SWITCH: { + case AGRP_ITEM_ACTION_SWITCH: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).switchAnimationIndex != -1) { makePlayerStopAnimation(client); } @@ -2882,7 +2882,7 @@ function clearPlayerItemActionState(client) { } } - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_NONE; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_NONE; getPlayerData(client).itemActionItem = -1; } @@ -3012,7 +3012,7 @@ function showHouseInventoryToPlayer(client, houseId) { function switchPlayerActiveHotBarSlot(client, slotId) { getPlayerData(client).itemActionItem = slotId; - getPlayerData(client).itemActionState = VRR_ITEM_ACTION_SWITCH; + getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_SWITCH; if (slotId != -1) { showPlayerItemSwitchDelay(client, slotId); } @@ -3038,14 +3038,14 @@ function isPlayerItemFromJobEquipment(client, hotBarSlot) { function getItemPosition(itemId) { switch (getItemData(itemId).ownerType) { - case VRR_ITEM_OWNER_PLAYER: + case AGRP_ITEM_OWNER_PLAYER: return getPlayerPosition(getPlayerFromCharacterId(getItemData(itemId).ownerId)); - case VRR_ITEM_OWNER_VEHDASH: - case VRR_ITEM_OWNER_VEHTRUNK: + case AGRP_ITEM_OWNER_VEHDASH: + case AGRP_ITEM_OWNER_VEHTRUNK: return getVehiclePosition(getVehicleFromDatabaseId(getItemData(itemId).ownerId)); - case VRR_ITEM_OWNER_GROUND: + case AGRP_ITEM_OWNER_GROUND: return getItemData(itemId).position; } } @@ -3081,7 +3081,7 @@ function getPlayerFirstAmmoItemForWeapon(client, weaponId) { for (let i in getPlayerData(client).hotBarItems) { if (getPlayerData(client).hotBarItems[i] != -1) { if (getItemData(getPlayerData(client).hotBarItems[i]) != false) { - if (getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useType == VRR_ITEM_USE_TYPE_AMMO_CLIP) { + if (getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { if (getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useId == weaponId) { return i; } @@ -3096,7 +3096,7 @@ function getPlayerFirstAmmoItemForWeapon(client, weaponId) { // =========================================================================== function getItemPosition(itemId) { - if (getItemData(itemId).ownerType == VRR_ITEM_OWNER_GROUND) { + if (getItemData(itemId).ownerType == AGRP_ITEM_OWNER_GROUND) { if (getItemData(itemId).object != null) { return getElementPosition(getItemData(itemId).object); } @@ -3118,7 +3118,7 @@ function cacheAllItemItems() { function cacheItemItems(itemId) { let items = getServerData().items; for (let i in items) { - if (items[i].ownerType == VRR_ITEM_OWNER_ITEM && items[i].ownerId == getItemData(itemId).databaseId) { + if (items[i].ownerType == AGRP_ITEM_OWNER_ITEM && items[i].ownerId == getItemData(itemId).databaseId) { getItemData(itemId).itemCache.push(i); } } diff --git a/scripts/server/job.js b/scripts/server/job.js index 7e34c41b..7724a074 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -8,26 +8,26 @@ // =========================================================================== // Job Types -const VRR_JOB_NONE = 0; -const VRR_JOB_POLICE = 1; -const VRR_JOB_MEDICAL = 2; -const VRR_JOB_FIRE = 3; -const VRR_JOB_BUS = 4; -const VRR_JOB_TAXI = 5; -const VRR_JOB_GARBAGE = 6; -const VRR_JOB_WEAPON = 7; -const VRR_JOB_DRUG = 8; -const VRR_JOB_PIZZA = 9; -const VRR_JOB_GENERIC = 10; +const AGRP_JOB_NONE = 0; +const AGRP_JOB_POLICE = 1; +const AGRP_JOB_MEDICAL = 2; +const AGRP_JOB_FIRE = 3; +const AGRP_JOB_BUS = 4; +const AGRP_JOB_TAXI = 5; +const AGRP_JOB_GARBAGE = 6; +const AGRP_JOB_WEAPON = 7; +const AGRP_JOB_DRUG = 8; +const AGRP_JOB_PIZZA = 9; +const AGRP_JOB_GENERIC = 10; // =========================================================================== // Job Route States -const VRR_JOBROUTESTATE_NONE = 0; // None -const VRR_JOBROUTESTATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one. -const VRR_JOBROUTESTATE_LASTSTOP = 2; // Player is heading to the last stop on the route -const VRR_JOBROUTESTATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume -const VRR_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one +const AGRP_JOBROUTESTATE_NONE = 0; // None +const AGRP_JOBROUTESTATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one. +const AGRP_JOBROUTESTATE_LASTSTOP = 2; // Player is heading to the last stop on the route +const AGRP_JOBROUTESTATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume +const AGRP_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one // =========================================================================== @@ -42,7 +42,7 @@ class JobData { constructor(dbAssoc = false) { this.databaseId = 0; this.serverId = 0; - this.type = VRR_JOB_NONE; + this.type = AGRP_JOB_NONE; this.name = "Unnamed"; this.enabled = true; this.blipModel = -1 @@ -633,9 +633,9 @@ function createAllJobPickups() { for (let j in getServerData().jobs[i].locations) { pickupCount++; getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position); - setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", VRR_PICKUP_JOB, false); + setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.id", j, false); - setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", VRR_LABEL_JOB, true); + setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", AGRP_LABEL_JOB, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.name", getServerData().jobs[i].name, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.jobType", getServerData().jobs[i].databaseId, true); setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false); @@ -662,7 +662,7 @@ function showJobInformationToPlayer(client, jobType) { } switch (jobType) { - case VRR_JOB_POLICE: + case AGRP_JOB_POLICE: if (!canPlayerUsePoliceJob(client)) { return false; } @@ -675,7 +675,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_MEDICAL: + case AGRP_JOB_MEDICAL: messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "- Paramedics help people by healing them."); messagePlayerInfo(client, "- Use /startwork at the hospital to work as a Paramedic."); @@ -684,7 +684,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_FIRE: + case AGRP_JOB_FIRE: if (!canClientUseFireJob(client)) { return false; } @@ -696,7 +696,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_BUS: + case AGRP_JOB_BUS: messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "- Bus Drivers transport people around the city on a route"); messagePlayerInfo(client, "- Use /startwork at the bus depot to work as a Bus Driver."); @@ -705,7 +705,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_TAXI: + case AGRP_JOB_TAXI: messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "- Taxi Drivers transport people around the city"); messagePlayerInfo(client, "- Use /startwork at the taxi depot to work as a Taxi Driver."); @@ -715,7 +715,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_GARBAGE: + case AGRP_JOB_GARBAGE: messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "- Garbage Collectors pick up the trash around the city."); messagePlayerInfo(client, "- Use /startwork at the garbage depot to work as a Garbage Collector."); @@ -726,10 +726,10 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case VRR_JOB_WEAPON: + case AGRP_JOB_WEAPON: break; - case VRR_JOB_DRUG: + case AGRP_JOB_DRUG: break; default: @@ -771,7 +771,7 @@ function takeJobCommand(command, params, client) { return false; } - if (getPlayerCurrentSubAccount(client).job > VRR_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job > AGRP_JOB_NONE) { messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}")); return false; } @@ -803,7 +803,7 @@ function startWorkingCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -815,7 +815,7 @@ function startWorkingCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { messagePlayerError(client, "You don't have a job!"); messagePlayerInfo(client, "You can get a job by going the yellow points on the map."); return false; @@ -871,41 +871,41 @@ function startWorking(client) { switchPlayerActiveHotBarSlot(client, -1); getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client); storePlayerItemsInTempLocker(client); - getPlayerData(client).tempLockerType = VRR_TEMP_LOCKER_TYPE_JOB; + getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB; messagePlayerInfo(client, "Your personal items have been stored in your locker while you work"); getPlayerCurrentSubAccount(client).isWorking = true; let jobId = getPlayerCurrentSubAccount(client).job; switch (getJobIndexFromDatabaseId(jobId)) { - case VRR_JOB_POLICE: + case AGRP_JOB_POLICE: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case VRR_JOB_MEDICAL: + case AGRP_JOB_MEDICAL: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case VRR_JOB_FIRE: + case AGRP_JOB_FIRE: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case VRR_JOB_BUS: + case AGRP_JOB_BUS: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus"))); break; - case VRR_JOB_TAXI: + case AGRP_JOB_TAXI: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi"))); break; - case VRR_JOB_GARBAGE: + case AGRP_JOB_GARBAGE: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck"))); break; - case VRR_JOB_WEAPON: + case AGRP_JOB_WEAPON: break; - case VRR_JOB_DRUG: + case AGRP_JOB_DRUG: break; default: @@ -944,10 +944,10 @@ function givePlayerJobEquipment(client, equipmentId) { for (let i in getJobData(jobId).equipment[equipmentId].items) { let value = getJobData(jobId).equipment[equipmentId].items[i].value - if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == VRR_ITEM_USE_TYPE_WALKIETALKIE) { + if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { value = getJobData(jobId).walkieTalkieFrequency; } - let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); + let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); getItemData(itemId).needsSaved = false; getItemData(itemId).databaseId = -1; // Make sure it doesnt save let freeSlot = getPlayerFirstEmptyHotBarSlot(client); @@ -996,37 +996,37 @@ function stopWorking(client) { messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} has stopped working as a ${getJobData(jobId).name}`); switch (getJobType(jobId)) { - case VRR_JOB_POLICE: + case AGRP_JOB_POLICE: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station"); break; - case VRR_JOB_MEDICAL: + case AGRP_JOB_MEDICAL: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital"); break; - case VRR_JOB_FIRE: + case AGRP_JOB_FIRE: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station"); break; - case VRR_JOB_BUS: + case AGRP_JOB_BUS: messagePlayerInfo(client, "Your vehicle has been returned to the bus depot"); break; - case VRR_JOB_TAXI: + case AGRP_JOB_TAXI: messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot"); break; - case VRR_JOB_GARBAGE: + case AGRP_JOB_GARBAGE: messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump"); break; - case VRR_JOB_WEAPON: + case AGRP_JOB_WEAPON: break; - case VRR_JOB_DRUG: + case AGRP_JOB_DRUG: break; - case VRR_JOB_GENERIC: + case AGRP_JOB_GENERIC: messagePlayerInfo(client, "Your vehicle has been respawned at your job location"); break; @@ -1062,7 +1062,7 @@ function jobUniformCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -1074,7 +1074,7 @@ function jobUniformCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { messagePlayerError(client, getLocaleString(client, "NotYourJob")); messagePlayerInfo(client, getLocaleString(client, "JobPoints")); return false; @@ -1147,7 +1147,7 @@ function jobEquipmentCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != VRR_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -1159,7 +1159,7 @@ function jobEquipmentCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == VRR_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { messagePlayerError(client, getLocaleString(client, "NotYourJob")); messagePlayerInfo(client, getLocaleString(client, "JobPoints")); return false; @@ -2047,7 +2047,7 @@ function jobStopRouteCommand(command, params, client) { return false; } - //if(!doesPlayerHaveJobType(client, VRR_JOB_BUS) && !doesPlayerHaveJobType(client, VRR_JOB_GARBAGE)) { + //if(!doesPlayerHaveJobType(client, AGRP_JOB_BUS) && !doesPlayerHaveJobType(client, AGRP_JOB_GARBAGE)) { // messagePlayerError(client, "Your job doesn't use a route!"); // return false; //} @@ -2752,9 +2752,9 @@ function createJobLocationPickup(jobId, locationId) { tempJobData.locations[locationId].pickup = pickup; setElementDimension(pickup, tempJobData.locations[locationId].dimension); setElementOnAllDimensions(pickup, false); - setEntityData(pickup, "agrp.owner.type", VRR_PICKUP_JOB, false); + setEntityData(pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false); setEntityData(pickup, "agrp.owner.id", locationId, false); - setEntityData(pickup, "agrp.label.type", VRR_LABEL_JOB, true); + setEntityData(pickup, "agrp.label.type", AGRP_LABEL_JOB, true); setEntityData(pickup, "agrp.label.name", tempJobData.name, true); setEntityData(pickup, "agrp.label.jobType", tempJobData.databaseId, true); addToWorld(pickup); diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 6228a3fa..0a0f53f9 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -8,43 +8,43 @@ // =========================================================================== // Pickup Types -const VRR_PICKUP_NONE = 0; -const VRR_PICKUP_JOB = 1; -const VRR_PICKUP_BUSINESS_ENTRANCE = 2; -const VRR_PICKUP_BUSINESS_EXIT = 3; -const VRR_PICKUP_HOUSE_ENTRANCE = 4; -const VRR_PICKUP_HOUSE_EXIT = 5; -const VRR_PICKUP_EXIT = 6; +const AGRP_PICKUP_NONE = 0; +const AGRP_PICKUP_JOB = 1; +const AGRP_PICKUP_BUSINESS_ENTRANCE = 2; +const AGRP_PICKUP_BUSINESS_EXIT = 3; +const AGRP_PICKUP_HOUSE_ENTRANCE = 4; +const AGRP_PICKUP_HOUSE_EXIT = 5; +const AGRP_PICKUP_EXIT = 6; // =========================================================================== // Blip Owner Types -const VRR_BLIP_NONE = 0; -const VRR_BLIP_JOB = 1; -const VRR_BLIP_BUSINESS_ENTRANCE = 2; -const VRR_BLIP_BUSINESS_EXIT = 3; -const VRR_BLIP_HOUSE_ENTRANCE = 4; -const VRR_BLIP_HOUSE_EXIT = 5; -const VRR_BLIP_EXIT = 6; +const AGRP_BLIP_NONE = 0; +const AGRP_BLIP_JOB = 1; +const AGRP_BLIP_BUSINESS_ENTRANCE = 2; +const AGRP_BLIP_BUSINESS_EXIT = 3; +const AGRP_BLIP_HOUSE_ENTRANCE = 4; +const AGRP_BLIP_HOUSE_EXIT = 5; +const AGRP_BLIP_EXIT = 6; // =========================================================================== // Ped States -const VRR_PEDSTATE_NONE = 2; // None -const VRR_PEDSTATE_READY = 1; // Ready -const VRR_PEDSTATE_DRIVER = 2; // Driving a vehicle -const VRR_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger -const VRR_PEDSTATE_DEAD = 4; // Dead -const VRR_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property -const VRR_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property -const VRR_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle -const VRR_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle -const VRR_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs -const VRR_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer -const VRR_PEDSTATE_INTRUNK = 11; // In vehicle trunk -const VRR_PEDSTATE_INITEM = 12; // In item (crate, box, etc) -const VRR_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering) -const VRR_PEDSTATE_SPAWNING = 14; // Spawning +const AGRP_PEDSTATE_NONE = 2; // None +const AGRP_PEDSTATE_READY = 1; // Ready +const AGRP_PEDSTATE_DRIVER = 2; // Driving a vehicle +const AGRP_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger +const AGRP_PEDSTATE_DEAD = 4; // Dead +const AGRP_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property +const AGRP_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property +const AGRP_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle +const AGRP_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle +const AGRP_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs +const AGRP_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer +const AGRP_PEDSTATE_INTRUNK = 11; // In vehicle trunk +const AGRP_PEDSTATE_INITEM = 12; // In item (crate, box, etc) +const AGRP_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering) +const AGRP_PEDSTATE_SPAWNING = 14; // Spawning // =========================================================================== @@ -74,7 +74,7 @@ function toggleMouseCursorCommand(command, params, client) { // =========================================================================== function toggleMouseCameraCommand(command, params, client) { - if (getGame() != VRR_GAME_GTA_VC) { + if (getGame() != AGRP_GAME_GTA_VC) { sendPlayerMouseCameraToggle(client); } return true; @@ -172,25 +172,25 @@ function enterExitPropertyCommand(command, params, client) { let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id"); switch (ownerType) { - case VRR_PICKUP_BUSINESS_ENTRANCE: + case AGRP_PICKUP_BUSINESS_ENTRANCE: isBusiness = true; isEntrance = true; closestProperty = getServerData().businesses[ownerId]; break; - case VRR_PICKUP_BUSINESS_EXIT: + case AGRP_PICKUP_BUSINESS_EXIT: isBusiness = true; isEntrance = false; closestProperty = getServerData().businesses[ownerId]; break; - case VRR_PICKUP_HOUSE_ENTRANCE: + case AGRP_PICKUP_HOUSE_ENTRANCE: isBusiness = false; isEntrance = true; closestProperty = getServerData().houses[ownerId]; break; - case VRR_PICKUP_HOUSE_EXIT: + case AGRP_PICKUP_HOUSE_EXIT: isBusiness = false; isEntrance = false; closestProperty = getServerData().houses[ownerId]; @@ -248,7 +248,7 @@ function enterExitPropertyCommand(command, params, client) { } clearPlayerStateToEnterExitProperty(client); - getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY; + getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY; meActionToNearbyPlayers(client, getLocaleString(client, "EntersProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); if (isFadeCameraSupported()) { @@ -272,7 +272,7 @@ function enterExitPropertyCommand(command, params, client) { }, 1100); if (isBusiness) { - if (closestProperty.entranceType == VRR_PROPERTY_ENTRANCE_TYPE_PAINTBALL) { + if (closestProperty.entranceType == AGRP_PROPERTY_ENTRANCE_TYPE_PAINTBALL) { messagePlayerAlert(client, getLocaleString(client, "JoinedPaintBall")); startPaintBall(client); } @@ -292,7 +292,7 @@ function enterExitPropertyCommand(command, params, client) { meActionToNearbyPlayers(client, getLocaleString(client, "EnterExitPropertyDoorLocked", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); return false; } - getPlayerData(client).pedState = VRR_PEDSTATE_EXITINGPROPERTY; + getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY; clearPlayerStateToEnterExitProperty(client) meActionToNearbyPlayers(client, getLocaleString(client, "ExitsProperty", (isBusiness) ? getLocaleString(client, "Business") : getLocaleString(client, "House"))); @@ -317,7 +317,7 @@ function enterExitPropertyCommand(command, params, client) { }, 1100); if (isBusiness) { - if (closestProperty.entranceType == VRR_PROPERTY_ENTRANCE_TYPE_PAINTBALL) { + if (closestProperty.entranceType == AGRP_PROPERTY_ENTRANCE_TYPE_PAINTBALL) { messagePlayerAlert(client, getLocaleString(client, "LeftPaintBall")); stopPaintBall(client); } @@ -515,7 +515,7 @@ function stuckPlayerCommand(command, params, client) { messagePlayerAlert(client, getLocaleString(client, "FixingStuck")); if (getGameConfig().skinChangePosition[getGame()].length > 0) { - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) { messagePlayerAlert(client, "You canceled the skin change."); restorePlayerCamera(client); @@ -529,11 +529,11 @@ function stuckPlayerCommand(command, params, client) { getPlayerData(client).returnToInterior = null; getPlayerData(client).returnToDimension = null; - getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_NONE; + getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_NONE; } } - //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_ADMINGET) { + //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_ADMINGET) { // messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`); // return false; //} diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 99d71e81..05b7ad83 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -180,7 +180,7 @@ function getVehicleHeading(vehicle) { // =========================================================================== function setVehicleHeading(vehicle, heading) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); } return vehicle.heading = heading; @@ -214,7 +214,7 @@ function getVehicleSyncer(vehicle) { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { if (getVehicleData(vehicle).ivNetworkId != -1) { return getVehicleData(vehicle).ivNetworkId; } @@ -254,7 +254,7 @@ function removePlayerFromVehicle(client) { function setPlayerSkin(client, skinIndex) { logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); } else { getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; @@ -635,15 +635,15 @@ function createGamePed(modelIndex, position, heading, toClient = null) { // =========================================================================== function getIsland(position) { - if (getGame() == VRR_GAME_GTA_III) { + if (getGame() == AGRP_GAME_GTA_III) { if (position.x > 616) { - return VRR_ISLAND_PORTLAND; + return AGRP_ISLAND_PORTLAND; } else if (position.x < -283) { - return VRR_ISLAND_SHORESIDEVALE; + return AGRP_ISLAND_SHORESIDEVALE; } - return VRR_ISLAND_STAUNTON; + return AGRP_ISLAND_STAUNTON; } else { - return VRR_ISLAND_NONE; + return AGRP_ISLAND_NONE; } //return game.getIslandFromPosition(position); @@ -955,7 +955,7 @@ function setConstantsAsGlobalVariablesInDatabase() { let entries = Object.entries(global); for (let i in entries) { logToConsole(LOG_DEBUG, `[VRR.Database] Checking entry ${i} (${entries[i]})`); - if (toString(i).slice(0, 3).indexOf("VRR_") != -1) { + if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) { logToConsole(LOG_DEBUG, `[VRR.Database] Adding ${i} (${entries[i]}) to database global variables`); } } @@ -1078,7 +1078,7 @@ function getClosestCivilian(position) { // =========================================================================== function getVehiclesInRange(position, range) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j); } return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range); @@ -1111,7 +1111,7 @@ function getVehicleFirstEmptySeat(vehicle) { // =========================================================================== function isVehicleTrain(vehicle) { - if (getGame() == VRR_GAME_GTA_III) { + if (getGame() == AGRP_GAME_GTA_III) { if (vehicle.modelIndex == 124) { return true; } @@ -1179,7 +1179,7 @@ function setElementStreamOutDistance(element, distance) { // =========================================================================== function getPlayerPed(client) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { return getPlayerData(client).ped; } else { return client.player; diff --git a/scripts/server/native/ragemp.js b/scripts/server/native/ragemp.js index 7f19492d..a4a7c5aa 100644 --- a/scripts/server/native/ragemp.js +++ b/scripts/server/native/ragemp.js @@ -180,7 +180,7 @@ function getVehicleHeading(vehicle) { // =========================================================================== function setVehicleHeading(vehicle, heading) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); } return vehicle.heading = heading; @@ -214,7 +214,7 @@ function getVehicleSyncer(vehicle) { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { if (getVehicleData(vehicle).ivNetworkId != -1) { return getVehicleData(vehicle).ivNetworkId; } @@ -254,7 +254,7 @@ function removePlayerFromVehicle(client) { function setPlayerSkin(client, skinIndex) { logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); } else { getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; @@ -955,7 +955,7 @@ function getClosestCivilian(position) { // =========================================================================== function getVehiclesInRange(position, range) { - if (getGame() == VRR_GAME_GTA_IV) { + if (getGame() == AGRP_GAME_GTA_IV) { return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j); } return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range); @@ -1124,7 +1124,7 @@ function despawnPlayer(client) { // =========================================================================== function getGame() { - return VRR_GAME_GTA_V; + return AGRP_GAME_GTA_V; } // =========================================================================== diff --git a/scripts/server/netevents.js b/scripts/server/netevents.js index e47a5134..fcf32c89 100644 --- a/scripts/server/netevents.js +++ b/scripts/server/netevents.js @@ -666,7 +666,7 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`); switch (getPlayerData(damagerEntity).weaponDamageEvent) { - case VRR_WEAPON_DAMAGE_EVENT_TAZER: + case AGRP_WEAPON_DAMAGE_EVENT_TAZER: logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`); if (!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) { logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`); @@ -675,13 +675,13 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he } break; - case VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH: + case AGRP_WEAPON_DAMAGE_EVENT_EXTINGUISH: break; - case VRR_WEAPON_DAMAGE_EVENT_MACE: + case AGRP_WEAPON_DAMAGE_EVENT_MACE: break; - case VRR_WEAPON_DAMAGE_EVENT_NORMAL: + case AGRP_WEAPON_DAMAGE_EVENT_NORMAL: logToConsole(LOG_DEBUG, `[VRR.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`); setPlayerHealth(client, getPlayerHealth(client) - (healthLoss * getPlayerData(client).incomingDamageMultiplier)); break; @@ -737,7 +737,7 @@ function forcePlayerIntoSkinSelect(client) { getPlayerData(client).returnToHeading = getPlayerHeading(client); getPlayerData(client).returnToInterior = getPlayerInterior(client); getPlayerData(client).returnToDimension = getPlayerDimension(client); - getPlayerData(client).returnToType = VRR_RETURNTO_TYPE_SKINSELECT; + getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_SKINSELECT; setPlayerPosition(client, getGameConfig().skinChangePosition[getGame()][0]); setPlayerHeading(client, getGameConfig().skinChangePosition[getGame()][1]); @@ -888,7 +888,7 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) { messagePlayerAlert(client, "You canceled the skin change."); restorePlayerCamera(client); - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) { setPlayerPosition(client, getPlayerData(client).returnToPosition); setPlayerHeading(client, getPlayerData(client).returnToHeading); setPlayerInterior(client, getPlayerData(client).returnToInterior); @@ -909,7 +909,7 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) { setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); } - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == VRR_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) { setPlayerPosition(client, getPlayerData(client).returnToPosition); setPlayerHeading(client, getPlayerData(client).returnToHeading); setPlayerInterior(client, getPlayerData(client).returnToInterior); diff --git a/scripts/server/npc.js b/scripts/server/npc.js index 73d2002c..36f38c5a 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -8,27 +8,27 @@ // =========================================================================== // NPC Trigger Condition Match Types -const VRR_NPC_COND_MATCH_NONE = 0; // None (invalid) -const VRR_NPC_COND_MATCH_EQ = 1; // Must be equal to -const VRR_NPC_COND_MATCH_GT = 2; // Must be greater than -const VRR_NPC_COND_MATCH_LT = 3; // Must be less than -const VRR_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to -const VRR_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to -const VRR_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive) -const VRR_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive) -const VRR_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive) -const VRR_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive) +const AGRP_NPC_COND_MATCH_NONE = 0; // None (invalid) +const AGRP_NPC_COND_MATCH_EQ = 1; // Must be equal to +const AGRP_NPC_COND_MATCH_GT = 2; // Must be greater than +const AGRP_NPC_COND_MATCH_LT = 3; // Must be less than +const AGRP_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to +const AGRP_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to +const AGRP_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive) +const AGRP_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive) +const AGRP_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive) +const AGRP_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive) // =========================================================================== // NPC Owner Types -const VRR_NPC_OWNER_NONE = 0; // Not owned -const VRR_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) -const VRR_NPC_OWNER_JOB = 2; // Owned by a job -const VRR_NPC_OWNER_CLAN = 3; // Owned by a clan -const VRR_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) -const VRR_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it. -const VRR_NPC_OWNER_BIZ = 6; // Owned by a business +const AGRP_NPC_OWNER_NONE = 0; // Not owned +const AGRP_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const AGRP_NPC_OWNER_JOB = 2; // Owned by a job +const AGRP_NPC_OWNER_CLAN = 3; // Owned by a clan +const AGRP_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const AGRP_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it. +const AGRP_NPC_OWNER_BIZ = 6; // Owned by a business // =========================================================================== @@ -55,14 +55,14 @@ class NPCData { this.fightStyle = 0; this.health = 100; this.armour = 100; - this.currentAction = VRR_NPC_ACTION_NONE; + this.currentAction = AGRP_NPC_ACTION_NONE; this.triggers = []; this.typeFlags = 0; this.heedThreats = false; this.threats = 0; this.invincible = false; this.animationName = ""; - this.ownerType = VRR_NPC_OWNER_NONE; + this.ownerType = AGRP_NPC_OWNER_NONE; this.ownerId = 0; this.bodyParts = { @@ -617,28 +617,28 @@ function getNPCInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (npcData.ownerType) { - case VRR_NPC_OWNER_CLAN: + case AGRP_NPC_OWNER_CLAN: ownerName = getClanData(getClanIdFromDatabaseId(npcData.ownerId)).name; ownerType = "clan"; break; - case VRR_NPC_OWNER_JOB: + case AGRP_NPC_OWNER_JOB: ownerName = getJobData(getJobIdFromDatabaseId(npcData.ownerId)).name; ownerType = "job"; break; - case VRR_NPC_OWNER_PLAYER: + case AGRP_NPC_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(npcData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case VRR_NPC_OWNER_BIZ: + case AGRP_NPC_OWNER_BIZ: ownerName = getBusinessData(getBusinessIdFromDatabaseId(npcData.ownerId)).name; ownerType = "business"; break; - case VRR_NPC_OWNER_PUBLIC: + case AGRP_NPC_OWNER_PUBLIC: ownerName = "Nobody"; ownerType = "public"; break; diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 4705c391..19a0c888 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -8,21 +8,21 @@ // =========================================================================== // Vehicle Owner Types -const VRR_VEHOWNER_NONE = 0; // Not owned -const VRR_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount) -const VRR_VEHOWNER_JOB = 2; // Owned by a job -const VRR_VEHOWNER_CLAN = 3; // Owned by a clan -const VRR_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment) -const VRR_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it. -const VRR_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses) +const AGRP_VEHOWNER_NONE = 0; // Not owned +const AGRP_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const AGRP_VEHOWNER_JOB = 2; // Owned by a job +const AGRP_VEHOWNER_CLAN = 3; // Owned by a clan +const AGRP_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const AGRP_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it. +const AGRP_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses) // =========================================================================== // Vehicle Seats -const VRR_VEHSEAT_DRIVER = 0; -const VRR_VEHSEAT_FRONTPASSENGER = 1; -const VRR_VEHSEAT_REARLEFTPASSENGER = 2; -const VRR_VEHSEAT_REARRIGHTPASSENGER = 3; +const AGRP_VEHSEAT_DRIVER = 0; +const AGRP_VEHSEAT_FRONTPASSENGER = 1; +const AGRP_VEHSEAT_REARLEFTPASSENGER = 2; +const AGRP_VEHSEAT_REARRIGHTPASSENGER = 3; // =========================================================================== @@ -47,7 +47,7 @@ class VehicleData { this.syncHeading = 0.0; // Ownership - this.ownerType = VRR_VEHOWNER_NONE; + this.ownerType = AGRP_VEHOWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.rentPrice = 0; @@ -336,7 +336,7 @@ function spawnAllVehicles() { * @return {VehicleData} The vehicles's data (class instance) */ function getVehicleData(vehicle) { - if (getGame() != VRR_GAME_GTA_IV) { + if (getGame() != AGRP_GAME_GTA_IV) { if (isVehicleObject(vehicle)) { let dataIndex = getEntityData(vehicle, "agrp.dataSlot"); if (typeof getServerData().vehicles[dataIndex] != "undefined") { @@ -366,7 +366,7 @@ function createVehicleCommand(command, params, client) { } let heading = getPlayerHeading(client); - if (getGame() == VRR_GAME_MAFIA_ONE) { + if (getGame() == AGRP_GAME_MAFIA_ONE) { heading = degToRad(getPlayerHeading(client)); } @@ -705,7 +705,7 @@ function buyVehicleCommand(command, params, client) { setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true); getVehicleData(vehicle).needsSaved = true; - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle)); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle)); meActionToNearbyPlayers(client, `receives a set of keys to test drive the ${getVehicleName(vehicle)} and starts the engine`); messagePlayerInfo(client, getLocaleString(client, "DealershipPurchaseTestDrive")); getServerData().purchasingVehicleCache.push(client); @@ -800,17 +800,17 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { return true; } - if (vehicleData.ownerType == VRR_VEHOWNER_PUBLIC) { + if (vehicleData.ownerType == AGRP_VEHOWNER_PUBLIC) { return true; } - if (vehicleData.ownerType == VRR_VEHOWNER_PLAYER) { + if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (vehicleData.ownerType == VRR_VEHOWNER_CLAN) { + if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) { if (vehicleData.clanRank <= getPlayerCurrentSubAccount(client).clanRank) { return true; @@ -818,7 +818,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { } } - if (vehicleData.ownerType == VRR_VEHOWNER_FACTION) { + if (vehicleData.ownerType == AGRP_VEHOWNER_FACTION) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).faction) { if (vehicleData.factionRank <= getPlayerCurrentSubAccount(client).factionRank) { return true; @@ -826,7 +826,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { } } - if (vehicleData.ownerType == VRR_VEHOWNER_JOB) { + if (vehicleData.ownerType == AGRP_VEHOWNER_JOB) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).job) { return true; } @@ -848,13 +848,13 @@ function doesClientOwnVehicle(client, vehicle) { return true; } - if (vehicleData.ownerType == VRR_VEHOWNER_PLAYER) { + if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) { if (vehicleData.ownerId == getPlayerData(client).accountData.databaseId) { return true; } } - if (vehicleData.ownerType == VRR_VEHOWNER_CLAN) { + if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) { if (doesPlayerHaveClanPermission(client, "ManageVehicles") || doesPlayerHaveClanPermission(client, "owner")) { return true; @@ -893,7 +893,7 @@ function setVehicleJobCommand(command, params, client) { // return false; //} - getVehicleData(vehicle).ownerType = VRR_VEHOWNER_JOB; + getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_JOB; getVehicleData(vehicle).ownerId = getJobData(jobId).databaseId; getVehicleData(vehicle).needsSaved = true; @@ -922,7 +922,7 @@ function setVehicleRankCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_CLAN) { + if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { rankId = getClanRankFromParams(getVehicleData(vehicle).ownerId, params); if (!getClanRankData(getVehicleData(vehicle).ownerId, rankId)) { messagePlayerError(client, getLocaleString(client, "ClanRankInvalid")); @@ -930,7 +930,7 @@ function setVehicleRankCommand(command, params, client) { } getVehicleData(vehicle).rank = getClanRankData(getVehicleData(vehicle).ownerId, rankId).databaseId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`); - } else if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { + } else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { getVehicleData(vehicle).rank = rankId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`); } @@ -959,7 +959,7 @@ function setVehicleClanCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType != VRR_VEHOWNER_PLAYER) { + if (getVehicleData(vehicle).ownerType != AGRP_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnVehicle")); return false; } @@ -970,7 +970,7 @@ function setVehicleClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetVehicleClanConfirmMessage"), getLocaleString(client, "SetVehicleClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = VRR_PROMPT_GIVEVEHTOCLAN; + getPlayerData(client).promptType = AGRP_PROMPT_GIVEVEHTOCLAN; getVehicleData(vehicle).needsSaved = true; } @@ -996,7 +996,7 @@ function setVehicleToBusinessCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = VRR_VEHOWNER_BIZ; + getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ; getVehicleData(vehicle).ownerId = getBusinessData(businessId).databaseId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to the {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}business`); @@ -1025,7 +1025,7 @@ function setVehicleOwnerCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = VRR_VEHOWNER_PLAYER; + getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER; getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`); @@ -1048,7 +1048,7 @@ function setVehiclePublicCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = VRR_VEHOWNER_PUBLIC; + getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC; getVehicleData(vehicle).ownerId = 0; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`); @@ -1135,7 +1135,7 @@ function removeVehicleOwnerCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = VRR_VEHOWNER_NONE; + getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_NONE; getVehicleData(vehicle).ownerId = 0; getVehicleData(vehicle).needsSaved = true; @@ -1164,28 +1164,28 @@ function getVehicleInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (vehicleData.ownerType) { - case VRR_VEHOWNER_CLAN: + case AGRP_VEHOWNER_CLAN: ownerName = getClanData(getClanIdFromDatabaseId(vehicleData.ownerId)).name; ownerType = "clan"; break; - case VRR_VEHOWNER_JOB: + case AGRP_VEHOWNER_JOB: ownerName = getJobData(getJobIdFromDatabaseId(vehicleData.ownerId)).name; ownerType = "job"; break; - case VRR_VEHOWNER_PLAYER: + case AGRP_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(vehicleData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case VRR_VEHOWNER_BIZ: + case AGRP_VEHOWNER_BIZ: ownerName = getBusinessData(getBusinessIdFromDatabaseId(vehicleData.ownerId)).name; ownerType = "business"; break; - case VRR_VEHOWNER_PUBLIC: + case AGRP_VEHOWNER_PUBLIC: ownerName = "Nobody"; ownerType = "public"; break; @@ -1241,28 +1241,28 @@ function getLastVehicleInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (vehicleData.ownerType) { - case VRR_VEHOWNER_CLAN: + case AGRP_VEHOWNER_CLAN: ownerName = getClanData(vehicleData.ownerId).name; ownerType = "clan"; break; - case VRR_VEHOWNER_JOB: + case AGRP_VEHOWNER_JOB: ownerName = getJobData(vehicleData.ownerId).name; ownerType = "job"; break; - case VRR_VEHOWNER_PLAYER: + case AGRP_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(vehicleData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case VRR_VEHOWNER_BIZ: + case AGRP_VEHOWNER_BIZ: ownerName = getBusinessData(vehicleData.ownerId).name; ownerType = "business"; break; - case VRR_VEHOWNER_PUBLIC: + case AGRP_VEHOWNER_PUBLIC: ownerName = "None"; ownerType = "public"; break; @@ -1369,7 +1369,7 @@ function respawnEmptyVehiclesCommand(command, params, client) { function respawnJobVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_JOB) { + if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_JOB) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1381,7 +1381,7 @@ function respawnJobVehiclesCommand(command, params, client) { function respawnClanVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_CLAN) { + if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_CLAN) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1393,7 +1393,7 @@ function respawnClanVehiclesCommand(command, params, client) { function respawnPlayerVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PLAYER) { + if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PLAYER) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1405,7 +1405,7 @@ function respawnPlayerVehiclesCommand(command, params, client) { function respawnPublicVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_PUBLIC) { + if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PUBLIC) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1417,7 +1417,7 @@ function respawnPublicVehiclesCommand(command, params, client) { function respawnBusinessVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == VRR_VEHOWNER_BIZ) { + if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_BIZ) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1445,7 +1445,7 @@ function respawnVehicle(vehicle) { vehicles[i].engine = false; } - if (vehicles[i].ownerType == VRR_VEHOWNER_JOB) { + if (vehicles[i].ownerType == AGRP_VEHOWNER_JOB) { vehicles[i].locked = true; } @@ -1531,19 +1531,19 @@ function isVehicleAtPayAndSpray(vehicle) { function getVehicleOwnerTypeText(ownerType) { switch (ownerType) { - case VRR_VEHOWNER_CLAN: + case AGRP_VEHOWNER_CLAN: return "clan"; - case VRR_VEHOWNER_JOB: + case AGRP_VEHOWNER_JOB: return "job"; - case VRR_VEHOWNER_PLAYER: + case AGRP_VEHOWNER_PLAYER: return "player"; - case VRR_VEHOWNER_BIZ: + case AGRP_VEHOWNER_BIZ: return "business"; - case VRR_VEHOWNER_PUBLIC: + case AGRP_VEHOWNER_PUBLIC: return "public"; default: @@ -1554,7 +1554,7 @@ function getVehicleOwnerTypeText(ownerType) { // =========================================================================== function isVehicleOwnedByJob(vehicle, jobId) { - if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { + if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { return (getVehicleData(vehicle).ownerId == jobId); } return false; @@ -1588,7 +1588,7 @@ function createNewDealershipVehicle(modelIndex, spawnPosition, spawnRotation, pr tempVehicleData.spawnLocked = true; tempVehicleData.spawnPosition = spawnPosition; tempVehicleData.spawnRotation = spawnRotation; - tempVehicleData.ownerType = VRR_VEHOWNER_BIZ; + tempVehicleData.ownerType = AGRP_VEHOWNER_BIZ; tempVehicleData.ownerId = dealershipId; tempVehicleData.needsSaved = true; tempVehicleData.interior = interior; @@ -1674,22 +1674,22 @@ function processVehiclePurchasing() { function checkVehiclePurchasing(client) { if (!isPlayerLoggedIn(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return false; } if (!isPlayerSpawned(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return false; } if (!getPlayerData(client)) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return false; } if (!getPlayerData(client).buyingVehicle) { - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return false; } @@ -1699,7 +1699,7 @@ function checkVehiclePurchasing(client) { messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle")); respawnVehicle(getPlayerData(client).buyingVehicle); getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); } return false; } @@ -1710,7 +1710,7 @@ function checkVehiclePurchasing(client) { messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney")); respawnVehicle(getPlayerData(client).buyingVehicle); getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return false; } @@ -1719,13 +1719,13 @@ function checkVehiclePurchasing(client) { takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice); updatePlayerCash(client); getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId; - getVehicleData(getPlayerData(client).buyingVehicle).ownerType = VRR_VEHOWNER_PLAYER; + getVehicleData(getPlayerData(client).buyingVehicle).ownerType = AGRP_VEHOWNER_PLAYER; getVehicleData(getPlayerData(client).buyingVehicle).buyPrice = 0; getVehicleData(getPlayerData(client).buyingVehicle).rentPrice = 0; getVehicleData(getPlayerData(client).buyingVehicle).spawnLocked = false; getPlayerData(client).buyingVehicle = false; messagePlayerSuccess(client, getLocaleString(client, "VehiclePurchaseComplete")); - setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); return true; } } @@ -1752,9 +1752,9 @@ function processVehicleBurning() { function cacheAllVehicleItems() { for (let i in getServerData().vehicles) { for (let j in getServerData().items) { - if (getItemData(j).ownerType == VRR_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { + if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { getServerData().vehicles[i].trunkItemCache.push(j); - } else if (getItemData(j).ownerType == VRR_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { + } else if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { getServerData().vehicles[i].dashItemCache.push(j); } } @@ -1781,16 +1781,16 @@ function setAllVehicleIndexes() { // =========================================================================== function doesVehicleHaveMegaphone(vehicle) { - if (getVehicleData(vehicle).ownerType == VRR_VEHOWNER_JOB) { - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_POLICE) { + if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_POLICE) { return true; } - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_FIRE) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_FIRE) { return true; } - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == VRR_JOB_MEDICAL) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_MEDICAL) { return true; } }