From bd29a9f7d5682bac7dd9009ea91b364224df7683 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 19 Dec 2022 10:11:10 -0600 Subject: [PATCH] Change copyright, consts, and net events prefix --- scripts/client/afk.js | 5 +- scripts/client/animation.js | 29 +- scripts/client/business.js | 17 +- scripts/client/camera.js | 5 +- scripts/client/chat.js | 5 +- scripts/client/content.js | 5 +- scripts/client/core.js | 7 +- scripts/client/cursor.js | 5 +- scripts/client/economy.js | 5 +- scripts/client/event.js | 21 +- scripts/client/gps.js | 9 +- scripts/client/gui.js | 9 +- scripts/client/gui/2fa.js | 7 +- scripts/client/gui/bizmgr.js | 7 +- scripts/client/gui/changepass.js | 7 +- scripts/client/gui/charselect.js | 13 +- scripts/client/gui/clanmgr.js | 5 +- scripts/client/gui/error.js | 5 +- scripts/client/gui/games/5cardpoker.js | 5 +- scripts/client/gui/games/betting.js | 5 +- scripts/client/gui/games/blackjack.js | 5 +- scripts/client/gui/housemgr.js | 5 +- scripts/client/gui/info.js | 5 +- scripts/client/gui/inventory.js | 5 +- scripts/client/gui/inventorybulk.js | 5 +- scripts/client/gui/list.js | 11 +- scripts/client/gui/localechooser.js | 5 +- scripts/client/gui/login.js | 9 +- scripts/client/gui/newchar.js | 7 +- scripts/client/gui/register.js | 7 +- scripts/client/gui/resetpass.js | 7 +- scripts/client/gui/yesno.js | 9 +- scripts/client/house.js | 17 +- scripts/client/item.js | 5 +- scripts/client/job.js | 15 +- scripts/client/keybind.js | 5 +- scripts/client/label.js | 77 ++- scripts/client/locale.js | 5 +- scripts/client/logo.js | 9 +- scripts/client/messaging.js | 5 +- scripts/client/nametag.js | 11 +- scripts/client/native/connected.js | 223 ++++--- scripts/client/netevents.js | 273 ++++---- scripts/client/npc.js | 7 +- scripts/client/object.js | 7 +- scripts/client/radio.js | 5 +- scripts/client/scoreboard.js | 5 +- scripts/client/skin-select.js | 15 +- scripts/client/startup.js | 15 +- scripts/client/sync.js | 223 ++++--- scripts/client/token.js | 5 +- scripts/client/utilities.js | 49 +- scripts/client/vehicle.js | 23 +- scripts/server/accent.js | 5 +- scripts/server/account.js | 65 +- scripts/server/animation.js | 15 +- scripts/server/anticheat.js | 11 +- scripts/server/ban.js | 39 +- scripts/server/bank.js | 21 +- scripts/server/bitflag.js | 5 +- scripts/server/business.js | 195 +++--- scripts/server/casino.js | 107 ++- scripts/server/chat.js | 7 +- scripts/server/clan.js | 5 +- scripts/server/client.js | 33 +- scripts/server/command.js | 5 +- scripts/server/config.js | 25 +- scripts/server/core.js | 5 +- scripts/server/crime.js | 5 +- scripts/server/database.js | 5 +- scripts/server/developer.js | 5 +- scripts/server/discord.js | 19 +- scripts/server/economy.js | 11 +- scripts/server/email.js | 15 +- scripts/server/event.js | 81 ++- scripts/server/fishing.js | 85 ++- scripts/server/forensics.js | 21 +- scripts/server/gate.js | 37 +- scripts/server/gps.js | 63 +- scripts/server/gui.js | 5 +- scripts/server/help.js | 5 +- scripts/server/house.js | 121 ++-- scripts/server/insurance.js | 45 +- scripts/server/item.js | 429 ++++++------ scripts/server/item/drink.js | 5 +- scripts/server/item/food.js | 5 +- scripts/server/item/handcuff.js | 11 +- scripts/server/item/phone.js | 13 +- scripts/server/item/rope.js | 11 +- scripts/server/item/tazer.js | 11 +- scripts/server/item/walkie-talkie.js | 13 +- scripts/server/job.js | 233 ++++--- scripts/server/job/bus.js | 5 +- scripts/server/job/drug.js | 5 +- scripts/server/job/fire.js | 5 +- scripts/server/job/garbage.js | 5 +- scripts/server/job/medic.js | 5 +- scripts/server/job/pizza-delivery.js | 5 +- scripts/server/job/police.js | 17 +- scripts/server/job/taxi.js | 7 +- scripts/server/job/weapon.js | 5 +- scripts/server/keybind.js | 13 +- scripts/server/locale.js | 5 +- scripts/server/misc.js | 109 ++- scripts/server/native/connected.js | 61 +- scripts/server/native/ragemp.js | 37 +- scripts/server/netevents.js | 337 +++++----- scripts/server/npc.js | 61 +- scripts/server/paintball.js | 19 +- scripts/server/prompt.js | 73 +- scripts/server/property.js | 193 +++--- scripts/server/race.js | 5 +- scripts/server/radio.js | 9 +- scripts/server/security.js | 5 +- scripts/server/staff.js | 9 +- scripts/server/startup.js | 5 +- scripts/server/subaccount.js | 11 +- scripts/server/theme.js | 5 +- scripts/server/timers.js | 9 +- scripts/server/trigger.js | 219 +++--- scripts/server/tutorial.js | 5 +- scripts/server/utilities.js | 39 +- scripts/server/vehicle.js | 167 +++-- scripts/shared/const.js | 201 +++--- scripts/shared/gamedata.js | 885 ++++++++++++------------- scripts/shared/utilities.js | 21 +- third-party/mexui/mexui.js | 2 +- 127 files changed, 2745 insertions(+), 2871 deletions(-) diff --git a/scripts/client/afk.js b/scripts/client/afk.js index 1c9ced08..e0299442 100644 --- a/scripts/client/afk.js +++ b/scripts/client/afk.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: afk.js // DESC: Provides AFK detection diff --git a/scripts/client/animation.js b/scripts/client/animation.js index 274db151..1c85af40 100644 --- a/scripts/client/animation.js +++ b/scripts/client/animation.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: animation.js // DESC: Provides animation functions and usage @@ -27,7 +26,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { let freezePlayer = false; switch (animationData.moveType) { - case AGRP_ANIMMOVE_FORWARD: { + case V_ANIMMOVE_FORWARD: { setElementCollisionsEnabled(ped, false); if (ped.isSyncer) { setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); @@ -36,7 +35,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { break; } - case AGRP_ANIMMOVE_BACK: { + case V_ANIMMOVE_BACK: { setElementCollisionsEnabled(pedId, false); if (ped.isSyncer) { setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); @@ -45,7 +44,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { break; } - case AGRP_ANIMMOVE_LEFT: { + case V_ANIMMOVE_LEFT: { setElementCollisionsEnabled(pedId, false); if (ped.isSyncer) { setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); @@ -54,7 +53,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { break; } - case AGRP_ANIMMOVE_RIGHT: { + case V_ANIMMOVE_RIGHT: { setElementCollisionsEnabled(pedId, false); if (ped.isSyncer) { setElementPosition(pedId, getPosToRightOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); @@ -68,9 +67,9 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { } } - if (getGame() < AGRP_GAME_GTA_IV) { - if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) { - if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) { + if (getGame() < V_GAME_GTA_IV) { + if (animationData.animType == V_ANIMTYPE_NORMAL || animationData.animType == V_ANIMTYPE_SURRENDER) { + if (getGame() == V_GAME_GTA_VC || getGame() == V_GAME_GTA_SA) { ped.clearAnimations(); } else { ped.clearObjective(); @@ -82,7 +81,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) { setLocalPlayerControlState(false, false); localPlayer.collisionsEnabled = false; } - } else if (animationData.animType == AGRP_ANIMTYPE_BLEND) { + } else if (animationData.animType == V_ANIMTYPE_BLEND) { ped.position = ped.position; ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed); } @@ -103,7 +102,7 @@ function forcePedAnimation(pedId, animSlot) { let animationData = getAnimationData(animSlot); - if (getGame() < AGRP_GAME_GTA_IV) { + if (getGame() < V_GAME_GTA_IV) { ped.position = ped.position; ped.addAnimation(animationData.groupId, animationData.animId); @@ -127,8 +126,8 @@ function makePedStopAnimation(pedId) { return false; } - if (getGame() != AGRP_GAME_GTA_IV) { - if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) { + if (getGame() != V_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_VC || getGame() == V_GAME_GTA_SA) { ped.clearAnimations(); } else { ped.clearObjective(); @@ -136,7 +135,7 @@ function makePedStopAnimation(pedId) { } if (ped == localPlayer) { - if (getGame() != AGRP_GAME_GTA_IV) { + if (getGame() != V_GAME_GTA_IV) { localPlayer.collisionsEnabled = true; } setLocalPlayerControlState(true, false); diff --git a/scripts/client/business.js b/scripts/client/business.js index 7d256938..d52ad960 100644 --- a/scripts/client/business.js +++ b/scripts/client/business.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: business.js // DESC: Provides business functions and usage @@ -39,7 +38,7 @@ function initBusinessScript() { function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems, entranceFee) { logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`); - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { if (getBusinessData(businessId) != false) { let businessData = getBusinessData(businessId); businessData.name = name; @@ -54,12 +53,12 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel businessData.entranceFee = entranceFee; if (hasInterior && !hasItems) { - businessData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER; + businessData.labelInfoType = V_PROPLABEL_INFO_ENTER; } else if (!hasInterior && hasItems) { - businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUY; + businessData.labelInfoType = V_PROPLABEL_INFO_BUY; } else { if (businessData.buyPrice > 0) { - businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUYBIZ; + businessData.labelInfoType = V_PROPLABEL_INFO_BUYBIZ; } } @@ -67,7 +66,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel if (blipModel == -1) { if (businessData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been removed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); } else { destroyElement(getElementFromId(blipId)); @@ -81,7 +80,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel } else { if (businessData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been changed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition); natives.changeBlipSprite(businessData.blipId, businessData.blipModel); natives.setBlipMarkerLongDistance(businessData.blipId, false); diff --git a/scripts/client/camera.js b/scripts/client/camera.js index 88e7649b..8d788fc1 100644 --- a/scripts/client/camera.js +++ b/scripts/client/camera.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: camera.js // DESC: Provides camera functions and usage diff --git a/scripts/client/chat.js b/scripts/client/chat.js index 13bc908d..2d1a5e23 100644 --- a/scripts/client/chat.js +++ b/scripts/client/chat.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: chatbox.js // DESC: Provides extra chatbox features diff --git a/scripts/client/content.js b/scripts/client/content.js index f77e4304..4b33fb9c 100644 --- a/scripts/client/content.js +++ b/scripts/client/content.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: content.js // DESC: Provides connection to extra content resources diff --git a/scripts/client/core.js b/scripts/client/core.js index 2300e5c8..e10400bb 100644 --- a/scripts/client/core.js +++ b/scripts/client/core.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: main.js // DESC: Main client script (will be reorganized into individual files later) @@ -65,7 +64,7 @@ let mouseCursorEnabled = false; let currentPickup = false; -let vehiclePurchaseState = AGRP_VEHBUYSTATE_NONE; +let vehiclePurchaseState = V_VEHBUYSTATE_NONE; let vehiclePurchasing = null; let vehiclePurchasePosition = null; diff --git a/scripts/client/cursor.js b/scripts/client/cursor.js index f1b231fe..7e19c4fb 100644 --- a/scripts/client/cursor.js +++ b/scripts/client/cursor.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: cursor.js // DESC: Provides cursor functions and usage diff --git a/scripts/client/economy.js b/scripts/client/economy.js index 9f5b54d2..eb1cd329 100644 --- a/scripts/client/economy.js +++ b/scripts/client/economy.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: economy.js // DESC: Provides economy functions diff --git a/scripts/client/event.js b/scripts/client/event.js index 717deb69..4313e47e 100644 --- a/scripts/client/event.js +++ b/scripts/client/event.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: event.js // DESC: Provides handlers for built in GTAC and Asshat-Gaming created events @@ -42,7 +41,7 @@ function addAllEventHandlers() { } } - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { addEventHandler("OnMapLoaded", onMapLoaded); } } @@ -166,7 +165,7 @@ function onElementStreamIn(event, element) { function onPedExitedVehicle(event, ped, vehicle, seat) { //logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`); - //sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); + //sendNetworkEventToServer("v.rp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); cruiseControlEnabled = false; cruiseControlSpeed = 0.0; @@ -190,7 +189,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) { function onPedExitingVehicle(event, ped, vehicle, seat) { //logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`); - //sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); + //sendNetworkEventToServer("v.rp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); if (localPlayer != null) { if (ped == localPlayer) { @@ -204,7 +203,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) { function onPedEnteredVehicle(event, ped, vehicle, seat) { logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`); - //sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); + //sendNetworkEventToServer("v.rp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); cruiseControlEnabled = false; cruiseControlSpeed = 0.0; @@ -215,9 +214,9 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) { if (inVehicleSeat == 0) { //parkedVehiclePosition = inVehicle.position; //parkedVehicleHeading = inVehicle.heading; - if (doesEntityDataExist(vehicle, "agrp.server") == true) { + if (doesEntityDataExist(vehicle, "v.rp.server") == true) { //setVehicleEngine(vehicle.id, false); - setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine")); + setVehicleEngine(vehicle.id, getEntityData(vehicle, "v.rp.engine")); //setLocalPlayerControlState(false, false); } } @@ -238,7 +237,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt if (!weaponDamageEnabled[damagerEntity.name]) { preventDefaultEventAction(event); } - sendNetworkEventToServer("agrp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); + sendNetworkEventToServer("v.rp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); } } } @@ -297,7 +296,7 @@ function onEntityProcess(event, entity) { // =========================================================================== function onMapLoaded(mapName) { - sendNetworkEventToServer("agrp.mapLoaded", mapName); + sendNetworkEventToServer("v.rp.mapLoaded", mapName); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/gps.js b/scripts/client/gps.js index 4e1e2c6c..600e56e7 100644 --- a/scripts/client/gps.js +++ b/scripts/client/gps.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gps.js // DESC: Provides GPS functions and usage @@ -18,8 +17,8 @@ let gpsBlipBlinkTimer = null; function showGPSLocation(position, colour) { logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`); - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { - if (getGame() == AGRP_GAME_GTA_SA) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { + if (getGame() == V_GAME_GTA_SA) { // Server-side spheres don't show in GTA SA for some reason. gpsSphere = game.createPickup(1318, position, 1); } else { diff --git a/scripts/client/gui.js b/scripts/client/gui.js index f0d06d73..03886e7e 100644 --- a/scripts/client/gui.js +++ b/scripts/client/gui.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gui.js // DESC: Provides GUI functionality and styles (using MexUI) @@ -76,7 +75,7 @@ function initGUI() { logToConsole(LOG_DEBUG, `[AGRP.GUI] All GUI created successfully!`); - sendNetworkEventToServer("agrp.guiReady", true); + sendNetworkEventToServer("v.rp.guiReady", true); }; // =========================================================================== @@ -277,7 +276,7 @@ function processGUIKeyPress(keyCode) { function processToggleGUIKeyPress(keyCode) { if (keyCode == disableGUIKey) { - sendNetworkEventToServer("agrp.toggleGUI"); + sendNetworkEventToServer("v.rp.toggleGUI"); } } diff --git a/scripts/client/gui/2fa.js b/scripts/client/gui/2fa.js index 0f26a31b..33fc08a4 100644 --- a/scripts/client/gui/2fa.js +++ b/scripts/client/gui/2fa.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: 2fa.js // DESC: Provides two factor authentication GUI @@ -130,7 +129,7 @@ function twoFactorAuthSuccess() { function checkTwoFactorAuth() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking two-factor authentication with server ...`); - sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]); + sendNetworkEventToServer("v.rp.2fa", twoFactorAuth.codeInput.lines[0]); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/gui/bizmgr.js b/scripts/client/gui/bizmgr.js index 27c80221..1929454d 100644 --- a/scripts/client/gui/bizmgr.js +++ b/scripts/client/gui/bizmgr.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: bizmgr.js // DESC: Provides business manager GUI @@ -78,7 +77,7 @@ function receiveBusinessManagerData(businessIndex, name, locked, entranceFee, bu // =========================================================================== function saveBusinessData() { - sendNetworkEventToServer("agrp.businessManagerSave", businessManager.data.businessIndex); + sendNetworkEventToServer("v.rp.businessManagerSave", businessManager.data.businessIndex); } */ diff --git a/scripts/client/gui/changepass.js b/scripts/client/gui/changepass.js index 2c9bb077..f2770a23 100644 --- a/scripts/client/gui/changepass.js +++ b/scripts/client/gui/changepass.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: changepass.js // DESC: Provides change password GUI @@ -129,7 +128,7 @@ function passwordChangeFailed(errorMessage) { function checkChangePassword() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password change with server ...`); - sendNetworkEventToServer("agrp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]); + sendNetworkEventToServer("v.rp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]); } // =========================================================================== diff --git a/scripts/client/gui/charselect.js b/scripts/client/gui/charselect.js index 846fb409..b5cd2838 100644 --- a/scripts/client/gui/charselect.js +++ b/scripts/client/gui/charselect.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: charselect.js // DESC: Provides character select GUI @@ -187,21 +186,21 @@ function showNewCharacter() { function selectNextCharacter() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`); - sendNetworkEventToServer("agrp.nextCharacter"); + sendNetworkEventToServer("v.rp.nextCharacter"); } // =========================================================================== function selectPreviousCharacter() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`); - sendNetworkEventToServer("agrp.previousCharacter"); + sendNetworkEventToServer("v.rp.previousCharacter"); } // =========================================================================== function selectThisCharacter() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Tell server the current shown character was selected in character select window`); - sendNetworkEventToServer("agrp.selectCharacter"); + sendNetworkEventToServer("v.rp.selectCharacter"); } // =========================================================================== @@ -218,7 +217,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s if (characterSelect.skinImage != null) { characterSelect.skinImage.remove(); } - 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.skinImage = (getGame() == V_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/gui/clanmgr.js b/scripts/client/gui/clanmgr.js index 05111540..ccb71959 100644 --- a/scripts/client/gui/clanmgr.js +++ b/scripts/client/gui/clanmgr.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: clanmgr.js // DESC: Provides clan manager GUI diff --git a/scripts/client/gui/error.js b/scripts/client/gui/error.js index 0926736a..499c17e3 100644 --- a/scripts/client/gui/error.js +++ b/scripts/client/gui/error.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: error.js // DESC: Provides error box GUI diff --git a/scripts/client/gui/games/5cardpoker.js b/scripts/client/gui/games/5cardpoker.js index 47ecbfa0..7e64b238 100644 --- a/scripts/client/gui/games/5cardpoker.js +++ b/scripts/client/gui/games/5cardpoker.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: 5cardpoker.js // DESC: Provides 5-card poker games GUI diff --git a/scripts/client/gui/games/betting.js b/scripts/client/gui/games/betting.js index fcfad194..317cae5d 100644 --- a/scripts/client/gui/games/betting.js +++ b/scripts/client/gui/games/betting.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: betting.js // DESC: Provides betting GUI (used for multiple casino games) diff --git a/scripts/client/gui/games/blackjack.js b/scripts/client/gui/games/blackjack.js index 5d65747a..aa975ad5 100644 --- a/scripts/client/gui/games/blackjack.js +++ b/scripts/client/gui/games/blackjack.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: blackjack.js // DESC: Provides blackjack game GUI diff --git a/scripts/client/gui/housemgr.js b/scripts/client/gui/housemgr.js index 1c421d6e..52fa037e 100644 --- a/scripts/client/gui/housemgr.js +++ b/scripts/client/gui/housemgr.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: housemgr.js // DESC: Provides house manager GUI diff --git a/scripts/client/gui/info.js b/scripts/client/gui/info.js index 8be960d4..c6d1d4ad 100644 --- a/scripts/client/gui/info.js +++ b/scripts/client/gui/info.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: info.js // DESC: Provides info dialog box GUI diff --git a/scripts/client/gui/inventory.js b/scripts/client/gui/inventory.js index fcfd1a45..bfc78f74 100644 --- a/scripts/client/gui/inventory.js +++ b/scripts/client/gui/inventory.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: inventory.js // DESC: Provides inventory dialog box GUI diff --git a/scripts/client/gui/inventorybulk.js b/scripts/client/gui/inventorybulk.js index d311a5d9..97ae538f 100644 --- a/scripts/client/gui/inventorybulk.js +++ b/scripts/client/gui/inventorybulk.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: inventorybulk.js // DESC: Provides bulk inventory box GUI diff --git a/scripts/client/gui/list.js b/scripts/client/gui/list.js index 4aef6fdd..4c48951b 100644 --- a/scripts/client/gui/list.js +++ b/scripts/client/gui/list.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: list.js // DESC: Provides simple list GUI @@ -96,7 +95,7 @@ function checkListDialogSelection() { return false; } - sendNetworkEventToServer("agrp.list.select", listDialog.listGrid.activeRow.getEntryIndex()); + sendNetworkEventToServer("v.rp.list.select", listDialog.listGrid.activeRow.getEntryIndex()); } // =========================================================================== @@ -113,7 +112,7 @@ function selectPreviousListItem() { listDialog.listGrid.activeRow = listDialog.listRows[activeRowId - 1]; } - //sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex()); + //sendNetworkEventToServer("v.rp.list.next", listDialog.listGrid.activeRow.getEntryIndex()); } // =========================================================================== @@ -126,7 +125,7 @@ function selectNextListItem() { listDialog.listGrid.activeRow = listDialog.listRows[activeRowId + 1]; } - //sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex()); + //sendNetworkEventToServer("v.rp.list.next", listDialog.listGrid.activeRow.getEntryIndex()); } // =========================================================================== diff --git a/scripts/client/gui/localechooser.js b/scripts/client/gui/localechooser.js index db3b26e1..ab9f0e64 100644 --- a/scripts/client/gui/localechooser.js +++ b/scripts/client/gui/localechooser.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: localechooser.js // DESC: Provides locale chooser GUI diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js index 15e06828..2cf4b885 100644 --- a/scripts/client/gui/login.js +++ b/scripts/client/gui/login.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: login.js // DESC: Provides login GUI @@ -166,7 +165,7 @@ function showLoginGUI() { function checkLogin() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking login with server ...`); - sendNetworkEventToServer("agrp.checkLogin", login.passwordInput.lines[0]); + sendNetworkEventToServer("v.rp.checkLogin", login.passwordInput.lines[0]); } // =========================================================================== @@ -192,7 +191,7 @@ function switchToPasswordResetGUI() { //closeAllWindows(); //logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset dialog window`); //showResetPasswordGUI(); - sendNetworkEventToServer("agrp.checkResetPassword", ""); + sendNetworkEventToServer("v.rp.checkResetPassword", ""); return false; } diff --git a/scripts/client/gui/newchar.js b/scripts/client/gui/newchar.js index c568bc8d..e39b1b98 100644 --- a/scripts/client/gui/newchar.js +++ b/scripts/client/gui/newchar.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: newchar.js // DESC: Provides new character creation GUI @@ -144,7 +143,7 @@ function checkNewCharacter() { return false; } - sendNetworkEventToServer("agrp.checkNewCharacter", + sendNetworkEventToServer("v.rp.checkNewCharacter", newCharacter.firstNameInput.lines[0], newCharacter.lastNameInput.lines[0], ); diff --git a/scripts/client/gui/register.js b/scripts/client/gui/register.js index 7c352591..ce3e448f 100644 --- a/scripts/client/gui/register.js +++ b/scripts/client/gui/register.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: register.js // DESC: Provides account registration GUI @@ -149,7 +148,7 @@ function registrationFailed(errorMessage) { function checkRegistration() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking registration with server ...`); - sendNetworkEventToServer("agrp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]); + sendNetworkEventToServer("v.rp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]); } // =========================================================================== diff --git a/scripts/client/gui/resetpass.js b/scripts/client/gui/resetpass.js index 1cf9c59c..3b6cf59f 100644 --- a/scripts/client/gui/resetpass.js +++ b/scripts/client/gui/resetpass.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: resetpass.js // DESC: Provides password reset GUI @@ -143,7 +142,7 @@ function showResetPasswordGUI() { function checkResetPassword() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`); - sendNetworkEventToServer("agrp.checkResetPassword", passwordReset.emailInput.lines[0]); + sendNetworkEventToServer("v.rp.checkResetPassword", passwordReset.emailInput.lines[0]); } // =========================================================================== diff --git a/scripts/client/gui/yesno.js b/scripts/client/gui/yesno.js index 26ceb89d..7eeaeebe 100644 --- a/scripts/client/gui/yesno.js +++ b/scripts/client/gui/yesno.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: yesno.js // DESC: Provides yes/no prompt dialog GUI @@ -101,7 +100,7 @@ function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonT function yesNoDialogAnswerNo() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer NO to server prompt`); - sendNetworkEventToServer("agrp.promptAnswerNo"); + sendNetworkEventToServer("v.rp.promptAnswerNo"); closeAllWindows(); } @@ -109,7 +108,7 @@ function yesNoDialogAnswerNo() { function yesNoDialogAnswerYes() { logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer YES to server prompt`); - sendNetworkEventToServer("agrp.promptAnswerYes"); + sendNetworkEventToServer("v.rp.promptAnswerYes"); closeAllWindows(); } diff --git a/scripts/client/house.js b/scripts/client/house.js index f31ec154..c444d9c8 100644 --- a/scripts/client/house.js +++ b/scripts/client/house.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: house.js // DESC: Provides house functions and usage @@ -29,7 +28,7 @@ class HouseData { function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { logToConsole(LOG_DEBUG, `[AGRP.House] Received house ${houseId} (${name}) from server`); - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { if (getHouseData(houseId) != false) { let houseData = getHouseData(houseId); houseData.description = description; @@ -42,12 +41,12 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode houseData.locked = locked; if (houseData.buyPrice > 0) { - houseData.labelInfoType = AGRP_PROPLABEL_INFO_BUYHOUSE; + houseData.labelInfoType = V_PROPLABEL_INFO_BUYHOUSE; } else { if (houseData.rentPrice > 0) { - houseData.labelInfoType = AGRP_PROPLABEL_INFO_RENTHOUSE; + houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE; } else { - houseData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER; + houseData.labelInfoType = V_PROPLABEL_INFO_ENTER; } } @@ -55,7 +54,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode if (blipModel == -1) { if (houseData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been removed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); } else { destroyElement(getElementFromId(blipId)); @@ -67,7 +66,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode } else { if (houseData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been changed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setBlipCoordinates(houseData.blipId, houseData.entrancePosition); natives.changeBlipSprite(houseData.blipId, houseData.blipModel); natives.setBlipMarkerLongDistance(houseData.blipId, false); diff --git a/scripts/client/item.js b/scripts/client/item.js index 6513adb9..8b5d07fa 100644 --- a/scripts/client/item.js +++ b/scripts/client/item.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: item.js // DESC: Provides item action and hotbar functions diff --git a/scripts/client/job.js b/scripts/client/job.js index 1e7fff6f..5932c441 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: job.js // DESC: Provides job functions and usage @@ -59,8 +58,8 @@ function setLocalPlayerWorkingState(tempWorking) { function showJobRouteLocation(position, colour) { logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`); hideJobRouteLocation(); - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { - if (getGame() == AGRP_GAME_GTA_SA) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { + if (getGame() == V_GAME_GTA_SA) { // Server-side spheres don't show in GTA SA for some reason. jobRouteLocationSphere = game.createPickup(1318, position, 1); } else { @@ -140,7 +139,7 @@ function hideJobRouteLocation() { function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) { logToConsole(LOG_DEBUG, `[AGRP.Job] Received job ${jobId} (${name}) from server`); - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { if (getJobData(jobId) != false) { let jobData = getJobData(jobId); jobData.jobLocationId = jobLocationId; @@ -153,7 +152,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p if (blipModel == -1) { if (jobData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been removed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.removeBlipAndClearIndex(getJobData(jobId).blipId); } else { destroyElement(getElementFromId(blipId)); @@ -165,7 +164,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p } else { if (jobData.blipId != -1) { logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been changed by the server`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setBlipCoordinates(jobData.blipId, jobData.position); natives.changeBlipSprite(jobData.blipId, jobData.blipModel); natives.setBlipMarkerLongDistance(jobData.blipId, false); diff --git a/scripts/client/keybind.js b/scripts/client/keybind.js index fe0b5b03..29be6d32 100644 --- a/scripts/client/keybind.js +++ b/scripts/client/keybind.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: keybind.js // DESC: Provides keybind features diff --git a/scripts/client/label.js b/scripts/client/label.js index b8ae4c6e..582ec825 100644 --- a/scripts/client/label.js +++ b/scripts/client/label.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: labels.js // DESC: Provides functionality for world labels (3D labels) @@ -14,7 +13,7 @@ let jobLabels = []; let propertyLabelNameFont = null; let propertyLabelLockedFont = null; -let propertyLabelHeight = (getGame() == AGRP_GAME_MAFIA_ONE) ? 2.0 : 1.0; +let propertyLabelHeight = (getGame() == V_GAME_MAFIA_ONE) ? 2.0 : 1.0; let propertyPickupRenderDistance = 75.0; let propertyLabelRenderDistance = 5.0; let propertyLabelLockedOffset = 16; @@ -78,7 +77,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, return false; } - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (!natives.doesViewportExist(natives.getGameViewportId())) { logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); return false; @@ -92,7 +91,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, position = getPosAbovePos(position, propertyLabelHeight); let screenPosition = new Vec3(0.0, 0.0, 0.0); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId()); } else { screenPosition = getScreenFromWorldPosition(position); @@ -137,10 +136,10 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked")); } - if (!locked && labelInfoType != AGRP_PROPLABEL_INFO_NONE) { + if (!locked && labelInfoType != V_PROPLABEL_INFO_NONE) { let infoText = ""; switch (labelInfoType) { - case AGRP_PROPLABEL_INFO_ENTER: { + case V_PROPLABEL_INFO_ENTER: { if (enterPropertyKey) { infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey))); } else { @@ -149,27 +148,27 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price, break; } - case AGRP_PROPLABEL_INFO_BUY: { + case V_PROPLABEL_INFO_BUY: { infoText = getLocaleString("BusinessBuyItemsLabel", "/buy"); break; } - case AGRP_PROPLABEL_INFO_BUYBIZ: { + case V_PROPLABEL_INFO_BUYBIZ: { infoText = getLocaleString("BuyBusinessLabel", "/bizbuy"); break; } - case AGRP_PROPLABEL_INFO_BUYHOUSE: { + case V_PROPLABEL_INFO_BUYHOUSE: { infoText = getLocaleString("BuyHouseLabel", "/housebuy"); break; } - case AGRP_PROPLABEL_INFO_RENTHOUSE: { + case V_PROPLABEL_INFO_RENTHOUSE: { infoText = getLocaleString("RentHouseLabel", "/houserent"); break; } - case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { + case V_PROPLABEL_INFO_ENTERVEHICLE: { infoText = getLocaleString("VehicleDealershipLabel"); break; } @@ -219,7 +218,7 @@ function renderPropertyExitLabel(position) { return false; } - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (!natives.doesViewportExist(natives.getGameViewportId())) { logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); return false; @@ -234,7 +233,7 @@ function renderPropertyExitLabel(position) { let tempPosition = position; tempPosition.z = tempPosition.z + propertyLabelHeight; let screenPosition = new Vec3(0.0, 0.0, 0.0); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId()); } else { screenPosition = getScreenFromWorldPosition(tempPosition); @@ -264,7 +263,7 @@ function renderJobLabel(name, position, jobType) { return false; } - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (!natives.doesViewportExist(natives.getGameViewportId())) { logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); return false; @@ -279,7 +278,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() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId()); } else { screenPosition = getScreenFromWorldPosition(tempPosition); @@ -318,11 +317,11 @@ function renderJobLabel(name, position, jobType) { function processLabelRendering() { if (renderLabels) { - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE) { if (localPlayer != null) { getServerData().businesses.forEach((business) => { if (getDistance(localPlayer.position, business.entrancePosition) <= propertyPickupRenderDistance) { - if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { + if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) { natives.drawColouredCylinder(getPosBelowPos(business.entrancePosition, 1.0), 0.0, 0.0, 0, 153, 255, 255); } @@ -334,7 +333,7 @@ function processLabelRendering() { getServerData().houses.forEach((house) => { if (getDistance(localPlayer.position, house.entrancePosition) <= propertyPickupRenderDistance) { - if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { + if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) { natives.drawColouredCylinder(getPosBelowPos(house.entrancePosition, 1.0), 0.0, 0.0, 0, 200, 0, 255); } @@ -346,7 +345,7 @@ function processLabelRendering() { getServerData().jobs.forEach((job) => { if (getDistance(localPlayer.position, job.position) <= propertyPickupRenderDistance) { - if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { + if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) { natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255); } } @@ -362,47 +361,47 @@ function processLabelRendering() { if (localPlayer != null) { let pickups = getElementsByType(ELEMENT_PICKUP); for (let i in pickups) { - if (pickups[i].getData("agrp.label.type") != null) { + if (pickups[i].getData("v.rp.label.type") != null) { if (getDistance(localPlayer.position, pickups[i].position) <= propertyLabelRenderDistance) { if (!pickups[i].isOnScreen) { let price = "0"; let rentPrice = "0"; let fee = "0"; - let labelInfoType = AGRP_PROPLABEL_INFO_NONE; - if (pickups[i].getData("agrp.label.price") != null) { - price = pickups[i].getData("agrp.label.price"); + let labelInfoType = V_PROPLABEL_INFO_NONE; + if (pickups[i].getData("v.rp.label.price") != null) { + price = pickups[i].getData("v.rp.label.price"); } - if (pickups[i].getData("agrp.label.rentprice") != null) { - rentPrice = pickups[i].getData("agrp.label.rentprice"); + if (pickups[i].getData("v.rp.label.rentprice") != null) { + rentPrice = pickups[i].getData("v.rp.label.rentprice"); } - if (pickups[i].getData("agrp.label.help") != null) { - labelInfoType = pickups[i].getData("agrp.label.help"); + if (pickups[i].getData("v.rp.label.help") != null) { + labelInfoType = pickups[i].getData("v.rp.label.help"); } - if (pickups[i].getData("agrp.label.fee") != null) { - fee = pickups[i].getData("agrp.label.fee"); + if (pickups[i].getData("v.rp.label.fee") != null) { + fee = pickups[i].getData("v.rp.label.fee"); } - switch (pickups[i].getData("agrp.label.type")) { - case AGRP_LABEL_BUSINESS: { - renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType, fee); + switch (pickups[i].getData("v.rp.label.type")) { + case V_LABEL_BUSINESS: { + renderPropertyEntranceLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.locked"), true, price, rentPrice, labelInfoType, fee); break; } - case AGRP_LABEL_HOUSE: { - renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), false, price, rentPrice, labelInfoType); + case V_LABEL_HOUSE: { + renderPropertyEntranceLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.locked"), false, price, rentPrice, labelInfoType); break; } - case AGRP_LABEL_JOB: { - renderJobLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.jobType")); + case V_LABEL_JOB: { + renderJobLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.jobType")); break; } - case AGRP_LABEL_EXIT: { + case V_LABEL_EXIT: { renderPropertyExitLabel(pickups[i].position); break; } diff --git a/scripts/client/locale.js b/scripts/client/locale.js index bdeb29de..e314ecd5 100644 --- a/scripts/client/locale.js +++ b/scripts/client/locale.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: locale.js // DESC: Provides locale functions and usage diff --git a/scripts/client/logo.js b/scripts/client/logo.js index 8f51c260..fffc47b6 100644 --- a/scripts/client/logo.js +++ b/scripts/client/logo.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: logo.js // DESC: Provides logo rendering functions @@ -23,7 +22,7 @@ function initLogoScript() { // =========================================================================== function loadLogoImage() { - //if (getGame() == AGRP_GAME_MAFIA_ONE) { + //if (getGame() == V_GAME_MAFIA_ONE) { // return false; //} @@ -40,7 +39,7 @@ function loadLogoImage() { // =========================================================================== function processLogoRendering() { - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { return false; } diff --git a/scripts/client/messaging.js b/scripts/client/messaging.js index 4a0f2415..73371669 100644 --- a/scripts/client/messaging.js +++ b/scripts/client/messaging.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: messaging.js // DESC: Provides messaging/textdraw functions and usage diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js index 3c7f10c8..04964621 100644 --- a/scripts/client/nametag.js +++ b/scripts/client/nametag.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: nametags.js // DESC: Provides nametag rendering @@ -53,7 +52,7 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) { playerPaused[clientName] = paused; playerPing[clientName] = ping; - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { let client = getPlayerFromParams(clientName); if (client != false) { if (getPlayerPed(client) != null) { @@ -85,8 +84,8 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, // ------------------------------------------- // Health Bar - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { - if (getGame() == AGRP_GAME_GTA_III) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { + if (getGame() == V_GAME_GTA_III) { // Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit if (skin == 109) { y -= 20; diff --git a/scripts/client/native/connected.js b/scripts/client/native/connected.js index 1609e8bb..4b805aa9 100644 --- a/scripts/client/native/connected.js +++ b/scripts/client/native/connected.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods @@ -38,7 +37,7 @@ function getPlayerPosition() { // =========================================================================== function setPlayerPosition(position) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setCharCoordinates(localPlayer, position); } else { localPlayer.position = position; @@ -188,7 +187,7 @@ function getVehiclesInRange(position, range) { // =========================================================================== function createGameBlip(blipModel, position, name = "") { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { let blipId = natives.addBlipForCoord(position); if (blipId) { natives.changeBlipSprite(blipId, blipModel); @@ -232,50 +231,50 @@ function repairVehicle(syncId) { // =========================================================================== function syncVehicleProperties(vehicle) { - if (doesEntityDataExist(vehicle, "agrp.lights")) { - let lightStatus = getEntityData(vehicle, "agrp.lights"); + if (doesEntityDataExist(vehicle, "v.rp.lights")) { + let lightStatus = getEntityData(vehicle, "v.rp.lights"); vehicle.lights = lightStatus; } - if (doesEntityDataExist(vehicle, "agrp.invincible")) { - let invincible = getEntityData(vehicle, "agrp.invincible"); + if (doesEntityDataExist(vehicle, "v.rp.invincible")) { + let invincible = getEntityData(vehicle, "v.rp.invincible"); element.setProofs(invincible, invincible, invincible, invincible, invincible); } - if (doesEntityDataExist(vehicle, "agrp.panelStatus")) { - let panelsStatus = getEntityData(vehicle, "agrp.panelStatus"); + if (doesEntityDataExist(vehicle, "v.rp.panelStatus")) { + let panelsStatus = getEntityData(vehicle, "v.rp.panelStatus"); for (let i in panelsStatus) { vehicle.setPanelStatus(i, panelsStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) { - let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus"); + if (doesEntityDataExist(vehicle, "v.rp.wheelStatus")) { + let wheelsStatus = getEntityData(vehicle, "v.rp.wheelStatus"); for (let i in wheelsStatus) { vehicle.setWheelStatus(i, wheelsStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.lightStatus")) { - let lightStatus = getEntityData(vehicle, "agrp.lightStatus"); + if (doesEntityDataExist(vehicle, "v.rp.lightStatus")) { + let lightStatus = getEntityData(vehicle, "v.rp.lightStatus"); for (let i in lightStatus) { vehicle.setLightStatus(i, lightStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) { - let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight"); + if (doesEntityDataExist(vehicle, "v.rp.suspensionHeight")) { + let suspensionHeight = getEntityData(vehicle, "v.rp.suspensionHeight"); vehicle.setSuspensionHeight(suspensionHeight); } - if (getGame() == AGRP_GAME_GTA_SA) { + if (getGame() == V_GAME_GTA_SA) { let allUpgrades = getGameConfig().vehicleUpgrades[getGame()]; for (let i in allUpgrades) { vehicle.removeUpgrade(i); } - if (doesEntityDataExist(vehicle, "agrp.upgrades")) { - let upgrades = getEntityData(vehicle, "agrp.upgrades"); + if (doesEntityDataExist(vehicle, "v.rp.upgrades")) { + let upgrades = getEntityData(vehicle, "v.rp.upgrades"); for (let i in upgrades) { if (upgrades[i] != 0) { vehicle.addUpgrade(upgrades[i]); @@ -284,12 +283,12 @@ function syncVehicleProperties(vehicle) { } } - if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(vehicle, "agrp.livery")) { - let livery = getEntityData(vehicle, "agrp.livery"); - if (getGame() == AGRP_GAME_GTA_SA) { + if (getGame() == V_GAME_GTA_SA || getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(vehicle, "v.rp.livery")) { + let livery = getEntityData(vehicle, "v.rp.livery"); + if (getGame() == V_GAME_GTA_SA) { vehicle.setPaintJob(livery); - } else if (getGame() == AGRP_GAME_GTA_IV) { + } else if (getGame() == V_GAME_GTA_IV) { vehicle.livery = livery; } } @@ -317,9 +316,9 @@ function doesEntityDataExist(entity, dataName) { // =========================================================================== function syncCivilianProperties(civilian) { - if (getGame() == AGRP_GAME_GTA_III) { - if (doesEntityDataExist(civilian, "agrp.scale")) { - let scaleFactor = getEntityData(civilian, "agrp.scale"); + if (getGame() == V_GAME_GTA_III) { + if (doesEntityDataExist(civilian, "v.rp.scale")) { + let scaleFactor = getEntityData(civilian, "v.rp.scale"); let tempMatrix = civilian.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = civilian.position; @@ -329,79 +328,79 @@ function syncCivilianProperties(civilian) { } } - if (getGame() == AGRP_GAME_GTA_SA) { - if (doesEntityDataExist(civilian, "agrp.fightStyle")) { - let fightStyle = getEntityData(civilian, "agrp.fightStyle"); + if (getGame() == V_GAME_GTA_SA) { + if (doesEntityDataExist(civilian, "v.rp.fightStyle")) { + let fightStyle = getEntityData(civilian, "v.rp.fightStyle"); civilian.setFightStyle(fightStyle[0], fightStyle[1]); } } - if (getGame() == AGRP_GAME_GTA_III) { - if (doesEntityDataExist(civilian, "agrp.walkStyle")) { - let walkStyle = getEntityData(civilian, "agrp.walkStyle"); + if (getGame() == V_GAME_GTA_III) { + if (doesEntityDataExist(civilian, "v.rp.walkStyle")) { + let walkStyle = getEntityData(civilian, "v.rp.walkStyle"); civilian.walkStyle = walkStyle; } } - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) { - let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(civilian, "v.rp.bodyPropHair")) { + let bodyPropHair = getEntityData(civilian, "v.rp.bodyPropHair"); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) { - let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropHead")) { + let bodyPropHead = getEntityData(civilian, "v.rp.bodyPropHead"); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) { - let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropEyes")) { + let bodyPropEyes = getEntityData(civilian, "v.rp.bodyPropEyes"); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(civilian, "v.rp.bodyPropLeftHand"); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(civilian, "v.rp.bodyPropRightHand"); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(civilian, "v.rp.bodyPropLeftWrist"); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist"); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist"); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) { - let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropHip")) { + let bodyPropHip = getEntityData(civilian, "v.rp.bodyPropHip"); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(civilian, "v.rp.bodyPropLeftFoot"); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(civilian, "v.rp.bodyPropRightFoot"); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); } } - if (doesEntityDataExist(civilian, "agrp.anim")) { - let animData = getEntityData(vehicle, "agrp.anim"); + if (doesEntityDataExist(civilian, "v.rp.anim")) { + let animData = getEntityData(vehicle, "v.rp.anim"); civilian.addAnimation(animData[0], animData[1]); } } @@ -415,9 +414,9 @@ function preventDefaultEventAction(event) { // =========================================================================== function syncPlayerProperties(player) { - if (getGame() == AGRP_GAME_GTA_III) { - if (doesEntityDataExist(player, "agrp.scale")) { - let scaleFactor = getEntityData(player, "agrp.scale"); + if (getGame() == V_GAME_GTA_III) { + if (doesEntityDataExist(player, "v.rp.scale")) { + let scaleFactor = getEntityData(player, "v.rp.scale"); let tempMatrix = player.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = player.position; @@ -427,95 +426,95 @@ function syncPlayerProperties(player) { } } - if (getGame() == AGRP_GAME_GTA_SA) { - if (doesEntityDataExist(player, "agrp.fightStyle")) { - let fightStyle = getEntityData(player, "agrp.fightStyle"); + if (getGame() == V_GAME_GTA_SA) { + if (doesEntityDataExist(player, "v.rp.fightStyle")) { + let fightStyle = getEntityData(player, "v.rp.fightStyle"); player.setFightStyle(fightStyle[0], fightStyle[1]); } } - //if(getGame() == AGRP_GAME_GTA_SA) { - // if(doesEntityDataExist(player, "agrp.walkStyle")) { - // let walkStyle = getEntityData(player, "agrp.walkStyle"); + //if(getGame() == V_GAME_GTA_SA) { + // if(doesEntityDataExist(player, "v.rp.walkStyle")) { + // let walkStyle = getEntityData(player, "v.rp.walkStyle"); // player.walkStyle = walkStyle; // } //} - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(player, "agrp.bodyPartHair")) { - let bodyPartHead = getEntityData(player, "agrp.bodyPartHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(player, "v.rp.bodyPartHair")) { + let bodyPartHead = getEntityData(player, "v.rp.bodyPartHair"); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartHead")) { - let bodyPartHead = getEntityData(player, "agrp.bodyPartHead"); + if (doesEntityDataExist(player, "v.rp.bodyPartHead")) { + let bodyPartHead = getEntityData(player, "v.rp.bodyPartHead"); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartUpper")) { - let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper"); + if (doesEntityDataExist(player, "v.rp.bodyPartUpper")) { + let bodyPartUpper = getEntityData(player, "v.rp.bodyPartUpper"); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartLower")) { - let bodyPartLower = getEntityData(player, "agrp.bodyPartLower"); + if (doesEntityDataExist(player, "v.rp.bodyPartLower")) { + let bodyPartLower = getEntityData(player, "v.rp.bodyPartLower"); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); } } - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(player, "agrp.bodyPropHair")) { - let bodyPropHair = getEntityData(player, "agrp.bodyPropHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(player, "v.rp.bodyPropHair")) { + let bodyPropHair = getEntityData(player, "v.rp.bodyPropHair"); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropHead")) { - let bodyPropHead = getEntityData(player, "agrp.bodyPropHead"); + if (doesEntityDataExist(player, "v.rp.bodyPropHead")) { + let bodyPropHead = getEntityData(player, "v.rp.bodyPropHead"); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropEyes")) { - let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes"); + if (doesEntityDataExist(player, "v.rp.bodyPropEyes")) { + let bodyPropEyes = getEntityData(player, "v.rp.bodyPropEyes"); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(player, "v.rp.bodyPropLeftHand"); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(player, "v.rp.bodyPropRightHand"); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(player, "v.rp.bodyPropLeftWrist"); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist"); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist"); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropHip")) { - let bodyPropHip = getEntityData(player, "agrp.bodyPropHip"); + if (doesEntityDataExist(player, "v.rp.bodyPropHip")) { + let bodyPropHip = getEntityData(player, "v.rp.bodyPropHip"); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(player, "v.rp.bodyPropLeftFoot"); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(player, "v.rp.bodyPropRightFoot"); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); } } @@ -524,9 +523,9 @@ function syncPlayerProperties(player) { // =========================================================================== function syncObjectProperties(object) { - if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) { - if (doesEntityDataExist(object, "agrp.scale")) { - let scaleFactor = getEntityData(object, "agrp.scale"); + if (getGame() == V_GAME_GTA_III || getGame() == V_GAME_GTA_VC) { + if (doesEntityDataExist(object, "v.rp.scale")) { + let scaleFactor = getEntityData(object, "v.rp.scale"); let tempMatrix = object.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = object.position; @@ -576,9 +575,9 @@ function getPlayerId(client) { // =========================================================================== function syncElementProperties(element) { - if (doesEntityDataExist(element, "agrp.interior")) { + if (doesEntityDataExist(element, "v.rp.interior")) { if (typeof element.interior != "undefined") { - element.interior = getEntityData(element, "agrp.interior"); + element.interior = getEntityData(element, "v.rp.interior"); } } @@ -628,21 +627,21 @@ function getScreenHeight() { function openAllGarages() { switch (getGame()) { - case AGRP_GAME_GTA_III: + case V_GAME_GTA_III: for (let i = 0; i <= 26; i++) { openGarage(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); } break; - case AGRP_GAME_GTA_VC: + case V_GAME_GTA_VC: for (let i = 0; i <= 32; i++) { openGarage(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); } break; - case AGRP_GAME_GTA_SA: + case V_GAME_GTA_SA: for (let i = 0; i <= 44; i++) { openGarage(i); } @@ -657,21 +656,21 @@ function openAllGarages() { function closeAllGarages() { switch (getGame()) { - case AGRP_GAME_GTA_III: + case V_GAME_GTA_III: for (let i = 0; i <= 26; i++) { closeGarage(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); } break; - case AGRP_GAME_GTA_VC: + case V_GAME_GTA_VC: for (let i = 0; i <= 32; i++) { closeGarage(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); } break; - case AGRP_GAME_GTA_SA: + case V_GAME_GTA_SA: for (let i = 0; i <= 44; i++) { closeGarage(i); } @@ -691,7 +690,7 @@ function setPedInvincible(ped, state) { // =========================================================================== function setPedLookAt(ped, position) { - if (getGame() == AGRP_GAME_GTA_SA) { + if (getGame() == V_GAME_GTA_SA) { ped.lookAt(position, 10000); return true; } else { diff --git a/scripts/client/netevents.js b/scripts/client/netevents.js index 0804a1d5..93bd5afc 100644 --- a/scripts/client/netevents.js +++ b/scripts/client/netevents.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: netevents.js // DESC: Provides server communication and cross-endpoint network events @@ -20,169 +19,169 @@ function addAllNetworkHandlers() { // Chat Box addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible - addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines); - addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay); - addNetworkEventHandler("agrp.chatTimeStamps", setChatTimeStampsState); - addNetworkEventHandler("agrp.chatEmoji", setChatEmojiState); + addNetworkEventHandler("v.rp.chatScrollLines", setChatScrollLines); + addNetworkEventHandler("v.rp.chatAutoHideDelay", setChatAutoHideDelay); + addNetworkEventHandler("v.rp.chatTimeStamps", setChatTimeStampsState); + addNetworkEventHandler("v.rp.chatEmoji", setChatEmojiState); // Messaging (like textdraws and stuff) - addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage); + addNetworkEventHandler("v.rp.smallGameMessage", showSmallGameMessage); // Job - addNetworkEventHandler("agrp.job", receiveJobFromServer); - addNetworkEventHandler("agrp.working", setLocalPlayerWorkingState); - addNetworkEventHandler("agrp.jobType", setLocalPlayerJobType); - addNetworkEventHandler("agrp.showJobRouteLocation", showJobRouteLocation); - addNetworkEventHandler("agrp.hideJobRouteLocation", hideJobRouteLocation); + addNetworkEventHandler("v.rp.job", receiveJobFromServer); + addNetworkEventHandler("v.rp.working", setLocalPlayerWorkingState); + addNetworkEventHandler("v.rp.jobType", setLocalPlayerJobType); + addNetworkEventHandler("v.rp.showJobRouteLocation", showJobRouteLocation); + addNetworkEventHandler("v.rp.hideJobRouteLocation", hideJobRouteLocation); // Local player states and values - addNetworkEventHandler("agrp.restoreCamera", restoreLocalCamera); - addNetworkEventHandler("agrp.cameraLookAt", setLocalCameraLookAt); - addNetworkEventHandler("agrp.freeze", setLocalPlayerFrozenState); - addNetworkEventHandler("agrp.control", setLocalPlayerControlState); - addNetworkEventHandler("agrp.fadeCamera", fadeLocalCamera); - addNetworkEventHandler("agrp.removeFromVehicle", removeLocalPlayerFromVehicle); - addNetworkEventHandler("agrp.clearWeapons", clearLocalPlayerWeapons); - addNetworkEventHandler("agrp.giveWeapon", giveLocalPlayerWeapon); - addNetworkEventHandler("agrp.position", setLocalPlayerPosition); - addNetworkEventHandler("agrp.heading", setLocalPlayerHeading); - addNetworkEventHandler("agrp.interior", setLocalPlayerInterior); - addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer); - addNetworkEventHandler("agrp.money", setLocalPlayerMoney); - addNetworkEventHandler("agrp.armour", setLocalPlayerArmour); - addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin); - addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak); - addNetworkEventHandler("agrp.infiniteRun", setLocalPlayerInfiniteRun); - addNetworkEventHandler("agrp.playerCop", setLocalPlayerAsCopState); - addNetworkEventHandler("agrp.health", setLocalPlayerHealth); - addNetworkEventHandler("agrp.wantedLevel", setLocalPlayerWantedLevel); - addNetworkEventHandler("agrp.playerPedId", sendLocalPlayerNetworkIdToServer); - addNetworkEventHandler("agrp.ped", setLocalPlayerPedPartsAndProps); - addNetworkEventHandler("agrp.spawn", serverRequestedLocalPlayerSpawn); - addNetworkEventHandler("agrp.clearPedState", clearLocalPedState); - addNetworkEventHandler("agrp.drunkEffect", setLocalPlayerDrunkEffect); - addNetworkEventHandler("agrp.deleteLocalPlayerPed", deleteLocalPlayerPed); + addNetworkEventHandler("v.rp.restoreCamera", restoreLocalCamera); + addNetworkEventHandler("v.rp.cameraLookAt", setLocalCameraLookAt); + addNetworkEventHandler("v.rp.freeze", setLocalPlayerFrozenState); + addNetworkEventHandler("v.rp.control", setLocalPlayerControlState); + addNetworkEventHandler("v.rp.fadeCamera", fadeLocalCamera); + addNetworkEventHandler("v.rp.removeFromVehicle", removeLocalPlayerFromVehicle); + addNetworkEventHandler("v.rp.clearWeapons", clearLocalPlayerWeapons); + addNetworkEventHandler("v.rp.giveWeapon", giveLocalPlayerWeapon); + addNetworkEventHandler("v.rp.position", setLocalPlayerPosition); + addNetworkEventHandler("v.rp.heading", setLocalPlayerHeading); + addNetworkEventHandler("v.rp.interior", setLocalPlayerInterior); + addNetworkEventHandler("v.rp.spawned", onServerSpawnedLocalPlayer); + addNetworkEventHandler("v.rp.money", setLocalPlayerMoney); + addNetworkEventHandler("v.rp.armour", setLocalPlayerArmour); + addNetworkEventHandler("v.rp.localPlayerSkin", setLocalPlayerSkin); + addNetworkEventHandler("v.rp.pedSpeak", makeLocalPlayerPedSpeak); + addNetworkEventHandler("v.rp.infiniteRun", setLocalPlayerInfiniteRun); + addNetworkEventHandler("v.rp.playerCop", setLocalPlayerAsCopState); + addNetworkEventHandler("v.rp.health", setLocalPlayerHealth); + addNetworkEventHandler("v.rp.wantedLevel", setLocalPlayerWantedLevel); + addNetworkEventHandler("v.rp.playerPedId", sendLocalPlayerNetworkIdToServer); + addNetworkEventHandler("v.rp.ped", setLocalPlayerPedPartsAndProps); + addNetworkEventHandler("v.rp.spawn", serverRequestedLocalPlayerSpawn); + addNetworkEventHandler("v.rp.clearPedState", clearLocalPedState); + addNetworkEventHandler("v.rp.drunkEffect", setLocalPlayerDrunkEffect); + addNetworkEventHandler("v.rp.deleteLocalPlayerPed", deleteLocalPlayerPed); // Vehicle - addNetworkEventHandler("agrp.vehicle", receiveVehicleFromServer); - addNetworkEventHandler("agrp.veh.lights", setVehicleLights); - addNetworkEventHandler("agrp.veh.engine", setVehicleEngine); - addNetworkEventHandler("agrp.veh.repair", repairVehicle); - addNetworkEventHandler("agrp.cruiseControl", toggleLocalVehicleCruiseControl); - addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger); - addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState); + addNetworkEventHandler("v.rp.vehicle", receiveVehicleFromServer); + addNetworkEventHandler("v.rp.veh.lights", setVehicleLights); + addNetworkEventHandler("v.rp.veh.engine", setVehicleEngine); + addNetworkEventHandler("v.rp.veh.repair", repairVehicle); + addNetworkEventHandler("v.rp.cruiseControl", toggleLocalVehicleCruiseControl); + addNetworkEventHandler("v.rp.passenger", enterVehicleAsPassenger); + addNetworkEventHandler("v.rp.vehBuyState", setVehiclePurchaseState); // Radio - addNetworkEventHandler("agrp.radioStream", playStreamingRadio); - addNetworkEventHandler("agrp.audioFileStream", playAudioFile); - addNetworkEventHandler("agrp.stopRadioStream", stopStreamingRadio); - addNetworkEventHandler("agrp.radioVolume", setStreamingRadioVolume); + addNetworkEventHandler("v.rp.radioStream", playStreamingRadio); + addNetworkEventHandler("v.rp.audioFileStream", playAudioFile); + addNetworkEventHandler("v.rp.stopRadioStream", stopStreamingRadio); + addNetworkEventHandler("v.rp.radioVolume", setStreamingRadioVolume); // Key Bindings - addNetworkEventHandler("agrp.delKeyBind", unBindAccountKey); - addNetworkEventHandler("agrp.addKeyBind", bindAccountKey); - addNetworkEventHandler("agrp.clearKeyBinds", clearKeyBinds); + addNetworkEventHandler("v.rp.delKeyBind", unBindAccountKey); + addNetworkEventHandler("v.rp.addKeyBind", bindAccountKey); + addNetworkEventHandler("v.rp.clearKeyBinds", clearKeyBinds); // Weapon Damage - addNetworkEventHandler("agrp.weaponDamageEnabled", setPlayerWeaponDamageEnabled); - addNetworkEventHandler("agrp.weaponDamageEvent", setPlayerWeaponDamageEvent); + addNetworkEventHandler("v.rp.weaponDamageEnabled", setPlayerWeaponDamageEnabled); + addNetworkEventHandler("v.rp.weaponDamageEvent", setPlayerWeaponDamageEvent); // GUI - addNetworkEventHandler("agrp.showRegistration", showRegistrationGUI); - addNetworkEventHandler("agrp.showNewCharacter", showNewCharacterGUI); - addNetworkEventHandler("agrp.showLogin", showLoginGUI); - addNetworkEventHandler("agrp.2fa", showTwoFactorAuthGUI); - addNetworkEventHandler("agrp.showResetPasswordCodeInput", resetPasswordCodeInputGUI); - addNetworkEventHandler("agrp.showResetPasswordEmailInput", resetPasswordEmailInputGUI); - addNetworkEventHandler("agrp.showChangePassword", showChangePasswordGUI); - addNetworkEventHandler("agrp.showCharacterSelect", showCharacterSelectGUI); - addNetworkEventHandler("agrp.switchCharacterSelect", switchCharacterSelectGUI); - addNetworkEventHandler("agrp.showError", showErrorGUI); - addNetworkEventHandler("agrp.showInfo", showInfoGUI); - addNetworkEventHandler("agrp.showPrompt", showYesNoPromptGUI); - addNetworkEventHandler("agrp.loginSuccess", loginSuccess); - addNetworkEventHandler("agrp.characterSelectSuccess", characterSelectSuccess); - addNetworkEventHandler("agrp.loginFailed", loginFailed); - addNetworkEventHandler("agrp.registrationSuccess", registrationSuccess); - addNetworkEventHandler("agrp.registrationFailed", registrationFailed); - addNetworkEventHandler("agrp.newCharacterFailed", newCharacterFailed); - addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI); - addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI); - addNetworkEventHandler("agrp.guiColour", setGUIColours); - addNetworkEventHandler("agrp.mapChangeWarning", setMapChangeWarningState); + addNetworkEventHandler("v.rp.showRegistration", showRegistrationGUI); + addNetworkEventHandler("v.rp.showNewCharacter", showNewCharacterGUI); + addNetworkEventHandler("v.rp.showLogin", showLoginGUI); + addNetworkEventHandler("v.rp.2fa", showTwoFactorAuthGUI); + addNetworkEventHandler("v.rp.showResetPasswordCodeInput", resetPasswordCodeInputGUI); + addNetworkEventHandler("v.rp.showResetPasswordEmailInput", resetPasswordEmailInputGUI); + addNetworkEventHandler("v.rp.showChangePassword", showChangePasswordGUI); + addNetworkEventHandler("v.rp.showCharacterSelect", showCharacterSelectGUI); + addNetworkEventHandler("v.rp.switchCharacterSelect", switchCharacterSelectGUI); + addNetworkEventHandler("v.rp.showError", showErrorGUI); + addNetworkEventHandler("v.rp.showInfo", showInfoGUI); + addNetworkEventHandler("v.rp.showPrompt", showYesNoPromptGUI); + addNetworkEventHandler("v.rp.loginSuccess", loginSuccess); + addNetworkEventHandler("v.rp.characterSelectSuccess", characterSelectSuccess); + addNetworkEventHandler("v.rp.loginFailed", loginFailed); + addNetworkEventHandler("v.rp.registrationSuccess", registrationSuccess); + addNetworkEventHandler("v.rp.registrationFailed", registrationFailed); + addNetworkEventHandler("v.rp.newCharacterFailed", newCharacterFailed); + addNetworkEventHandler("v.rp.changePassword", showChangePasswordGUI); + addNetworkEventHandler("v.rp.showLocaleChooser", showLocaleChooserGUI); + addNetworkEventHandler("v.rp.guiColour", setGUIColours); + addNetworkEventHandler("v.rp.mapChangeWarning", setMapChangeWarningState); // 2D Rendering - addNetworkEventHandler("agrp.set2DRendering", set2DRendering); - addNetworkEventHandler("agrp.logo", setServerLogoRenderState); - addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay); + addNetworkEventHandler("v.rp.set2DRendering", set2DRendering); + addNetworkEventHandler("v.rp.logo", setServerLogoRenderState); + addNetworkEventHandler("v.rp.showItemActionDelay", showItemActionDelay); // Business - addNetworkEventHandler("agrp.business", receiveBusinessFromServer); + addNetworkEventHandler("v.rp.business", receiveBusinessFromServer); // House - addNetworkEventHandler("agrp.house", receiveHouseFromServer); + addNetworkEventHandler("v.rp.house", receiveHouseFromServer); // GPS - addNetworkEventHandler("agrp.showGPSBlip", showGPSLocation); + addNetworkEventHandler("v.rp.showGPSBlip", showGPSLocation); // Locale - addNetworkEventHandler("agrp.locale", setLocale); - addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI); + addNetworkEventHandler("v.rp.locale", setLocale); + addNetworkEventHandler("v.rp.localeChooser", toggleLocaleChooserGUI); // Animation - addNetworkEventHandler("agrp.anim", makePedPlayAnimation); - addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation); - addNetworkEventHandler("agrp.forceAnim", forcePedAnimation); + addNetworkEventHandler("v.rp.anim", makePedPlayAnimation); + addNetworkEventHandler("v.rp.stopAnim", makePedStopAnimation); + addNetworkEventHandler("v.rp.forceAnim", forcePedAnimation); // Nametags - addNetworkEventHandler("agrp.nametag", updatePlayerNameTag); - addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance); + addNetworkEventHandler("v.rp.nametag", updatePlayerNameTag); + addNetworkEventHandler("v.rp.nametagDistance", setNameTagDistance); // Misc - addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor); - addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera); - addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState); - addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds); - addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups); - addNetworkEventHandler("agrp.ambience", setCityAmbienceState); - addNetworkEventHandler("agrp.runCode", runClientCode); - addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration); - addNetworkEventHandler("agrp.snow", setSnowState); - addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey); - addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect); - addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar); - addNetworkEventHandler("agrp.logLevel", setLogLevel); - addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI); - addNetworkEventHandler("agrp.ping", updatePlayerPing); - addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo); - addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState); - addNetworkEventHandler("agrp.scene", changeScene); - addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties); - addNetworkEventHandler("agrp.elementPosition", setElementPosition); - addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled); - addNetworkEventHandler("agrp.holdObject", makePedHoldObject); - addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState); - addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer); - addNetworkEventHandler("agrp.token", serverRequestedToken); + addNetworkEventHandler("v.rp.mouseCursor", toggleMouseCursor); + addNetworkEventHandler("v.rp.mouseCamera", toggleMouseCamera); + addNetworkEventHandler("v.rp.mouseCameraForce", setMouseCameraState); + addNetworkEventHandler("v.rp.clearPeds", clearLocalPlayerOwnedPeds); + addNetworkEventHandler("v.rp.clearPickups", clearLocalPlayerOwnedPickups); + addNetworkEventHandler("v.rp.ambience", setCityAmbienceState); + addNetworkEventHandler("v.rp.runCode", runClientCode); + addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration); + addNetworkEventHandler("v.rp.snow", setSnowState); + addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey); + addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect); + addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar); + addNetworkEventHandler("v.rp.logLevel", setLogLevel); + addNetworkEventHandler("v.rp.hideAllGUI", hideAllGUI); + addNetworkEventHandler("v.rp.ping", updatePlayerPing); + addNetworkEventHandler("v.rp.clientInfo", serverRequestedClientInfo); + addNetworkEventHandler("v.rp.interiorLights", updateInteriorLightsState); + addNetworkEventHandler("v.rp.scene", changeScene); + addNetworkEventHandler("v.rp.syncElement", forceSyncElementProperties); + addNetworkEventHandler("v.rp.elementPosition", setElementPosition); + addNetworkEventHandler("v.rp.elementCollisions", setElementCollisionsEnabled); + addNetworkEventHandler("v.rp.holdObject", makePedHoldObject); + addNetworkEventHandler("v.rp.profanityFilter", setProfanityFilterState); + addNetworkEventHandler("v.rp.currencyString", receiveCurrencyStringFromServer); + addNetworkEventHandler("v.rp.token", serverRequestedToken); } // =========================================================================== function sendResourceReadySignalToServer() { - sendNetworkEventToServer("agrp.clientReady"); + sendNetworkEventToServer("v.rp.clientReady"); } // =========================================================================== function sendResourceStartedSignalToServer() { - sendNetworkEventToServer("agrp.clientStarted"); + sendNetworkEventToServer("v.rp.clientStarted"); } // =========================================================================== function sendResourceStoppedSignalToServer() { if (isConnected) { - sendNetworkEventToServer("agrp.clientStopped"); + sendNetworkEventToServer("v.rp.clientStopped"); } } @@ -192,7 +191,7 @@ function set2DRendering(hudState, labelState, smallGameMessageState, scoreboardS logToConsole(LOG_DEBUG, `[AGRP.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`); renderHUD = hudState; - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.displayCash(hudState); natives.displayAmmo(hudState); natives.displayHud(hudState); @@ -239,19 +238,19 @@ function onServerSpawnedLocalPlayer(state) { // =========================================================================== function tellServerPlayerUsedKeyBind(key) { - sendNetworkEventToServer("agrp.useKeyBind", key); + sendNetworkEventToServer("v.rp.useKeyBind", key); } // =========================================================================== function tellServerPlayerArrivedAtJobRouteLocation() { - sendNetworkEventToServer("agrp.arrivedAtJobRouteLocation"); + sendNetworkEventToServer("v.rp.arrivedAtJobRouteLocation"); } // =========================================================================== function tellServerItemActionDelayComplete() { - sendNetworkEventToServer("agrp.itemActionDelayComplete"); + sendNetworkEventToServer("v.rp.itemActionDelayComplete"); } // =========================================================================== @@ -261,13 +260,13 @@ function sendServerClientInfo() { if (typeof CLIENT_VERSION_MAJOR != "undefined") { clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`; } - sendNetworkEventToServer("agrp.clientInfo", clientVersion, game.width, game.height); + sendNetworkEventToServer("v.rp.clientInfo", clientVersion, game.width, game.height); } // =========================================================================== function sendServerNewAFKStatus(state) { - sendNetworkEventToServer("agrp.afk", state); + sendNetworkEventToServer("v.rp.afk", state); } // =========================================================================== @@ -328,7 +327,7 @@ function setLogLevel(level) { function setLocalPlayerInfiniteRun(state) { if (localPlayer != null) { - if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) { + if (getGame() == V_GAME_GTA_III || getGame() == V_GAME_GTA_VC) { game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state)); } } @@ -338,7 +337,7 @@ function setLocalPlayerInfiniteRun(state) { function setLocalPlayerSkin(skinId) { logToConsole(LOG_INFO, `[AGRP.Server] Setting locale player skin to ${skinId}`); - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (natives.isModelInCdimage(skinId)) { natives.requestModel(skinId); natives.loadAllObjectsNow(); @@ -354,7 +353,7 @@ function setLocalPlayerSkin(skinId) { // =========================================================================== function makePedHoldObject(pedId, modelIndex) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1]) } } @@ -362,15 +361,15 @@ function makePedHoldObject(pedId, modelIndex) { // =========================================================================== function sendLocalPlayerNetworkIdToServer() { - if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { - sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer)); + if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) { + sendNetworkEventToServer("v.rp.playerPedId", natives.getNetworkIdFromPed(localPlayer)); } } // =========================================================================== function changeScene(sceneName) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (cutsceneName == "") { natives.clearCutscene(); } else { @@ -379,7 +378,7 @@ function changeScene(sceneName) { } natives.initCutscene(cutsceneName); } - } else if (getGame() == AGRP_GAME_MAFIA_ONE) { + } else if (getGame() == V_GAME_MAFIA_ONE) { game.changeMap(sceneName); } } @@ -387,7 +386,7 @@ function changeScene(sceneName) { // =========================================================================== function makeLocalPlayerPedSpeak(speechName) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_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 @@ -396,7 +395,7 @@ function makeLocalPlayerPedSpeak(speechName) { } else { natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1); } - } else if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) { + } else if (getGame() == V_GAME_GTA_III || getGame() == V_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); } @@ -405,7 +404,7 @@ function makeLocalPlayerPedSpeak(speechName) { // =========================================================================== function setLocalPlayerAsCopState(state) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setPlayerAsCop(natives.getPlayerId(), state); natives.setPoliceIgnorePlayer(natives.getPlayerId(), state); } @@ -414,7 +413,7 @@ function setLocalPlayerAsCopState(state) { // =========================================================================== function serverRequestedLocalPlayerSpawn(skinId, position) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.createPlayer(skinId, position); //if(isCustomCameraSupported()) { // game.restoreCamera(true); @@ -425,7 +424,7 @@ function serverRequestedLocalPlayerSpawn(skinId, position) { // =========================================================================== function sendLocaleSelectToServer(localeId) { - sendNetworkEventToServer("agrp.localeSelect", localeId); + sendNetworkEventToServer("v.rp.localeSelect", localeId); } // =========================================================================== @@ -465,7 +464,7 @@ function receiveClientVariablesFromServer(clientVariablesString) { function serverRequestedToken() { let token = loadToken(); - sendNetworkEventToServer("agrp.token", token); + sendNetworkEventToServer("v.rp.token", token); } // =========================================================================== \ No newline at end of file diff --git a/scripts/client/npc.js b/scripts/client/npc.js index f56f051c..a03488dc 100644 --- a/scripts/client/npc.js +++ b/scripts/client/npc.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: npc.js // DESC: Provides NPC functions and processing @@ -10,7 +9,7 @@ function processNPCMovement(npc) { //if(npc.isSyncer == true) { - if (getEntityData(npc, "agrp.lookAtClosestPlayer") == true) { + if (getEntityData(npc, "v.rp.lookAtClosestPlayer") == true) { let closestPlayer = getClosestPlayer(getElementPosition(npc.id)); setPedLookAt(npc, getElementPosition(closestPlayer.id)); } diff --git a/scripts/client/object.js b/scripts/client/object.js index 5614b84a..284b297d 100644 --- a/scripts/client/object.js +++ b/scripts/client/object.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: object.js // DESC: Provides object functions and processing @@ -20,7 +19,7 @@ function startMovingObject(object) { function stopMovingObject(object, save = true) { if (save) { - sendNetworkEventToServer("agrp.objectSave", object.id, object.position, object.rotation); + sendNetworkEventToServer("v.rp.objectSave", object.id, object.position, object.rotation); } } diff --git a/scripts/client/radio.js b/scripts/client/radio.js index 842ddefb..5654ba8b 100644 --- a/scripts/client/radio.js +++ b/scripts/client/radio.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: radio.js // DESC: Provides internet streaming radio functions and usage diff --git a/scripts/client/scoreboard.js b/scripts/client/scoreboard.js index 7f2a4d0a..8c254995 100644 --- a/scripts/client/scoreboard.js +++ b/scripts/client/scoreboard.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: scoreboard.js // DESC: Provides scoreboard features and rendering diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index 4a14a93c..65de3352 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: skin-select.js // DESC: Provides skin-selector functions and usage @@ -65,16 +64,16 @@ function processSkinSelectKeyPress(keyCode) { skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]); } else if (keyCode == getKeyIdFromParams("enter")) { - sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex); + sendNetworkEventToServer("v.rp.skinSelected", skinSelectorIndex); toggleSkinSelect(false); return true; } else if (keyCode == getKeyIdFromParams("backspace")) { - sendNetworkEventToServer("agrp.skinSelected", -1); + sendNetworkEventToServer("v.rp.skinSelected", -1); toggleSkinSelect(false); return true; } - if (getGame() <= AGRP_GAME_GTA_SA) { + if (getGame() <= V_GAME_GTA_SA) { localPlayer.heading = skinSelectHeading; } } @@ -109,7 +108,7 @@ function toggleSkinSelect(state) { if (isCustomCameraSupported()) { let cameraPosition = localPlayer.position; let playerPosition = localPlayer.position; - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { cameraPosition.y += 1.5; playerPosition.y += 1.5; distance = 3; @@ -121,7 +120,7 @@ function toggleSkinSelect(state) { game.setCameraLookAt(frontCameraPosition, playerPosition, true); } - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { let skinId = allowedSkins[skinSelectorIndex][0]; if (natives.isModelInCdimage(skinId)) { natives.requestModel(skinId); diff --git a/scripts/client/startup.js b/scripts/client/startup.js index c8ce9e8f..c28d142e 100644 --- a/scripts/client/startup.js +++ b/scripts/client/startup.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: startup.js // DESC: Provides startup/shutdown procedures @@ -29,7 +28,7 @@ function initClientScripts() { // =========================================================================== function setUpInitialGame() { - if (getGame() == AGRP_GAME_GTA_III) { + if (getGame() == V_GAME_GTA_III) { logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA III ..."); // Turn off unlimited sprint @@ -48,7 +47,7 @@ function setUpInitialGame() { // Provided by mouse camera script (mousecam.js) SetStandardControlsEnabled(true); - } else if (getGame() == AGRP_GAME_GTA_VC) { + } else if (getGame() == V_GAME_GTA_VC) { logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA Vice City ..."); // Turn off unlimited sprint @@ -91,7 +90,7 @@ function setUpInitialGame() { // Provided by mouse camera script (mousecam.js) SetStandardControlsEnabled(true); - } else if (getGame() == AGRP_GAME_GTA_SA) { + } else if (getGame() == V_GAME_GTA_SA) { logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA San Andreas ..."); // Turn weapon skills down a bit game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); @@ -128,7 +127,7 @@ function setUpInitialGame() { // Disables taxi/vigilante/etc and other start mission triggers game.onMission = true; - } else if (getGame() == AGRP_GAME_GTA_IV) { + } else if (getGame() == V_GAME_GTA_IV) { natives.allowEmergencyServices(false); natives.setCreateRandomCops(true); natives.setMaxWantedLevel(0); @@ -190,7 +189,7 @@ function setUpInitialGame() { // Some last steps //natives.loadAllObjectsNow(); - } else if (getGame() == AGRP_GAME_MAFIA_ONE) { + } else if (getGame() == V_GAME_MAFIA_ONE) { game.mapEnabled = false; game.setTrafficEnabled(false); } diff --git a/scripts/client/sync.js b/scripts/client/sync.js index 3af0c8f5..190d24a9 100644 --- a/scripts/client/sync.js +++ b/scripts/client/sync.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: sync.js // DESC: Provides some elements and data sync @@ -11,12 +10,12 @@ function processSync(event, deltaTime) { if (localPlayer != null) { if (!areServerElementsSupported()) { - sendNetworkEventToServer("agrp.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); - sendNetworkEventToServer("agrp.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); + sendNetworkEventToServer("v.rp.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); + sendNetworkEventToServer("v.rp.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); //if(localPlayer.vehicle != null) { - // sendNetworkEventToServer("agrp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); - // sendNetworkEventToServer("agrp.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); + // sendNetworkEventToServer("v.rp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); + // sendNetworkEventToServer("v.rp.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); //} } @@ -25,7 +24,7 @@ function processSync(event, deltaTime) { logToConsole(LOG_DEBUG, `Local player died`); localPlayer.clearWeapons(); calledDeathEvent = true; - sendNetworkEventToServer("agrp.playerDeath"); + sendNetworkEventToServer("v.rp.playerDeath"); } } } @@ -35,7 +34,7 @@ function processSync(event, deltaTime) { logToConsole(LOG_DEBUG, `Local player died`); localPlayer.clearWeapons(); calledDeathEvent = true; - sendNetworkEventToServer("agrp.playerDeath"); + sendNetworkEventToServer("v.rp.playerDeath"); } } @@ -47,7 +46,7 @@ function processSync(event, deltaTime) { // =========================================================================== function setVehicleLights(vehicleId, state) { - //if (getGame() == AGRP_GAME_GTA_IV) { + //if (getGame() == V_GAME_GTA_IV) { // if (!state) { // natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0)); // } else { @@ -71,44 +70,44 @@ function syncVehicleProperties(vehicle) { return false; } - if (doesEntityDataExist(vehicle, "agrp.lights")) { - let lightStatus = getEntityData(vehicle, "agrp.lights"); + if (doesEntityDataExist(vehicle, "v.rp.lights")) { + let lightStatus = getEntityData(vehicle, "v.rp.lights"); vehicle.lights = lightStatus; } - if (doesEntityDataExist(vehicle, "agrp.locked")) { - let lockStatus = getEntityData(vehicle, "agrp.locked"); + if (doesEntityDataExist(vehicle, "v.rp.locked")) { + let lockStatus = getEntityData(vehicle, "v.rp.locked"); vehicle.locked = lockStatus; } - if (doesEntityDataExist(vehicle, "agrp.invincible")) { - let invincible = getEntityData(vehicle, "agrp.invincible"); + if (doesEntityDataExist(vehicle, "v.rp.invincible")) { + let invincible = getEntityData(vehicle, "v.rp.invincible"); element.setProofs(invincible, invincible, invincible, invincible, invincible); } - if (doesEntityDataExist(vehicle, "agrp.panelStatus")) { - let panelsStatus = getEntityData(vehicle, "agrp.panelStatus"); + if (doesEntityDataExist(vehicle, "v.rp.panelStatus")) { + let panelsStatus = getEntityData(vehicle, "v.rp.panelStatus"); for (let i in panelsStatus) { vehicle.setPanelStatus(i, panelsStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) { - let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus"); + if (doesEntityDataExist(vehicle, "v.rp.wheelStatus")) { + let wheelsStatus = getEntityData(vehicle, "v.rp.wheelStatus"); for (let i in wheelsStatus) { vehicle.setWheelStatus(i, wheelsStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.lightStatus")) { - let lightStatus = getEntityData(vehicle, "agrp.lightStatus"); + if (doesEntityDataExist(vehicle, "v.rp.lightStatus")) { + let lightStatus = getEntityData(vehicle, "v.rp.lightStatus"); for (let i in lightStatus) { vehicle.setLightStatus(i, lightStatus[i]); } } - if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) { - let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight"); + if (doesEntityDataExist(vehicle, "v.rp.suspensionHeight")) { + let suspensionHeight = getEntityData(vehicle, "v.rp.suspensionHeight"); vehicle.setSuspensionHeight(suspensionHeight); } @@ -118,8 +117,8 @@ function syncVehicleProperties(vehicle) { // vehicle.removeUpgrade(i); //} - if (doesEntityDataExist(vehicle, "agrp.upgrades")) { - let upgrades = getEntityData(vehicle, "agrp.upgrades"); + if (doesEntityDataExist(vehicle, "v.rp.upgrades")) { + let upgrades = getEntityData(vehicle, "v.rp.upgrades"); for (let i in upgrades) { if (upgrades[i] != 0) { vehicle.addUpgrade(upgrades[i]); @@ -128,12 +127,12 @@ function syncVehicleProperties(vehicle) { } } - if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(vehicle, "agrp.livery")) { - let livery = getEntityData(vehicle, "agrp.livery"); - if (getGame() == AGRP_GAME_GTA_SA) { + if (getGame() == V_GAME_GTA_SA || getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(vehicle, "v.rp.livery")) { + let livery = getEntityData(vehicle, "v.rp.livery"); + if (getGame() == V_GAME_GTA_SA) { vehicle.setPaintJob(livery); - } else if (getGame() == AGRP_GAME_GTA_IV) { + } else if (getGame() == V_GAME_GTA_IV) { vehicle.livery = livery; } } @@ -148,8 +147,8 @@ function syncCivilianProperties(civilian) { } if (isGameFeatureSupported("pedScale")) { - if (doesEntityDataExist(civilian, "agrp.scale")) { - let scaleFactor = getEntityData(civilian, "agrp.scale"); + if (doesEntityDataExist(civilian, "v.rp.scale")) { + let scaleFactor = getEntityData(civilian, "v.rp.scale"); let tempMatrix = civilian.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = civilian.position; @@ -159,79 +158,79 @@ function syncCivilianProperties(civilian) { } } - if (getGame() == AGRP_GAME_GTA_SA) { - if (doesEntityDataExist(civilian, "agrp.fightStyle")) { - let fightStyle = getEntityData(civilian, "agrp.fightStyle"); + if (getGame() == V_GAME_GTA_SA) { + if (doesEntityDataExist(civilian, "v.rp.fightStyle")) { + let fightStyle = getEntityData(civilian, "v.rp.fightStyle"); civilian.setFightStyle(fightStyle[0], fightStyle[1]); } } - if (getGame() == AGRP_GAME_GTA_SA) { - if (doesEntityDataExist(civilian, "agrp.walkStyle")) { - let walkStyle = getEntityData(civilian, "agrp.walkStyle"); + if (getGame() == V_GAME_GTA_SA) { + if (doesEntityDataExist(civilian, "v.rp.walkStyle")) { + let walkStyle = getEntityData(civilian, "v.rp.walkStyle"); civilian.walkStyle = walkStyle; } } - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) { - let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(civilian, "v.rp.bodyPropHair")) { + let bodyPropHair = getEntityData(civilian, "v.rp.bodyPropHair"); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) { - let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropHead")) { + let bodyPropHead = getEntityData(civilian, "v.rp.bodyPropHead"); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) { - let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropEyes")) { + let bodyPropEyes = getEntityData(civilian, "v.rp.bodyPropEyes"); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(civilian, "v.rp.bodyPropLeftHand"); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(civilian, "v.rp.bodyPropRightHand"); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(civilian, "v.rp.bodyPropLeftWrist"); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist"); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist"); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) { - let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropHip")) { + let bodyPropHip = getEntityData(civilian, "v.rp.bodyPropHip"); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(civilian, "v.rp.bodyPropLeftFoot"); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); } - if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot"); + if (doesEntityDataExist(civilian, "v.rp.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(civilian, "v.rp.bodyPropRightFoot"); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); } } - if (doesEntityDataExist(civilian, "agrp.anim")) { - let animationSlot = getEntityData(civilian, "agrp.anim"); + if (doesEntityDataExist(civilian, "v.rp.anim")) { + let animationSlot = getEntityData(civilian, "v.rp.anim"); let animationData = getAnimationData(animationSlot); civilian.addAnimation(animationData.groupId, animationData.animId); } @@ -245,8 +244,8 @@ function syncObjectProperties(object) { } if (isGameFeatureSupported("objectScale")) { - if (doesEntityDataExist(object, "agrp.scale")) { - let scaleFactor = getEntityData(object, "agrp.scale"); + if (doesEntityDataExist(object, "v.rp.scale")) { + let scaleFactor = getEntityData(object, "v.rp.scale"); let tempMatrix = object.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = object.position; @@ -265,8 +264,8 @@ function syncPlayerProperties(player) { } if (isGameFeatureSupported("pedScale")) { - if (doesEntityDataExist(player, "agrp.scale")) { - let scaleFactor = getEntityData(player, "agrp.scale"); + if (doesEntityDataExist(player, "v.rp.scale")) { + let scaleFactor = getEntityData(player, "v.rp.scale"); let tempMatrix = player.matrix; tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); let tempPosition = player.position; @@ -276,95 +275,95 @@ function syncPlayerProperties(player) { } } - if (getGame() == AGRP_GAME_GTA_SA) { - if (doesEntityDataExist(player, "agrp.fightStyle")) { - let fightStyle = getEntityData(player, "agrp.fightStyle"); + if (getGame() == V_GAME_GTA_SA) { + if (doesEntityDataExist(player, "v.rp.fightStyle")) { + let fightStyle = getEntityData(player, "v.rp.fightStyle"); player.setFightStyle(fightStyle[0], fightStyle[1]); } } - //if(getGame() == AGRP_GAME_GTA_SA) { - // if(doesEntityDataExist(player, "agrp.walkStyle")) { - // let walkStyle = getEntityData(player, "agrp.walkStyle"); + //if(getGame() == V_GAME_GTA_SA) { + // if(doesEntityDataExist(player, "v.rp.walkStyle")) { + // let walkStyle = getEntityData(player, "v.rp.walkStyle"); // player.walkStyle = walkStyle; // } //} - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(player, "agrp.bodyPartHair")) { - let bodyPartHead = getEntityData(player, "agrp.bodyPartHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(player, "v.rp.bodyPartHair")) { + let bodyPartHead = getEntityData(player, "v.rp.bodyPartHair"); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartHead")) { - let bodyPartHead = getEntityData(player, "agrp.bodyPartHead"); + if (doesEntityDataExist(player, "v.rp.bodyPartHead")) { + let bodyPartHead = getEntityData(player, "v.rp.bodyPartHead"); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartUpper")) { - let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper"); + if (doesEntityDataExist(player, "v.rp.bodyPartUpper")) { + let bodyPartUpper = getEntityData(player, "v.rp.bodyPartUpper"); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); } - if (doesEntityDataExist(player, "agrp.bodyPartLower")) { - let bodyPartLower = getEntityData(player, "agrp.bodyPartLower"); + if (doesEntityDataExist(player, "v.rp.bodyPartLower")) { + let bodyPartLower = getEntityData(player, "v.rp.bodyPartLower"); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); } } - if (getGame() == AGRP_GAME_GTA_IV) { - if (doesEntityDataExist(player, "agrp.bodyPropHair")) { - let bodyPropHair = getEntityData(player, "agrp.bodyPropHair"); + if (getGame() == V_GAME_GTA_IV) { + if (doesEntityDataExist(player, "v.rp.bodyPropHair")) { + let bodyPropHair = getEntityData(player, "v.rp.bodyPropHair"); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropHead")) { - let bodyPropHead = getEntityData(player, "agrp.bodyPropHead"); + if (doesEntityDataExist(player, "v.rp.bodyPropHead")) { + let bodyPropHead = getEntityData(player, "v.rp.bodyPropHead"); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropEyes")) { - let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes"); + if (doesEntityDataExist(player, "v.rp.bodyPropEyes")) { + let bodyPropEyes = getEntityData(player, "v.rp.bodyPropEyes"); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) { - let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftHand")) { + let bodyPropLeftHand = getEntityData(player, "v.rp.bodyPropLeftHand"); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) { - let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightHand")) { + let bodyPropRightHand = getEntityData(player, "v.rp.bodyPropRightHand"); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) { - let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftWrist")) { + let bodyPropLeftWrist = getEntityData(player, "v.rp.bodyPropLeftWrist"); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist"); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { - let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) { + let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist"); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropHip")) { - let bodyPropHip = getEntityData(player, "agrp.bodyPropHip"); + if (doesEntityDataExist(player, "v.rp.bodyPropHip")) { + let bodyPropHip = getEntityData(player, "v.rp.bodyPropHip"); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) { - let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot"); + if (doesEntityDataExist(player, "v.rp.bodyPropLeftFoot")) { + let bodyPropLeftFoot = getEntityData(player, "v.rp.bodyPropLeftFoot"); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); } - if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) { - let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot"); + if (doesEntityDataExist(player, "v.rp.bodyPropRightFoot")) { + let bodyPropRightFoot = getEntityData(player, "v.rp.bodyPropRightFoot"); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); } } @@ -378,20 +377,20 @@ function syncElementProperties(element) { } if (isGameFeatureSupported("interior")) { - if (doesEntityDataExist(element, "agrp.interior")) { + if (doesEntityDataExist(element, "v.rp.interior")) { if (typeof element.interior != "undefined") { - element.interior = getEntityData(element, "agrp.interior"); + element.interior = getEntityData(element, "v.rp.interior"); } } } if (isGameFeatureSupported("toggleCollision")) { - if (doesEntityDataExist(element, "agrp.collisions")) { - element.collisionsEnabled = getEntityData(element, "agrp.collisions"); + if (doesEntityDataExist(element, "v.rp.collisions")) { + element.collisionsEnabled = getEntityData(element, "v.rp.collisions"); } } - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { switch (element.type) { case ELEMENT_VEHICLE: syncVehicleProperties(element); @@ -436,7 +435,7 @@ function syncElementProperties(element) { // =========================================================================== function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { } } diff --git a/scripts/client/token.js b/scripts/client/token.js index ea931a8b..952df384 100644 --- a/scripts/client/token.js +++ b/scripts/client/token.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: token.js // DESC: Provides "remember me" auto-login token system and functions diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 774d9011..f5f3198e 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: utilities.js // DESC: Provides util functions and arrays with data @@ -19,9 +18,9 @@ function setLocalPlayerControlState(controlState, cursorState = false) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); controlsEnabled = controlState; game.setPlayerControl(controlState); - if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) { + if (getGame() == V_GAME_GTA_III || getGame() == V_GAME_GTA_VC) { game.SET_PLAYER_CONTROL(game.GET_PLAYER_ID(), boolToInt(controlState)); - } else if (getGame() <= AGRP_GAME_GTA_IV) { + } else if (getGame() <= V_GAME_GTA_IV) { setElementCollisionsEnabled(localPlayer, controlState); setPedInvincible(localPlayer, true); } @@ -78,9 +77,9 @@ function setCityAmbienceState(state, clearElements = false) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`); game.setTrafficEnabled(state); - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { game.setGenerateCarsAroundCamera(state); - if (getGame() != AGRP_GAME_GTA_SA) { + if (getGame() != V_GAME_GTA_SA) { game.setCiviliansEnabled(state); } @@ -98,7 +97,7 @@ function runClientCode(code, returnTo) { try { returnValue = eval("(" + code + ")"); } catch (error) { - sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString()); + sendNetworkEventToServer("v.rp.runCodeFail", returnTo, error.toString()); return false; } let returnValueString = returnValue; @@ -107,7 +106,7 @@ function runClientCode(code, returnTo) { } else { returnValueString = "null/undefined"; } - sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString); + sendNetworkEventToServer("v.rp.runCodeSuccess", returnTo, returnValueString); } // =========================================================================== @@ -115,7 +114,7 @@ function runClientCode(code, returnTo) { function enterVehicleAsPassenger() { if (localPlayer.vehicle == null) { let tempVehicle = getClosestVehicle(localPlayer.position); - if (getGame() != AGRP_GAME_GTA_IV) { + if (getGame() != V_GAME_GTA_IV) { if (tempVehicle != null) { localPlayer.enterVehicle(tempVehicle, false); } @@ -137,13 +136,13 @@ function enterVehicleAsPassenger() { function giveLocalPlayerWeapon(weaponId, ammo, active) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`); forceWeapon = weaponId; - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { localPlayer.giveWeapon(weaponId, 0, ammo); forceWeaponAmmo = 0; forceWeaponClipAmmo = ammo; } else { localPlayer.giveWeapon(weaponId, ammo, active); - if (getGame() < AGRP_GAME_GTA_IV) { + if (getGame() < V_GAME_GTA_IV) { forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId)); forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId)); } else { @@ -197,7 +196,7 @@ function setLocalPlayerHeading(heading) { function setLocalPlayerInterior(interior) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting interior to ${interior}`); - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { if (!isGTAIV()) { localPlayer.interior = interior; game.cameraInterior = interior; @@ -215,8 +214,8 @@ function setLocalPlayerInterior(interior) { if (areServerElementsSupported() && isGameFeatureSupported("interior")) { let vehicles = getElementsByType(ELEMENT_VEHICLE); for (let i in vehicles) { - if (getEntityData(vehicles[i], "agrp.interior")) { - vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior"); + if (getEntityData(vehicles[i], "v.rp.interior")) { + vehicles[i].interior = getEntityData(vehicles[i], "v.rp.interior"); } } } @@ -246,7 +245,7 @@ function setLocalPlayerHealth(health) { function playPedSpeech(pedName, speechId) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Making ${pedName}'s ped talk (${speechId})`); - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { game.SET_CHAR_SAY(int, int); } } @@ -267,7 +266,7 @@ function getWeaponSlot(weaponId) { // =========================================================================== function setLocalPlayerDrunkEffect(amount, duration) { - if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { + if (getMultiplayerMod() == V_MPMOD_GTAC) { logToConsole(LOG_DEBUG, `[AGRP.Utilities] Drunk effect set to ${amount} for ${duration} ms`); drunkEffectAmount = 0; drunkEffectDurationTimer = setInterval(function () { @@ -400,8 +399,8 @@ function processWantedLevelReset() { function processLocalPlayerVehicleControlState() { if (areServerElementsSupported()) { if (localPlayer.vehicle != null) { - if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) { - if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) { + if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) { + if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) { localPlayer.vehicle.engine = false; //localPlayer.vehicle.netFlags.sendSync = false; if (!localPlayer.vehicle.engine) { @@ -430,12 +429,12 @@ function forceLocalPlayerEquippedWeaponItem() { if (forceWeapon != 0) { if (localPlayer.weapon != forceWeapon) { localPlayer.weapon = forceWeapon; - if (getGame() < AGRP_GAME_GTA_IV) { + if (getGame() < V_GAME_GTA_IV) { localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo); localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo); } } else { - //if(getGame() < AGRP_GAME_GTA_IV) { + //if(getGame() < V_GAME_GTA_IV) { // forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); // forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); //} @@ -462,7 +461,7 @@ function getLocalPlayerPosition() { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { return natives.getNetworkIdFromVehicle(vehicle); } return vehicle.id; @@ -534,7 +533,7 @@ function processNearbyPickups() { //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) { if (currentPickup != pickups[i]) { currentPickup = pickups[i]; - sendNetworkEventToServer("agrp.pickup", pickups[i].id); + sendNetworkEventToServer("v.rp.pickup", pickups[i].id); } //} } @@ -545,7 +544,7 @@ function processNearbyPickups() { // =========================================================================== function processGameSpecifics() { - if (getGame() < AGRP_GAME_GTA_IV) { + if (getGame() < V_GAME_GTA_IV) { game.clearMessages(); } @@ -604,7 +603,7 @@ function updateLocalPlayerMoney() { localPlayer.money = toInteger(localPlayerMoney); } - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { natives.setMultiplayerHudCash(localPlayerMoney); } } diff --git a/scripts/client/vehicle.js b/scripts/client/vehicle.js index a9268d6c..a0947feb 100644 --- a/scripts/client/vehicle.js +++ b/scripts/client/vehicle.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: vehicle.js // DESC: Provides vehicle functions and arrays with data @@ -33,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, `[AGRP.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`); - if (getGame() != AGRP_GAME_GTA_IV) { + if (getGame() != V_GAME_GTA_IV) { return false; } @@ -64,20 +63,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2, // =========================================================================== function processVehiclePurchasing() { - if (vehiclePurchaseState == AGRP_VEHBUYSTATE_TESTDRIVE) { + if (vehiclePurchaseState == V_VEHBUYSTATE_TESTDRIVE) { if (getLocalPlayerVehicle() == false) { - vehiclePurchaseState = AGRP_VEHBUYSTATE_EXITVEH; - sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_EXITVEH); + vehiclePurchaseState = V_VEHBUYSTATE_EXITVEH; + sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_EXITVEH); return false; } else { if (vehiclePurchasing == getLocalPlayerVehicle()) { if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) { - vehiclePurchaseState = AGRP_VEHBUYSTATE_FARENOUGH; - sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_FARENOUGH); + vehiclePurchaseState = V_VEHBUYSTATE_FARENOUGH; + sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_FARENOUGH); } } else { - vehiclePurchaseState = AGRP_VEHBUYSTATE_WRONGVEH; - sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_WRONGVEH); + vehiclePurchaseState = V_VEHBUYSTATE_WRONGVEH; + sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_WRONGVEH); } } } @@ -154,7 +153,7 @@ function getVehicleSpeed(vehicle) { speed = getLength(vecMoveSpeed[0], vecMoveSpeed[1], vecMoveSpeed[2]); } - if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { + if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) { speed /= 40.0; } diff --git a/scripts/server/accent.js b/scripts/server/accent.js index eb934510..f7ee472a 100644 --- a/scripts/server/accent.js +++ b/scripts/server/accent.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: accent.js // DESC: Provides accent functions and usage diff --git a/scripts/server/account.js b/scripts/server/account.js index 6f0db57b..8fa82d4b 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: account.js // DESC: Provides account functions and usage @@ -9,35 +8,35 @@ // =========================================================================== // Account Contact Types -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 +const V_CONTACT_NONE = 0; +const V_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features +const V_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online. +const V_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP // =========================================================================== // Account Authentication Methods -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) +const V_ACCT_AUTHMETHOD_NONE = 0; // None +const V_ACCT_AUTHMETHOD_EMAIL = 1; // Email +const V_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number +const V_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc) +const V_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use) +const V_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 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 +const V_2FA_STATE_NONE = 0; // None +const V_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play +const V_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app +const V_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up // =========================================================================== // Reset Password States -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 +const V_RESETPASS_STATE_NONE = 0; // None +const V_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email +const V_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password // =========================================================================== @@ -866,7 +865,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 = AGRP_PROMPT_CREATEFIRSTCHAR; + getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR; logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`); } else { messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`)); @@ -1283,7 +1282,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { showPlayerRegistrationSuccessGUI(client); showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR; + getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR; } else { messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`)); } @@ -1298,7 +1297,7 @@ function checkAccountResetPasswordRequest(client, inputText) { } switch (getPlayerData(client).passwordResetState) { - case AGRP_RESETPASS_STATE_EMAILCONFIRM: { + case V_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")); @@ -1306,7 +1305,7 @@ function checkAccountResetPasswordRequest(client, inputText) { } let passwordResetCode = toUpperCase(generateEmailVerificationCode()); - getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_CODEINPUT; + getPlayerData(client).passwordResetState = V_RESETPASS_STATE_CODEINPUT; getPlayerData(client).passwordResetCode = passwordResetCode; showPlayerResetPasswordCodeInputGUI(client); sendPasswordResetEmail(client, passwordResetCode); @@ -1314,11 +1313,11 @@ function checkAccountResetPasswordRequest(client, inputText) { break; } - case AGRP_RESETPASS_STATE_CODEINPUT: { + case V_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 = AGRP_RESETPASS_STATE_SETPASS; + getPlayerData(client).passwordResetState = V_RESETPASS_STATE_SETPASS; showPlayerChangePasswordGUI(client); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`); } else { @@ -1335,10 +1334,10 @@ function checkAccountResetPasswordRequest(client, inputText) { break; } - case AGRP_RESETPASS_STATE_NONE: { + case V_RESETPASS_STATE_NONE: { logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`); showPlayerResetPasswordEmailInputGUI(client); - getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_EMAILCONFIRM; + getPlayerData(client).passwordResetState = V_RESETPASS_STATE_EMAILCONFIRM; break; } } @@ -1350,8 +1349,8 @@ function checkAccountResetPasswordRequest(client, inputText) { function checkAccountChangePassword(client, newPassword, confirmNewPassword) { if (!isPlayerLoggedIn(client)) { - if (getPlayerData(client).passwordResetState != AGRP_RESETPASS_STATE_SETPASS) { - //getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; + if (getPlayerData(client).passwordResetState != V_RESETPASS_STATE_SETPASS) { + //getPlayerData(client).passwordResetState = V_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; @@ -1387,8 +1386,8 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) { saveAccountToDatabase(getPlayerData(client).accountData); - if (getPlayerData(client).passwordResetState == AGRP_RESETPASS_STATE_SETPASS) { - getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; + if (getPlayerData(client).passwordResetState == V_RESETPASS_STATE_SETPASS) { + getPlayerData(client).passwordResetState = V_RESETPASS_STATE_NONE; } messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged")); @@ -1429,7 +1428,7 @@ function savePlayerToDatabase(client) { //let subAccountData = getPlayerCurrentSubAccount(client); if (getPlayerPed(client) != null) { - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != AGRP_RETURNTO_TYPE_ADMINGET) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != V_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 23befe41..93341de7 100644 --- a/scripts/server/animation.js +++ b/scripts/server/animation.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: animation.js // DESC: Provides animation functions and usage @@ -35,8 +34,8 @@ function playPlayerAnimationCommand(command, params, client) { return false; } - if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) { - getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP; + if (getAnimationData(animationSlot)[3] == V_ANIMTYPE_SURRENDER) { + getPlayerData(client).pedState = V_PEDSTATE_HANDSUP; } if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) { @@ -106,9 +105,9 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) { } makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition); - //setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true); - //if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) { - // if(getGame() < AGRP_GAME_GTA_SA) { + //setEntityData(getPlayerPed(client), "v.rp.anim", animationSlot, true); + //if(getAnimationData(animationSlot)[9] != V_ANIMMOVE_NONE) { + // if(getGame() < V_GAME_GTA_SA) { // setPlayerMouseCameraState(client, true); // } //} diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js index 15af26e6..3a89c451 100644 --- a/scripts/server/anticheat.js +++ b/scripts/server/anticheat.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: anticheat.js // DESC: Provides anticheat functions and usage @@ -16,10 +15,10 @@ function initAntiCheatScript() { // =========================================================================== function clearPlayerStateToEnterExitProperty(client) { - if (getPlayerData(client).pedState != AGRP_PEDSTATE_READY) { - if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGVEHICLE) { + if (getPlayerData(client).pedState != V_PEDSTATE_READY) { + if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGVEHICLE) { sendPlayerClearPedState(client); - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; } else { return false; } diff --git a/scripts/server/ban.js b/scripts/server/ban.js index 5a66eeb3..07eafb1a 100644 --- a/scripts/server/ban.js +++ b/scripts/server/ban.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: bans.js // DESC: Provides ban functions and usage @@ -9,18 +8,18 @@ // =========================================================================== // Ban Types -const AGRP_BANTYPE_NONE = 0; -const AGRP_BANTYPE_ACCOUNT = 1; -const AGRP_BANTYPE_SUBACCOUNT = 2; -const AGRP_BANTYPE_IPADDRESS = 3; -const AGRP_BANTYPE_SUBNET = 4; +const V_BANTYPE_NONE = 0; +const V_BANTYPE_ACCOUNT = 1; +const V_BANTYPE_SUBACCOUNT = 2; +const V_BANTYPE_IPADDRESS = 3; +const V_BANTYPE_SUBNET = 4; // =========================================================================== class BanData { constructor(dbAssoc = false) { this.databaseId = 0; - this.type = AGRP_BANTYPE_NONE; + this.type = V_BANTYPE_NONE; this.detail = ""; this.ipAddress = ""; this.name = ""; @@ -175,7 +174,7 @@ function banAccount(accountId, adminAccountId, reason) { let dbConnection = connectToDatabase(); if (dbConnection) { let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -190,7 +189,7 @@ function banSubAccount(subAccountId, adminAccountId, reason) { let dbConnection = connectToDatabase(); if (dbConnection) { let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -205,7 +204,7 @@ function banIPAddress(ipAddress, adminAccountId, reason) { let dbConnection = connectToDatabase(); if (dbConnection) { let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -220,7 +219,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) { let dbConnection = connectToDatabase(); if (dbConnection) { let safeReason = dbConnection.escapetoString(reason); - let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`); + let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -234,7 +233,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) { function unbanAccount(accountId, adminAccountId) { let dbConnection = connectToDatabase(); if (dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -248,7 +247,7 @@ function unbanAccount(accountId, adminAccountId) { function unbanSubAccount(subAccountId, adminAccountId) { let dbConnection = connectToDatabase(); if (dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -262,7 +261,7 @@ function unbanSubAccount(subAccountId, adminAccountId) { function unbanIPAddress(ipAddress, adminAccountId) { let dbConnection = connectToDatabase(); if (dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`); + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -276,7 +275,7 @@ function unbanIPAddress(ipAddress, adminAccountId) { function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) { let dbConnection = connectToDatabase(); if (dbConnection) { - let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`); + let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`); freeDatabaseQuery(dbQuery); dbConnection.close(); return true; @@ -288,7 +287,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) { // =========================================================================== function isAccountBanned(accountId) { - let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_ACCOUNT && ban.detail === accountId); + let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_ACCOUNT && ban.detail === accountId); if (bans.length > 0) { return true; } @@ -299,7 +298,7 @@ function isAccountBanned(accountId) { // =========================================================================== function isSubAccountBanned(subAccountId) { - let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_SUBACCOUNT && ban.detail === subAccountId); + let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_SUBACCOUNT && ban.detail === subAccountId); if (bans.length > 0) { return true; } @@ -310,7 +309,7 @@ function isSubAccountBanned(subAccountId) { // =========================================================================== function isIpAddressBanned(ipAddress) { - let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_IPADDRESS && ban.detail === ipAddress); + let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_IPADDRESS && ban.detail === ipAddress); if (bans.length > 0) { return true; } diff --git a/scripts/server/bank.js b/scripts/server/bank.js index 481767f5..99796f2d 100644 --- a/scripts/server/bank.js +++ b/scripts/server/bank.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: bank.js // DESC: Provides banking functions and usage @@ -9,13 +8,13 @@ // =========================================================================== // House Owner Types -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. +const V_BANK_ACCT_OWNER_NONE = 0; // Not owned +const V_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) +const V_BANK_ACCT_OWNER_JOB = 2; // Owned by a job +const V_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan +const V_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction +const V_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction +const V_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used. // =========================================================================== @@ -26,7 +25,7 @@ function isPlayerAtBank(client) { let businessId = getPlayerBusiness(client); if (getBusinessData(client) != false) { - if (getBusinessData(businessId).type == AGRP_BIZ_TYPE_BANK) { + if (getBusinessData(businessId).type == V_BIZ_TYPE_BANK) { return true; } } diff --git a/scripts/server/bitflag.js b/scripts/server/bitflag.js index 7a0f0e91..077f47e4 100644 --- a/scripts/server/bitflag.js +++ b/scripts/server/bitflag.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: bitflags.js // DESC: Provides bitwise operations, functions and usage diff --git a/scripts/server/business.js b/scripts/server/business.js index 60ec4565..72bc7ca4 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: business.js // DESC: Provides business functions and usage @@ -9,34 +8,34 @@ // =========================================================================== // Business Types -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 -const AGRP_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc) +const V_BIZ_TYPE_NONE = 0; // None (invalid) +const V_BIZ_TYPE_NORMAL = 1; // Normal business (sells items) +const V_BIZ_TYPE_BANK = 2; // Bank +const V_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc) +const V_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter +const V_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc) // =========================================================================== // Business Location Types -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 +const V_BIZ_LOC_NONE = 0; // None +const V_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz +const V_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped +const V_BIZ_LOC_FUEL = 3; // Fuel pump +const V_BIZ_LOC_DRIVETHRU = 4; // Drivethrough +const V_BIZ_LOC_VENDMACHINE = 5; // Vending machine +const V_BIZ_LOC_ATM = 6; // ATM +const V_BIZ_LOC_PAYPHONE = 7; // Payphone // =========================================================================== // Business Owner Types -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 +const V_BIZ_OWNER_NONE = 0; // Not owned +const V_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const V_BIZ_OWNER_JOB = 2; // Owned by a job +const V_BIZ_OWNER_CLAN = 3; // Owned by a clan +const V_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const V_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc // =========================================================================== @@ -50,7 +49,7 @@ class BusinessData { constructor(dbAssoc = false) { this.databaseId = 0; this.name = ""; - this.ownerType = AGRP_BIZ_OWNER_NONE; + this.ownerType = V_BIZ_OWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.locked = false; @@ -58,8 +57,8 @@ class BusinessData { this.index = -1; this.needsSaved = false; this.interiorLights = true; - this.type = AGRP_BIZ_TYPE_NONE; - this.propertyType = AGRP_PROPERTY_TYPE_BUSINESS; + this.type = V_BIZ_TYPE_NONE; + this.propertyType = V_PROPERTY_TYPE_BUSINESS; this.floorItemCache = []; this.storageItemCache = []; @@ -94,7 +93,7 @@ class BusinessData { this.paintBallPlayers = []; - this.labelHelpType = AGRP_PROPLABEL_INFO_NONE; + this.labelHelpType = V_PROPLABEL_INFO_NONE; if (dbAssoc) { this.databaseId = toInteger(dbAssoc["biz_id"]); @@ -461,7 +460,7 @@ function setBusinessNameCommand(command, params, client) { let oldBusinessName = getBusinessData(businessId).name; getBusinessData(businessId).name = newBusinessName; - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true); getBusinessData(businessId).needsSaved = true; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true); } @@ -501,7 +500,7 @@ function setBusinessOwnerCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId; getBusinessData(businessId).needsSaved = true; @@ -543,7 +542,7 @@ function setBusinessJobCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).needsSaved = true; @@ -576,7 +575,7 @@ function setBusinessClanCommand(command, params, client) { return false; } - if (getBusinessData(business).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getBusinessData(business).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnBusiness")); return false; } @@ -588,9 +587,9 @@ function setBusinessClanCommand(command, params, client) { // Use confirm prompt showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_GIVEBIZTOCLAN; + getPlayerData(client).promptType = V_PROMPT_GIVEBIZTOCLAN; - //getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN; + //getBusinessData(businessId).ownerType = V_BIZ_OWNER_CLAN; //getBusinessData(businessId).ownerId = getClanData(clanId).databaseId; //getBusinessData(businessId).needsSaved = true; } @@ -621,7 +620,7 @@ function setBusinessRankCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) { let clanId = getClanIndexFromDatabaseId(getBusinessData(businessId).ownerId); rankId = getClanRankFromParams(clanId, params); if (!getClanRankData(clanId, rankId)) { @@ -630,7 +629,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 == AGRP_VEHOWNER_JOB) { + } else if (getBusinessData(businessId).ownerType == V_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!`); } @@ -727,7 +726,7 @@ function setBusinessJobCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).needsSaved = true; @@ -757,7 +756,7 @@ function setBusinessPublicCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PUBLIC; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_PUBLIC; getBusinessData(businessId).ownerId = 0; getBusinessData(businessId).needsSaved = true; @@ -787,7 +786,7 @@ function removeBusinessOwnerCommand(command, params, client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_NONE; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_NONE; getBusinessData(businessId).ownerId = -1; getBusinessData(businessId).needsSaved = true; @@ -880,7 +879,7 @@ function setBusinessPaintBallCommand(command, params, client) { return false; } - getBusinessData(businessId).type = AGRP_BIZ_TYPE_PAINTBALL; + getBusinessData(businessId).type = V_BIZ_TYPE_PAINTBALL; getBusinessData(businessId).needsSaved = true; messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall")); } @@ -912,24 +911,24 @@ function getBusinessInfoCommand(command, params, client) { let ownerName = "Unknown"; switch (businessData.ownerType) { - case AGRP_BIZ_OWNER_CLAN: + case V_BIZ_OWNER_CLAN: ownerName = getClanData(businessData.ownerId).name; break; - case AGRP_BIZ_OWNER_JOB: + case V_BIZ_OWNER_JOB: ownerName = getJobData(businessData.ownerId).name; break; - case AGRP_BIZ_OWNER_PLAYER: + case V_BIZ_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(businessData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; break; - case AGRP_BIZ_OWNER_PUBLIC: + case V_BIZ_OWNER_PUBLIC: ownerName = "Public"; break; - case AGRP_BIZ_OWNER_NONE: + case V_BIZ_OWNER_NONE: //submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`); ownerName = "None"; break; @@ -1295,7 +1294,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, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]); + let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, V_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]); getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2]; } } @@ -1324,8 +1323,8 @@ function setBusinessDealershipCommand(command, params, client) { return false; } - getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE; - getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP; + getBusinessData(businessId).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE; + getBusinessData(businessId).type = V_BIZ_TYPE_DEALERSHIP; updateBusinessPickupLabelData(businessId); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true); } @@ -1469,7 +1468,7 @@ function setBusinessBuyPriceCommand(command, params, client) { } getBusinessData(businessId).buyPrice = amount; - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true); getBusinessData(businessId).needsSaved = true; messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`); @@ -1569,7 +1568,7 @@ function orderItemForBusinessCommand(command, params, client) { let orderTotalCost = pricePerItem * amount; - //getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; + //getPlayerData(client).promptType = V_PROMPT_BIZORDER; getPlayerData(client).businessOrderAmount = amount; getPlayerData(client).businessOrderBusiness = businessId; getPlayerData(client).businessOrderItem = itemType; @@ -1577,7 +1576,7 @@ function orderItemForBusinessCommand(command, params, client) { getBusinessData(businessId).needsSaved = true; showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost"); - getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; + getPlayerData(client).promptType = V_PROMPT_BIZORDER; } // =========================================================================== @@ -1664,7 +1663,7 @@ function buyBusinessCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_BUYBIZ; + getPlayerData(client).promptType = V_PROMPT_BUYBIZ; } // =========================================================================== @@ -2022,7 +2021,7 @@ function createBusinessEntrancePickup(businessId) { logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`); - if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { + if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) { let entrancePickup = null; if (isGameFeatureSupported("pickup")) { let pickupModelId = getGameConfig().pickupModels[getGame()].Business; @@ -2099,7 +2098,7 @@ function createBusinessEntranceBlip(businessId) { logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`); - if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { + if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) { let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue")); if (entranceBlip != null) { if (businessData.entranceDimension != -1) { @@ -2350,17 +2349,17 @@ function exitBusiness(client) { */ function getBusinessOwnerTypeText(ownerType) { switch (ownerType) { - case AGRP_BIZ_OWNER_CLAN: + case V_BIZ_OWNER_CLAN: return "clan"; - case AGRP_BIZ_OWNER_JOB: + case V_BIZ_OWNER_JOB: return "job"; - case AGRP_BIZ_OWNER_PLAYER: + case V_BIZ_OWNER_PLAYER: return "player"; - case AGRP_BIZ_OWNER_NONE: - case AGRP_BIZ_OWNER_PUBLIC: + case V_BIZ_OWNER_NONE: + case V_BIZ_OWNER_PUBLIC: return "not owned"; default: @@ -2538,7 +2537,7 @@ function setBusinessDataIndexes() { //} for (let j in getServerData().businesses[i].locations) { - if (getServerData().businesses[i].locations[j].type == AGRP_BIZ_LOC_ATM) { + if (getServerData().businesses[i].locations[j].type == V_BIZ_LOC_ATM) { getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]); } } @@ -2554,7 +2553,7 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) { tempItemData.buyPrice = buyPrice; tempItemData.itemType = getItemTypeData(itemType).databaseId; tempItemData.ownerId = getBusinessData(business).databaseId; - tempItemData.ownerType = AGRP_ITEMOWNER_BIZ; + tempItemData.ownerType = V_ITEMOWNER_BIZ; tempItemData.ownerIndex = businessId; tempItemData.itemTypeIndex = itemType; saveItemToDatabase(tempItemData); @@ -2646,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, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); + createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); cachePlayerHotBarItems(client); getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost; @@ -2656,7 +2655,7 @@ function buyFromBusinessCommand(command, params, client) { } let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType; - if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { + if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) { if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) { messagePlayerError(client, getLocaleString(client, "WeaponBanned")); return false; @@ -2759,7 +2758,7 @@ function storeItemInBusinessStorageCommand(command, params, client) { return false; } - getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE; + getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = V_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}`); @@ -2803,7 +2802,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) { return false; } - getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR; + getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = V_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}`); @@ -2843,14 +2842,14 @@ function cacheBusinessItems(businessId) { //let businessData = getBusinessData(businessId); //logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`); - //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); + //getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index); + //getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId); logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`); for (let i in getServerData().items) { - if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { + if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { getBusinessData(businessId).floorItemCache.push(i); - } else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { + } else if (getItemData(i).ownerType == V_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { getBusinessData(businessId).storageItemCache.push(i); } } @@ -2869,57 +2868,57 @@ function getBusinessIdFromDatabaseId(databaseId) { // Updates all pickup data for a business by businessId function updateBusinessPickupLabelData(businessId) { - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId)); return false; } if (getBusinessData(businessId).exitPickup != null) { - 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", AGRP_LABEL_EXIT, true); + setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.type", V_PICKUP_BUSINESS_EXIT, false); + setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.id", businessId, false); + setEntityData(getBusinessData(businessId).exitPickup, "v.rp.label.type", V_LABEL_EXIT, true); } if (getBusinessData(businessId).entrancePickup != null) { - 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", 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", AGRP_PROPLABEL_INFO_NONE, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.type", V_PICKUP_BUSINESS_ENTRANCE, false); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.id", businessId, false); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.type", V_LABEL_BUSINESS, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.locked", getBusinessData(businessId).locked, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_NONE, true); switch (getBusinessData(businessId).labelHelpType) { - case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true); + case V_PROPLABEL_INFO_ENTERVEHICLE: { + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTERVEHICLE, true); break; } - case AGRP_PROPLABEL_INFO_ENTER: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); + case V_PROPLABEL_INFO_ENTER: { + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true); break; } - case AGRP_PROPLABEL_INFO_REPAIR: { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true); + case V_PROPLABEL_INFO_REPAIR: { + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_REPAIR, true); break; } default: { if (getBusinessData(businessId).hasInterior) { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true); } else { if (doesBusinessHaveAnyItemsToBuy(businessId)) { - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUY, true); } else { - removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help"); + removeEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help"); } } break; } } - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true); - setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.fee", getBusinessData(businessId).entranceFee, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true); + setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.fee", getBusinessData(businessId).entranceFee, true); } } @@ -2997,7 +2996,7 @@ function doesBusinessHaveAnyItemsToBuy(businessId) { //function clearPlayerBusinessGameScripts(client, businessId) { // for(let i in getBusinessData(businessId).gameScripts) { -// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); +// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY); // } //} @@ -3019,11 +3018,11 @@ function canPlayerWithdrawFromBusinessTill(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3039,11 +3038,11 @@ function canPlayerSetBusinessInteriorLights(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3059,11 +3058,11 @@ function canPlayerLockUnlockBusiness(client, businessId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; } @@ -3081,13 +3080,13 @@ function canPlayerManageBusiness(client, businessId, exemptAdminFlag = false) { } } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER) { if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN) { + if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN) { if (getBusinessData(businessId).ownerId == getPlayerClan(client)) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { return true; diff --git a/scripts/server/casino.js b/scripts/server/casino.js index bddcaadf..a496e592 100644 --- a/scripts/server/casino.js +++ b/scripts/server/casino.js @@ -1,28 +1,27 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: casino.js // DESC: Provides casino games functions and commands // TYPE: Server (JavaScript) // =========================================================================== -const AGRP_CASINO_GAME_NONE = 0; -const AGRP_CASINO_GAME_BLACKJACK = 1; -const AGRP_CASINO_GAME_POKER = 2; -const AGRP_CASINO_GAME_BACCARAT = 3; -const AGRP_CASINO_GAME_ROULETTE = 4; -const AGRP_CASINO_GAME_CRAPS = 5; -const AGRP_CASINO_GAME_HOLDEM = 6; +const V_CASINO_GAME_NONE = 0; +const V_CASINO_GAME_BLACKJACK = 1; +const V_CASINO_GAME_POKER = 2; +const V_CASINO_GAME_BACCARAT = 3; +const V_CASINO_GAME_ROULETTE = 4; +const V_CASINO_GAME_CRAPS = 5; +const V_CASINO_GAME_HOLDEM = 6; // =========================================================================== -const AGRP_CASINO_DECK_SUIT_NONE = 1; -const AGRP_CASINO_DECK_SUIT_CLUBS = 1; -const AGRP_CASINO_DECK_SUIT_DIAMONDS = 2; -const AGRP_CASINO_DECK_SUIT_HEARTS = 3; -const AGRP_CASINO_DECK_SUIT_SPADES = 4; +const V_CASINO_DECK_SUIT_NONE = 1; +const V_CASINO_DECK_SUIT_CLUBS = 1; +const V_CASINO_DECK_SUIT_DIAMONDS = 2; +const V_CASINO_DECK_SUIT_HEARTS = 3; +const V_CASINO_DECK_SUIT_SPADES = 4; // =========================================================================== @@ -37,45 +36,45 @@ class DeckCard { // =========================================================================== let cardDeck = [ - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"), - new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"), + new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"), + new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"), + new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"), ]; // =========================================================================== diff --git a/scripts/server/chat.js b/scripts/server/chat.js index 32408799..a4d0ed41 100644 --- a/scripts/server/chat.js +++ b/scripts/server/chat.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: chat.js // DESC: Provides chat functions and usage @@ -402,7 +401,7 @@ function clanChat(client, messageText) { // =========================================================================== function canPlayerUseMegaphone(client) { - if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) { + if (getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_MEGAPHONE) != -1) { if (isPlayerActiveItemEnabled(client)) { return true; } diff --git a/scripts/server/clan.js b/scripts/server/clan.js index 287a3ce9..5032d66f 100644 --- a/scripts/server/clan.js +++ b/scripts/server/clan.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: clan.js // DESC: Provides clan functions and usage diff --git a/scripts/server/client.js b/scripts/server/client.js index 6d937b82..41420ebe 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: client.js // DESC: Provides client communication and cross-endpoint operations @@ -9,9 +8,9 @@ // =========================================================================== // Return-To types (for when a player is teleported) -const AGRP_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid -const AGRP_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting -const AGRP_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select +const V_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid +const V_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting +const V_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select // =========================================================================== @@ -37,9 +36,9 @@ class ClientData { this.sessionId = 0; // Security - this.passwordResetState = AGRP_RESETPASS_STATE_NONE; + this.passwordResetState = V_RESETPASS_STATE_NONE; this.passwordResetCode = ""; - this.twoFactorAuthenticationState = AGRP_2FA_STATE_NONE; + this.twoFactorAuthenticationState = V_2FA_STATE_NONE; this.twoFactorAuthenticationCode = 0; this.loginTimeout = null; this.loginAttemptsRemaining = 3; @@ -65,11 +64,11 @@ class ClientData { // Items this.tempLockerCache = new Array(9).fill(-1); - this.tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE; + this.tempLockerType = V_TEMP_LOCKER_TYPE_NONE; this.hotBarItems = new Array(9).fill(-1); this.activeHotBarSlot = -1; this.toggleUseItem = false; - this.itemActionState = AGRP_ITEM_ACTION_NONE; + this.itemActionState = V_ITEM_ACTION_NONE; this.itemActionItem = -1; this.paintBallItemCache = []; @@ -104,7 +103,7 @@ class ClientData { this.returnToDimension = null; this.returnToHouse = null; this.returnToBusiness = null; - this.returnToType = AGRP_RETURNTO_TYPE_NONE; + this.returnToType = V_RETURNTO_TYPE_NONE; // Animation this.currentAnimation = -1; @@ -119,7 +118,7 @@ class ClientData { this.usingSkinSelect = false; this.keyBinds = []; this.incomingDamageMultiplier = 1; - this.weaponDamageEvent = AGRP_WEAPON_DAMAGE_EVENT_NORMAL; + this.weaponDamageEvent = V_WEAPON_DAMAGE_EVENT_NORMAL; this.lastJobVehicle = null; this.health = 100; this.locale = 0; @@ -128,8 +127,8 @@ class ClientData { this.scene = ""; this.playerBlip = null; this.alcoholLevel = 0; - this.pedState = AGRP_PEDSTATE_NONE; - this.promptType = AGRP_PROMPT_NONE; + this.pedState = V_PEDSTATE_NONE; + this.promptType = V_PROMPT_NONE; this.privateMessageReplyTo = null; this.enteringExitingProperty = null; this.inProperty = null; @@ -144,12 +143,12 @@ class ClientData { this.jobRouteEditNextLocationDelay = 0; this.jobRouteEditNextLocationArriveMessage = ""; this.jobRouteEditNextLocationGotoMessage = ""; - this.jobRouteEditNextLocationType = AGRP_JOB_ROUTE_LOC_TYPE_NONE; + this.jobRouteEditNextLocationType = V_JOB_ROUTE_LOC_TYPE_NONE; // Casino Stuff this.casinoChips = 0; // This might become an item with a useId of a business (for chips belonging to specific casinos) this.casinoCardHand = []; - this.casinoPlayingGame = AGRP_CASINO_GAME_NONE; + this.casinoPlayingGame = V_CASINO_GAME_NONE; } }; @@ -222,7 +221,7 @@ function initClient(client) { playerInitialized[client.index] = true; - //setEntityData(client, "agrp.isInitialized", true, false); + //setEntityData(client, "v.rp.isInitialized", true, false); logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`); sendPlayerCurrencyString(client); diff --git a/scripts/server/command.js b/scripts/server/command.js index ce2a2ea1..f9c64c45 100644 --- a/scripts/server/command.js +++ b/scripts/server/command.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: command.js // DESC: Provides command data, functions and usage diff --git a/scripts/server/config.js b/scripts/server/config.js index fac916f7..2c073dfb 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: config.js // DESC: Provides server configuration @@ -198,18 +197,18 @@ let globalConfig = { geoIPCityDatabaseFilePath: "modules/geoip/geoip-city.mmdb", randomTipInterval: 600000, weaponEquippableTypes: [ - AGRP_ITEM_USE_TYPE_WEAPON, - AGRP_ITEM_USE_TYPE_TAZER, - AGRP_ITEM_USE_TYPE_EXTINGUISHER, - AGRP_ITEM_USE_TYPE_SPRAYPAINT, - AGRP_ITEM_USE_TYPE_PEPPERSPRAY, + V_ITEM_USE_TYPE_WEAPON, + V_ITEM_USE_TYPE_TAZER, + V_ITEM_USE_TYPE_EXTINGUISHER, + V_ITEM_USE_TYPE_SPRAYPAINT, + V_ITEM_USE_TYPE_PEPPERSPRAY, ], onFootOnlyItems: [ - AGRP_ITEM_USE_TYPE_VEHREPAIR, - AGRP_ITEM_USE_TYPE_VEHCOLOUR, - AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART, - AGRP_ITEM_USE_TYPE_VEHLIVERY, - AGRP_ITEM_USE_TYPE_VEHTIRE, + V_ITEM_USE_TYPE_VEHREPAIR, + V_ITEM_USE_TYPE_VEHCOLOUR, + V_ITEM_USE_TYPE_VEHUPGRADE_PART, + V_ITEM_USE_TYPE_VEHLIVERY, + V_ITEM_USE_TYPE_VEHTIRE, ], vehicleInactiveRespawnDelay: 1800000, // 20 minutes chatSectionHeaderLength: 96, diff --git a/scripts/server/core.js b/scripts/server/core.js index 54d32026..e5235f79 100644 --- a/scripts/server/core.js +++ b/scripts/server/core.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: core.js // DESC: Provides core data structures, function, and operations diff --git a/scripts/server/crime.js b/scripts/server/crime.js index 0d05493d..b8e587cd 100644 --- a/scripts/server/crime.js +++ b/scripts/server/crime.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: crime.js // DESC: Provides crime data structures, functions, and operations diff --git a/scripts/server/database.js b/scripts/server/database.js index 9b882077..0ed6b53a 100644 --- a/scripts/server/database.js +++ b/scripts/server/database.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: database.js // DESC: Provides database handling, functions and usage diff --git a/scripts/server/developer.js b/scripts/server/developer.js index 4a7608bd..834e06cb 100644 --- a/scripts/server/developer.js +++ b/scripts/server/developer.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: developer.js // DESC: Provides developer operation, commands, functions and usage diff --git a/scripts/server/discord.js b/scripts/server/discord.js index 9cf67cc5..2a907d63 100644 --- a/scripts/server/discord.js +++ b/scripts/server/discord.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: discord.js // DESC: Provides discord bridging and connection functions and usage @@ -9,9 +8,9 @@ // =========================================================================== // Discord Webhook Types -const AGRP_DISCORD_WEBHOOK_NONE = 0; -const AGRP_DISCORD_WEBHOOK_LOG = 1; -const AGRP_DISCORD_WEBHOOK_ADMIN = 2; +const V_DISCORD_WEBHOOK_NONE = 0; +const V_DISCORD_WEBHOOK_LOG = 1; +const V_DISCORD_WEBHOOK_ADMIN = 2; // =========================================================================== @@ -111,7 +110,7 @@ function messageDiscordChatChannel(messageString) { messageString = removeColoursInMessage(messageString); messageString = replaceProfanityInMessage(messageString); - triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG); + triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG); } // =========================================================================== @@ -131,7 +130,7 @@ function messageDiscordEventChannel(messageString) { messageString = removeColoursInMessage(messageString); messageString = replaceProfanityInMessage(messageString); - triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG); + triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG); } // =========================================================================== @@ -150,7 +149,7 @@ function messageDiscordAdminChannel(messageString) { } messageString = removeColoursInMessage(messageString); - triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_ADMIN); + triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_ADMIN); } // =========================================================================== @@ -178,7 +177,7 @@ function messageDiscordClanWebhook(clanIndex, requiredFlagValue, messageString) // =========================================================================== -function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) { +function triggerDiscordWebHook(messageString, serverId = getServerId(), type = V_DISCORD_WEBHOOK_LOG) { if (!getGlobalConfig().discord.webhook.enabled) { return false; } diff --git a/scripts/server/economy.js b/scripts/server/economy.js index c971d4b3..d1c83fff 100644 --- a/scripts/server/economy.js +++ b/scripts/server/economy.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: economy.js // DESC: Provides economy/financial utils, functions and usage @@ -188,19 +187,19 @@ function repossessFirstAsset(client) { // =========================================================================== function getAllVehiclesOwnedByPlayer(client) { - return getServerData().vehicles.filter((v) => v.ownerType == AGRP_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId); + return getServerData().vehicles.filter((v) => v.ownerType == V_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId); } // =========================================================================== function getAllBusinessesOwnedByPlayer(client) { - return getServerData().businesses.filter((b) => b.ownerType == AGRP_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId); + return getServerData().businesses.filter((b) => b.ownerType == V_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId); } // =========================================================================== function getAllHousesOwnedByPlayer(client) { - return getServerData().houses.filter((h) => h.ownerType == AGRP_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId); + return getServerData().houses.filter((h) => h.ownerType == V_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId); } // =========================================================================== diff --git a/scripts/server/email.js b/scripts/server/email.js index 7593ad97..4063a96f 100644 --- a/scripts/server/email.js +++ b/scripts/server/email.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: email.js // DESC: Provides email handling, functions and usage @@ -9,9 +8,9 @@ // =========================================================================== // Email Methods -const AGRP_EMAIL_METHOD_NONE = 0; // None -const AGRP_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module -const AGRP_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page) +const V_EMAIL_METHOD_NONE = 0; // None +const V_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module +const V_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page) // =========================================================================== @@ -24,7 +23,7 @@ function initEmailScript() { async function sendEmail(toEmail, toName, subject, body) { switch (getEmailConfig().method) { - case AGRP_EMAIL_METHOD_SMTP_MODULE: + case V_EMAIL_METHOD_SMTP_MODULE: if (!checkForSMTPModule()) { return false; } @@ -46,7 +45,7 @@ async function sendEmail(toEmail, toName, subject, body) { }); break; - case AGRP_EMAIL_METHOD_GET_REQUEST: + case V_EMAIL_METHOD_GET_REQUEST: let tempURL = getEmailConfig().http.baseURL; tempURL = tempURL.replace("{0}", encodeURIComponent(getEmailConfig().http.password)); tempURL = tempURL.replace("{1}", encodeURIComponent(toEmail)); diff --git a/scripts/server/event.js b/scripts/server/event.js index 666c4209..71045029 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: event.js // DESC: Provides handlers for built in GTAC and Asshat-Gaming created events @@ -34,7 +33,7 @@ function addAllEventHandlers() { addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere); addEventHandler("onPedExitedSphereEx", onPedExitedSphere); - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { addEventHandler("onPedFall", onPedFall); } } @@ -168,7 +167,7 @@ function onEntityProcess(event, entity) { function onPedEnteringVehicle(event, ped, vehicle, seat) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGVEHICLE; + getPlayerData(client).pedState = V_PEDSTATE_ENTERINGVEHICLE; if (!getVehicleData(vehicle)) { return false; @@ -203,7 +202,7 @@ function onPedExitingVehicle(event, ped, vehicle) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); - getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE; + getPlayerData(client).pedState = V_PEDSTATE_EXITINGVEHICLE; } } @@ -324,7 +323,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) { logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`); - getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD; + getPlayerData(client).pedState = V_PEDSTATE_DEAD; updatePlayerSpawnedState(client, false); setPlayerControlState(client, false); setTimeout(function () { @@ -417,7 +416,7 @@ function onPedSpawn(ped) { logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`); //if (ped.type == ELEMENT_PLAYER) { - // if (getGame() != AGRP_GAME_MAFIA_ONE) { + // if (getGame() != V_GAME_MAFIA_ONE) { // //setTimeout(onPlayerSpawn, 250, getClientFromPlayerElement(ped)); // //onPlayerSpawn(getClientFromPlayerElement(ped)); // } @@ -470,7 +469,7 @@ async function onPlayerSpawn(client) { if (isGameFeatureSupported("pedScale")) { logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`); - setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true); + setEntityData(getPlayerPed(client), "v.rp.scale", getPlayerCurrentSubAccount(client).pedScale, true); } //if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) { @@ -495,7 +494,7 @@ async function onPlayerSpawn(client) { // Tried this. Doesn't work for some reason. // Mafia Connected needs fixed to set position on spawn. - //if (getGame() == AGRP_GAME_MAFIA_ONE) { + //if (getGame() == V_GAME_MAFIA_ONE) { // setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition); // setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading); // setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension); @@ -536,7 +535,7 @@ async function onPlayerSpawn(client) { if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) { logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`); - setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); + setEntityData(getPlayerPed(client), "v.rp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); } if (isGameFeatureSupported("fightStyle")) { @@ -571,20 +570,20 @@ async function onPlayerSpawn(client) { //sendPlayerGlobalKeyBindsState(client, !isPlayerAccountSettingEnabled(client, "NoKeyBinds")); //if(isGTAIV()) { - // setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); - // setEntityData(getPlayerPed(client), "agrp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); + // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); //} if (isGTAIV()) { @@ -592,7 +591,7 @@ async function onPlayerSpawn(client) { } logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`); - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; if (areServerElementsSupported()) { syncPlayerProperties(client); @@ -609,11 +608,11 @@ async function onPlayerSpawn(client) { sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance); } - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`); sendAllBusinessesToPlayer(client); sendAllHousesToPlayer(client); - if (getGame() != AGRP_GAME_GTA_IV) { + if (getGame() != V_GAME_GTA_IV) { sendAllJobsToPlayer(client); } requestPlayerPedNetworkId(client); @@ -634,7 +633,7 @@ async function onPlayerSpawn(client) { logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`); updateAllPlayerNameTags(); - setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); + setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_NORMAL); if (doesPlayerHaveGUIEnabled(client) && getServerConfig().useGUI == true) { if (checkForGeoIPModule()) { @@ -715,7 +714,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); if (client != null) { - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; if (getVehicleData(vehicle).spawnLocked == false && canPlayerManageVehicle(client, vehicle) == true) { getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle); @@ -739,7 +738,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) { getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); - logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); + logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); } } } @@ -768,14 +767,14 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) { return false; } - logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); + logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); getPlayerData(client).lastVehicle = vehicle; getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); - if (seat == AGRP_VEHSEAT_DRIVER) { + if (seat == V_VEHSEAT_DRIVER) { vehicle.engine = getVehicleData(vehicle).engine; - setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true); + setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true); //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; if (getVehicleData(vehicle).buyPrice > 0) { @@ -793,23 +792,23 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) { let ownerType = getLocaleString(client, "NotOwned"); ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType)); switch (getVehicleData(vehicle).ownerType) { - case AGRP_VEHOWNER_CLAN: + case V_VEHOWNER_CLAN: ownerName = getClanData(getClanIndexFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerType = getLocaleString(client, "Clan"); break; - case AGRP_VEHOWNER_JOB: + case V_VEHOWNER_JOB: ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerType = getLocaleString(client, "Job"); break; - case AGRP_VEHOWNER_PLAYER: + case V_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`; ownerType = getLocaleString(client, "Player"); break; - case AGRP_VEHOWNER_BIZ: + case V_VEHOWNER_BIZ: ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerType = getLocaleString(client, "Business"); break; @@ -839,7 +838,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) { let currentSubAccount = getPlayerCurrentSubAccount(client); if (isPlayerWorking(client)) { - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) { if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) { getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle; if (!hasPlayerSeenActionTip(client, "JobRouteStart")) { @@ -884,7 +883,7 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); if (client != null) { - if (seat == AGRP_VEHSEAT_DRIVER) { + if (seat == V_VEHSEAT_DRIVER) { //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; } onPlayerEnteringVehicle(client, vehicle, seat); @@ -908,7 +907,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) { if (ped.isType(ELEMENT_PLAYER)) { let client = getClientFromPlayerElement(ped); if (client != null) { - if (seat == AGRP_VEHSEAT_DRIVER) { + if (seat == V_VEHSEAT_DRIVER) { //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; } onPlayerExitingVehicle(client, vehicle, seat); diff --git a/scripts/server/fishing.js b/scripts/server/fishing.js index 6bafbd6d..b108f875 100644 --- a/scripts/server/fishing.js +++ b/scripts/server/fishing.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: fishing.js // DESC: Provides fishing functions and commands @@ -9,59 +8,59 @@ // =========================================================================== // Fishing Catch Types (Probably not going to be used, in favor of items and their use type) -const AGRP_FISHING_CATCH_TYPE_NONE = 0; -const AGRP_FISHING_CATCH_TYPE_FISH = 1; -const AGRP_FISHING_CATCH_TYPE_JUNK = 2; +const V_FISHING_CATCH_TYPE_NONE = 0; +const V_FISHING_CATCH_TYPE_FISH = 1; +const V_FISHING_CATCH_TYPE_JUNK = 2; // Fishing Line States -const AGRP_FISHING_LINE_STATE_NONE = 0; -const AGRP_FISHING_LINE_STATE_READY = 1; -const AGRP_FISHING_LINE_STATE_CASTING = 2; -const AGRP_FISHING_LINE_STATE_CASTED = 3; -const AGRP_FISHING_LINE_STATE_REELING = 4; -const AGRP_FISHING_LINE_STATE_HOOKED = 5; +const V_FISHING_LINE_STATE_NONE = 0; +const V_FISHING_LINE_STATE_READY = 1; +const V_FISHING_LINE_STATE_CASTING = 2; +const V_FISHING_LINE_STATE_CASTED = 3; +const V_FISHING_LINE_STATE_REELING = 4; +const V_FISHING_LINE_STATE_HOOKED = 5; // =========================================================================== let fishingCollectables = [ // Fish - ["Salmon", AGRP_FISHING_CATCH_TYPE_FISH], - ["Tuna", AGRP_FISHING_CATCH_TYPE_FISH], - ["Crab", AGRP_FISHING_CATCH_TYPE_FISH], - ["Trout", AGRP_FISHING_CATCH_TYPE_FISH], - ["Sea Bass", AGRP_FISHING_CATCH_TYPE_FISH], - ["Shark", AGRP_FISHING_CATCH_TYPE_FISH], - ["Turtle", AGRP_FISHING_CATCH_TYPE_FISH], - ["Manta Ray", AGRP_FISHING_CATCH_TYPE_FISH], - ["Cat Fish", AGRP_FISHING_CATCH_TYPE_FISH], - ["Blue Marlin", AGRP_FISHING_CATCH_TYPE_FISH], + ["Salmon", V_FISHING_CATCH_TYPE_FISH], + ["Tuna", V_FISHING_CATCH_TYPE_FISH], + ["Crab", V_FISHING_CATCH_TYPE_FISH], + ["Trout", V_FISHING_CATCH_TYPE_FISH], + ["Sea Bass", V_FISHING_CATCH_TYPE_FISH], + ["Shark", V_FISHING_CATCH_TYPE_FISH], + ["Turtle", V_FISHING_CATCH_TYPE_FISH], + ["Manta Ray", V_FISHING_CATCH_TYPE_FISH], + ["Cat Fish", V_FISHING_CATCH_TYPE_FISH], + ["Blue Marlin", V_FISHING_CATCH_TYPE_FISH], // Junk - ["Rusty Can", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Old Pants", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Old Shoes", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Garbage", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Baby Diaper", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Old Tire", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Old Car Battery", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Horse Hoove", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Soggy Log", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Soggy Dildo", AGRP_FISHING_CATCH_TYPE_JUNK], - ["Clump of Seaweed", AGRP_FISHING_CATCH_TYPE_JUNK], + ["Rusty Can", V_FISHING_CATCH_TYPE_JUNK], + ["Old Pants", V_FISHING_CATCH_TYPE_JUNK], + ["Old Shoes", V_FISHING_CATCH_TYPE_JUNK], + ["Garbage", V_FISHING_CATCH_TYPE_JUNK], + ["Baby Diaper", V_FISHING_CATCH_TYPE_JUNK], + ["Old Tire", V_FISHING_CATCH_TYPE_JUNK], + ["Old Car Battery", V_FISHING_CATCH_TYPE_JUNK], + ["Horse Hoove", V_FISHING_CATCH_TYPE_JUNK], + ["Soggy Log", V_FISHING_CATCH_TYPE_JUNK], + ["Soggy Dildo", V_FISHING_CATCH_TYPE_JUNK], + ["Clump of Seaweed", V_FISHING_CATCH_TYPE_JUNK], ]; // =========================================================================== let fishingAnimations = { - [AGRP_GAME_GTA_III]: { + [V_GAME_GTA_III]: { "fishingLineCasting": "bathit1", "fishingLineReeling": "aimdown", }, - [AGRP_GAME_GTA_VC]: { + [V_GAME_GTA_VC]: { "fishingLineCasting": "frontpunch", "fishingLineReeling": "aimdown", }, - [AGRP_GAME_GTA_SA]: { + [V_GAME_GTA_SA]: { "fishingLineCasting": "none", "fishingLineReeling": "none", } @@ -70,7 +69,7 @@ let fishingAnimations = { // =========================================================================== let fishingParticleEffects = { - [AGRP_GAME_GTA_III]: { + [V_GAME_GTA_III]: { "fishingLineCast": [ "MediumSprayingWater", 0.2, @@ -99,7 +98,7 @@ function castFishingLineCommand(command, params, client) { return false; } - if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) { + if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) { messagePlayerError(client, getLocaleString(client, "NeedFishingRod")); return false; } @@ -132,7 +131,7 @@ function resetFishingLineCommand(client) { return false; } - if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) { + if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) { messagePlayerError(client, getLocaleString(client, "NeedFishingRod")); return false; } @@ -151,7 +150,7 @@ function resetFishingLineCommand(client) { showSmallGameMessage(client, messageText); - getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_NONE; + getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_NONE; getPlayerData(client).fishingLineCastStart = 0; } @@ -173,7 +172,7 @@ function castPlayerFishingLine(client, strength) { showParticleEffect(frontPosition, getGameConfig().particleEffects[getGame()][particleEffectName], fishingParticleEffects[getGame()].fishingLineCast[1], fishingParticleEffects[getGame()].fishingLineCast[2]); getPlayerData(client).fishingLineCastPosition = frontPosition; - getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_CASTED; + getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_CASTED; }, strength * 10); } @@ -197,13 +196,13 @@ function isPlayerInFishingSpot(client) { // =========================================================================== function isPlayerFishing(client) { - return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE); + return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE); } // =========================================================================== function isPlayerFishing(client) { - return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE); + return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/forensics.js b/scripts/server/forensics.js index 264f1c10..ea823563 100644 --- a/scripts/server/forensics.js +++ b/scripts/server/forensics.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: forensics.js // DESC: Provides forensics functions and commands (bullet casings, blood, etc) @@ -9,13 +8,13 @@ // =========================================================================== // Forensic Types -const AGRP_FORENSICS_NONE = 0; -const AGRP_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon. -const AGRP_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot -const AGRP_FORENSICS_BODY = 3; // Body. A dead body lol -const AGRP_FORENSICS_HAIR = 4; // Hair. -const AGRP_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn -const AGRP_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten -const AGRP_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby) +const V_FORENSICS_NONE = 0; +const V_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon. +const V_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot +const V_FORENSICS_BODY = 3; // Body. A dead body lol +const V_FORENSICS_HAIR = 4; // Hair. +const V_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn +const V_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten +const V_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby) // =========================================================================== \ No newline at end of file diff --git a/scripts/server/gate.js b/scripts/server/gate.js index 7be83a68..23e42fc5 100644 --- a/scripts/server/gate.js +++ b/scripts/server/gate.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gate.js // DESC: Provides gate functions and commands @@ -9,14 +8,14 @@ // =========================================================================== // Gate Owner Types -const AGRP_GATEOWNER_NONE = 0; // Not owned -const AGRP_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount) -const AGRP_GATEOWNER_JOB = 2; // Owned by a job -const AGRP_GATEOWNER_CLAN = 3; // Owned by a clan -const AGRP_GATEOWNER_FACTION = 4; // Owned by a faction -const AGRP_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used. -const AGRP_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that -const AGRP_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas. +const V_GATEOWNER_NONE = 0; // Not owned +const V_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount) +const V_GATEOWNER_JOB = 2; // Owned by a job +const V_GATEOWNER_CLAN = 3; // Owned by a clan +const V_GATEOWNER_FACTION = 4; // Owned by a faction +const V_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used. +const V_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that +const V_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas. // =========================================================================== @@ -28,7 +27,7 @@ class GateData { this.enabled = false; this.position = toVector3(0.0, 0.0, 0.0); this.locked = true; - this.ownerType = AGRP_GATEOWNER_NONE; + this.ownerType = V_GATEOWNER_NONE; this.ownerId = 0; if (dbAssoc) { @@ -55,17 +54,17 @@ function initGateScript() { function doesPlayerHaveGateKeys(client, vehicle) { let gateData = getGateData(vehicle); - if (gateData.ownerType == AGRP_GATEOWNER_PUBLIC) { + if (gateData.ownerType == V_GATEOWNER_PUBLIC) { return true; } - if (gateData.ownerType == AGRP_GATEOWNER_PLAYER) { + if (gateData.ownerType == V_GATEOWNER_PLAYER) { if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (gateData.ownerType == AGRP_GATEOWNER_CLAN) { + if (gateData.ownerType == V_GATEOWNER_CLAN) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) { return true; } @@ -77,7 +76,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if (gateData.ownerType == AGRP_GATEOWNER_FACTION) { + if (gateData.ownerType == V_GATEOWNER_FACTION) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) { return true; } @@ -89,7 +88,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if (gateData.ownerType == AGRP_GATEOWNER_JOB) { + if (gateData.ownerType == V_GATEOWNER_JOB) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) { return true; } @@ -99,7 +98,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if (gateData.ownerType == AGRP_GATEOWNER_BUSINESS) { + if (gateData.ownerType == V_GATEOWNER_BUSINESS) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) { return true; } @@ -109,7 +108,7 @@ function doesPlayerHaveGateKeys(client, vehicle) { } } - if (gateData.ownerType == AGRP_GATEOWNER_HOUSE) { + if (gateData.ownerType == V_GATEOWNER_HOUSE) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { return true; } diff --git a/scripts/server/gps.js b/scripts/server/gps.js index 815d836d..402de2d9 100644 --- a/scripts/server/gps.js +++ b/scripts/server/gps.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gps.js // DESC: Provides GPS functions and commands @@ -9,36 +8,36 @@ // =========================================================================== // GPS State Types -const AGRP_GPS_TYPE_NONE = 0; // None (invalid) -const AGRP_GPS_TYPE_BUSINESS = 1; // Business -const AGRP_GPS_TYPE_POLICE = 2; // Police Station -const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital -const AGRP_GPS_TYPE_JOB = 4; // Job -const AGRP_GPS_TYPE_GAMELOC = 5; // Game Location +const V_GPS_TYPE_NONE = 0; // None (invalid) +const V_GPS_TYPE_BUSINESS = 1; // Business +const V_GPS_TYPE_POLICE = 2; // Police Station +const V_GPS_TYPE_HOSPITAL = 3; // Hospital +const V_GPS_TYPE_JOB = 4; // Job +const V_GPS_TYPE_GAMELOC = 5; // Game Location // =========================================================================== function gpsCommand(command, params, client) { messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList"))); - let locationType = AGRP_GPS_TYPE_NONE; - let useType = AGRP_ITEM_USE_TYPE_NONE; + let locationType = V_GPS_TYPE_NONE; + let useType = V_ITEM_USE_TYPE_NONE; let blipColour = "white"; switch (toLowerCase(params)) { case "police": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_POLICE; + locationType = V_GPS_TYPE_POLICE; break; case "hospital": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_HOSPITAL; + locationType = V_GPS_TYPE_HOSPITAL; break; case "job": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_JOB; + locationType = V_GPS_TYPE_JOB; break; case "skin": @@ -46,8 +45,8 @@ function gpsCommand(command, params, client) { case "clothes": case "player": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_SKIN; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_SKIN; break; case "gun": @@ -57,29 +56,29 @@ function gpsCommand(command, params, client) { case "wep": case "weps": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_WEAPON; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_WEAPON; break; case "food": case "eat": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_FOOD; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_FOOD; break; case "drink": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_DRINK; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_DRINK; break; case "alcohol": case "booze": case "bar": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_ALCOHOL; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_ALCOHOL; break; case "repair": @@ -88,8 +87,8 @@ function gpsCommand(command, params, client) { case "spray": case "fix": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_VEHREPAIR; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_VEHREPAIR; break; case "vehiclecolour": @@ -97,14 +96,14 @@ function gpsCommand(command, params, client) { case "carcolour": case "colour": blipColour = "businessBlue" - locationType = AGRP_GPS_TYPE_BUSINESS; - useType = AGRP_ITEM_USE_TYPE_VEHCOLOUR; + locationType = V_GPS_TYPE_BUSINESS; + useType = V_ITEM_USE_TYPE_VEHCOLOUR; break; default: { let itemTypeId = getItemTypeFromParams(params); if (getItemTypeData(itemTypeId) != false) { - locationType = AGRP_GPS_TYPE_BUSINESS; + locationType = V_GPS_TYPE_BUSINESS; blipColour = "businessBlue"; useType = getItemTypeData(itemTypeId).useType; } else { @@ -116,12 +115,12 @@ function gpsCommand(command, params, client) { } } - if (locationType == AGRP_GPS_TYPE_NONE) { + if (locationType == V_GPS_TYPE_NONE) { messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation")); return false; } - if (locationType == AGRP_GPS_TYPE_BUSINESS) { + if (locationType == V_GPS_TYPE_BUSINESS) { let businessId = getClosestBusinessWithBuyableItemOfUseType(useType); if (!businessId) { messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType")); @@ -138,7 +137,7 @@ function gpsCommand(command, params, client) { messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); } - if (locationType == AGRP_GPS_TYPE_GAMELOC) { + if (locationType == V_GPS_TYPE_GAMELOC) { hideAllBlipsForPlayerGPS(client); blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10); messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); diff --git a/scripts/server/gui.js b/scripts/server/gui.js index cda10c3d..63b43cc7 100644 --- a/scripts/server/gui.js +++ b/scripts/server/gui.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gui.js // DESC: Provides GUI functions and usage diff --git a/scripts/server/help.js b/scripts/server/help.js index f52105fe..8423d4f5 100644 --- a/scripts/server/help.js +++ b/scripts/server/help.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: help.js // DESC: Provides update info, help commands, and documentation diff --git a/scripts/server/house.js b/scripts/server/house.js index 7c22f867..1e863ac3 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: house.js // DESC: Provides house commands, functions, and usage @@ -9,19 +8,19 @@ // =========================================================================== // House Location Types -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 +const V_HOUSE_LOC_NONE = 0; // None +const V_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house +const V_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped // =========================================================================== // House Owner Types -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. +const V_HOUSE_OWNER_NONE = 0; // Not owned +const V_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) +const V_HOUSE_OWNER_JOB = 2; // Owned by a job +const V_HOUSE_OWNER_CLAN = 3; // Owned by a clan +const V_HOUSE_OWNER_FACTION = 4; // Owned by a faction +const V_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used. // =========================================================================== @@ -32,7 +31,7 @@ class HouseData { constructor(dbAssoc = false) { this.databaseId = 0 this.description = ""; - this.ownerType = AGRP_HOUSE_OWNER_NONE; + this.ownerType = V_HOUSE_OWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.rentPrice = 0; @@ -42,7 +41,7 @@ class HouseData { this.index = -1; this.needsSaved = false; this.interiorLights = true; - this.propertyType = AGRP_PROPERTY_TYPE_HOUSE; + this.propertyType = V_PROPERTY_TYPE_HOUSE; this.itemCache = []; this.locations = []; @@ -269,7 +268,7 @@ function setHouseDescriptionCommand(command, params, client) { let oldDescription = getHouseData(houseId).description; getHouseData(houseId).description = newHouseDescription; - setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true); + setEntityData(getHouseData(houseId).entrancePickup, "v.rp.label.name", getHouseData(houseId).description, true); getHouseData(houseId).needsSaved = true; @@ -302,13 +301,13 @@ function setHouseOwnerCommand(command, params, client) { } if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; } } - getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER; + getHouseData(houseId).ownerType = V_HOUSE_OWNER_PLAYER; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId; getHouseData(houseId).needsSaved = true; @@ -334,13 +333,13 @@ function removeHouseOwnerCommand(command, params, client) { } if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; } } - getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE; + getHouseData(houseId).ownerType = V_HOUSE_OWNER_NONE; getHouseData(houseId).ownerId = -1; getHouseData(houseId).needsSaved = true; @@ -373,7 +372,7 @@ function setHouseClanCommand(command, params, client) { return false; } - if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getHouseData(houseId).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnHouse")); return false; } @@ -384,7 +383,7 @@ function setHouseClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_GIVEHOUSETOCLAN; + getPlayerData(client).promptType = V_PROMPT_GIVEHOUSETOCLAN; //messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); } @@ -1054,7 +1053,7 @@ function createHouseEntrancePickup(houseId) { return false; } - if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { + if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) { let entrancePickup = null; if (isGameFeatureSupported("pickup")) { let pickupModelId = getGameConfig().pickupModels[getGame()].House; @@ -1131,8 +1130,8 @@ function createHouseEntranceBlip(houseId) { setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance); } - setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false); - setEntityData(entranceBlip, "agrp.owner.id", houseId, false); + setEntityData(entranceBlip, "v.rp.owner.type", V_BLIP_HOUSE_ENTRANCE, false); + setEntityData(entranceBlip, "v.rp.owner.id", houseId, false); houseData.entranceBlip = entranceBlip; } @@ -1239,8 +1238,8 @@ function createHouseExitBlip(houseId) { setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance); } setElementTransient(exitBlip, false); - setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false); - setEntityData(exitBlip, "agrp.owner.id", houseId, false); + setEntityData(exitBlip, "v.rp.owner.type", V_BLIP_HOUSE_EXIT, false); + setEntityData(exitBlip, "v.rp.owner.id", houseId, false); getHouseData(houseId).exitBlip = exitBlip; } } @@ -1249,22 +1248,22 @@ function createHouseExitBlip(houseId) { function getHouseOwnerTypeText(ownerType) { switch (ownerType) { - case AGRP_HOUSE_OWNER_CLAN: + case V_HOUSE_OWNER_CLAN: return "clan"; - case AGRP_HOUSE_OWNER_PLAYER: + case V_HOUSE_OWNER_PLAYER: return "player"; - case AGRP_HOUSE_OWNER_NONE: + case V_HOUSE_OWNER_NONE: return "not owned"; - case AGRP_HOUSE_OWNER_PUBLIC: + case V_HOUSE_OWNER_PUBLIC: return "not owned"; - case AGRP_HOUSE_OWNER_JOB: + case V_HOUSE_OWNER_JOB: return "job"; - case AGRP_HOUSE_OWNER_BIZ: + case V_HOUSE_OWNER_BIZ: return "business"; default: @@ -1299,28 +1298,28 @@ function getHouseInfoCommand(command, params, client) { let ownerName = "Unknown"; switch (getHouseData(houseId).ownerType) { - case AGRP_HOUSE_OWNER_CLAN: + case V_HOUSE_OWNER_CLAN: ownerName = getClanData(houseData).name; break; - case AGRP_HOUSE_OWNER_PLAYER: + case V_HOUSE_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(houseData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; break; - case AGRP_HOUSE_OWNER_NONE: + case V_HOUSE_OWNER_NONE: ownerName = "None"; break; - case AGRP_HOUSE_OWNER_PUBLIC: + case V_HOUSE_OWNER_PUBLIC: ownerName = "Public"; break; - case AGRP_HOUSE_OWNER_BIZ: + case V_HOUSE_OWNER_BIZ: ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name; break; - case AGRP_HOUSE_OWNER_JOB: + case V_HOUSE_OWNER_JOB: ownerName = getJobData(houseData.ownerId).name; break; } @@ -1455,7 +1454,7 @@ function buyHouseCommand(command, params, client) { return false; } - getPlayerData(client).promptType = AGRP_PROMPT_BUYHOUSE; + getPlayerData(client).promptType = V_PROMPT_BUYHOUSE; showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); } @@ -1614,7 +1613,7 @@ function cacheHouseItems(houseId) { getHouseData(houseId).itemCache = []; for (let i in getServerData().items) { - if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) { + if (getItemData(i).ownerType == V_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) { getHouseData(houseId).itemCache.push(i); } } @@ -1643,7 +1642,7 @@ function getHouseIdFromDatabaseId(databaseId) { //function clearPlayerHouseGameScripts(client, houseId) { // for(let i in getHouseData(houseId).gameScripts) { -// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); +// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY); // } //} @@ -1665,11 +1664,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; } @@ -1685,11 +1684,11 @@ function canPlayerLockUnlockHouse(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; } @@ -1739,13 +1738,13 @@ function canPlayerManageHouse(client, houseId) { return true; } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER) { if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) { + if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN) { if (getHouseData(houseId).ownerId == getPlayerClan(client)) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { return true; @@ -1779,7 +1778,7 @@ function getHouseFromParams(params) { // =========================================================================== function updateHousePickupLabelData(houseId) { - if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { + if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { sendHouseToPlayer(null, houseId, getHouseData(houseId).description, getHouseData(houseId).entrancePosition, getHouseEntranceBlipModelForNetworkEvent(houseId), getHouseEntrancePickupModelForNetworkEvent(houseId), getHouseData(houseId).buyPrice, getHouseData(houseId).rentPrice, getHouseData(houseId).hasInterior, getHouseData(houseId).locked); return false; } @@ -1787,26 +1786,26 @@ function updateHousePickupLabelData(houseId) { let houseData = getHouseData(houseId); if (houseData.entrancePickup != null) { - 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", AGRP_LABEL_HOUSE, true); - setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true); - setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true); - setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true); - setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true); - setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); + setEntityData(houseData.entrancePickup, "v.rp.owner.type", V_PICKUP_HOUSE_ENTRANCE, false); + setEntityData(houseData.entrancePickup, "v.rp.owner.id", houseId, false); + setEntityData(houseData.entrancePickup, "v.rp.label.type", V_LABEL_HOUSE, true); + setEntityData(houseData.entrancePickup, "v.rp.label.name", houseData.description, true); + setEntityData(houseData.entrancePickup, "v.rp.label.locked", houseData.locked, true); + setEntityData(houseData.entrancePickup, "v.rp.label.price", houseData.buyPrice, true); + setEntityData(houseData.entrancePickup, "v.rp.label.rentprice", houseData.rentPrice, true); + setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true); if (houseData.buyPrice > 0) { - setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true); + setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUYHOUSE, true); } else if (houseData.rentPrice > 0) { - setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true); + setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_RENTHOUSE, true); } } if (houseData.exitPickup != null) { - 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", AGRP_LABEL_EXIT, true); + setEntityData(houseData.exitPickup, "v.rp.owner.type", V_PICKUP_HOUSE_EXIT, false); + setEntityData(houseData.exitPickup, "v.rp.owner.id", houseId, false); + setEntityData(houseData.exitPickup, "v.rp.label.type", V_LABEL_EXIT, true); } } diff --git a/scripts/server/insurance.js b/scripts/server/insurance.js index 3bb7162c..986d6e93 100644 --- a/scripts/server/insurance.js +++ b/scripts/server/insurance.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: insurance.js // DESC: Provides insurance commands, functions, and usage @@ -9,33 +8,33 @@ // =========================================================================== // Insurance Account Owner Types -const AGRP_INS_ACCT_OWNER_NONE = 0; // None -const AGRP_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company -const AGRP_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company -const AGRP_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company +const V_INS_ACCT_OWNER_NONE = 0; // None +const V_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company +const V_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company +const V_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company // =========================================================================== // Insurance Account Entity Types -const AGRP_INS_ACCT_ENTITY_NONE = 0; // None -const AGRP_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance -const AGRP_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance -const AGRP_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance -const AGRP_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance -const AGRP_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance +const V_INS_ACCT_ENTITY_NONE = 0; // None +const V_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance +const V_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance +const V_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance +const V_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance +const V_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance // =========================================================================== // Insurance Account History Types -const AGRP_INS_ACCT_HISTORY_NONE = 0; // None -const AGRP_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury) -const AGRP_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death) -const AGRP_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed -const AGRP_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed -const AGRP_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen -const AGRP_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door) -const AGRP_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from -const AGRP_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged -const AGRP_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from +const V_INS_ACCT_HISTORY_NONE = 0; // None +const V_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury) +const V_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death) +const V_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed +const V_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed +const V_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen +const V_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door) +const V_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from +const V_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged +const V_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from // =========================================================================== \ No newline at end of file diff --git a/scripts/server/item.js b/scripts/server/item.js index eb0e7ebf..27bccbe4 100644 --- a/scripts/server/item.js +++ b/scripts/server/item.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: item.js // DESC: Provides item functions and usage @@ -9,111 +8,111 @@ // =========================================================================== // Item Owners -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 +const V_ITEM_OWNER_NONE = 0; // None +const V_ITEM_OWNER_PLAYER = 1; // Item is in a player's inventory +const V_ITEM_OWNER_VEHTRUNK = 2; // Item is in a vehicle's trunk +const V_ITEM_OWNER_VEHDASH = 3; // Item is in a vehicle's glove compartment +const V_ITEM_OWNER_BIZFLOOR = 4; // Item is in the public area of a business (on the floor = ready to buy) +const V_ITEM_OWNER_BIZSTORAGE = 5; // Item is in a business's storage area (stock room) +const V_ITEM_OWNER_HOUSE = 6; // Item is in a house +const V_ITEM_OWNER_SAFE = 7; // Item is in a safe (safes can be anywhere) +const V_ITEM_OWNER_ITEM = 8; // Item is in another item (trashbag, briefcase, wallet, suitcase, crate/box, barrel, etc) +const V_ITEM_OWNER_GROUND = 9; // Item is on the ground +const V_ITEM_OWNER_TEMPLOCKER = 10; // Item is in player's temp locker (used for paintball, jobs, etc) +const V_ITEM_OWNER_LOCKER = 10; // Item is in player's locker // =========================================================================== // Item Use Types -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 -const AGRP_ITEM_USE_TYPE_FISHINGROD = 59; // Fishing rod. Used for fishing. +const V_ITEM_USE_TYPE_NONE = 0; // Has no effect +const V_ITEM_USE_TYPE_WEAPON = 1; // Equips weapon +const V_ITEM_USE_TYPE_AMMO_CLIP = 2; // Magazine for weapon. If in inventory, R will load it into gun +const V_ITEM_USE_TYPE_PHONE = 3; // Pulls out phone +const V_ITEM_USE_TYPE_GPS = 4; // Not sure how I want this to work yet +const V_ITEM_USE_TYPE_MAP = 5; // Shows minimap on HUD +const V_ITEM_USE_TYPE_SKIN = 6; // Changes skin (uses skin changer) +const V_ITEM_USE_TYPE_PEDPART = 7; // Changes ped part (clothing, skin, hair, etc) (UNUSED) +const V_ITEM_USE_TYPE_PEDPROP = 8; // Changes ped prop (watches, glasses, hats, etc) (UNUSED) +const V_ITEM_USE_TYPE_STORAGE = 9; // Shows stored items. Backpack, crate, briefcase, wallet, etc +const V_ITEM_USE_TYPE_VEHKEY = 10; // Locks/unlocks a vehicle and allows starting engine without hotwire +const V_ITEM_USE_TYPE_BIZKEY = 11; // Locks/unlocks a business +const V_ITEM_USE_TYPE_HOUSEKEY = 12; // Locks/unlocks a house +const V_ITEM_USE_TYPE_SEED = 13; // Plants a seed +const V_ITEM_USE_TYPE_WEED = 14; // Light drug effect (short term relief of addiction symptoms?) +const V_ITEM_USE_TYPE_COKE = 15; // Medium drug effect (medium term relief of addiction symptoms?) +const V_ITEM_USE_TYPE_METH = 16; // Heavy drug effect (extended term relief of addiction symptoms?) +const V_ITEM_USE_TYPE_CIGAR = 17; // Just for appearance. Makes people look cool I guess +const V_ITEM_USE_TYPE_WATER = 18; // Replenishes small amount of health +const V_ITEM_USE_TYPE_FOOD = 19; // Eat food. Replenishes a small amount of health +const V_ITEM_USE_TYPE_BEER = 20; // Subtle drunk effect. Replenishes small amount of health. +const V_ITEM_USE_TYPE_WINE = 21; // Moderate drunk effect. Replenishes moderate amount of health. +const V_ITEM_USE_TYPE_LIQUOR = 22; // Heavy drunk effect. Replenishes large amount of health. +const V_ITEM_USE_TYPE_COFFEE = 23; // Replenishes moderate amount of health. +const V_ITEM_USE_TYPE_AMMO_ROUND = 23; // Bullet. Loads into magazine. Not used at the moment +const V_ITEM_USE_TYPE_HANDCUFF = 24; // +const V_ITEM_USE_TYPE_ROPE = 25; // +const V_ITEM_USE_TYPE_BLINDFOLD = 26; // +const V_ITEM_USE_TYPE_TAZER = 27; // +const V_ITEM_USE_TYPE_ARMOUR = 28; // +const V_ITEM_USE_TYPE_HEALTH = 29; // +const V_ITEM_USE_TYPE_AED = 30; // +const V_ITEM_USE_TYPE_WALKIETALKIE = 31; // +const V_ITEM_USE_TYPE_BOOMBOX = 32; // +const V_ITEM_USE_TYPE_EARBUDS = 33; // +const V_ITEM_USE_TYPE_BADGE = 34; // +const V_ITEM_USE_TYPE_DRINK = 35; // Drinkable item. Action output shows "Player_Name drinks some (drink name)" +const V_ITEM_USE_TYPE_EXTINGUISHER = 36; // Extinguisher item. Allows putting out fires +const V_ITEM_USE_TYPE_SPRAYPAINT = 37; // Spraypaint item. Allows spraying custom clan tags on walls +const V_ITEM_USE_TYPE_PEPPERSPRAY = 38; // Pepper spray item. Incapacitates nearby player +const V_ITEM_USE_TYPE_FLASHLIGHT = 39; // Flashlight item. Unusable for now, but plan to cast a custom light beam +const V_ITEM_USE_TYPE_AIRPLANETICKET = 40; // Airplane ticket. Allows a character to move to another server +const V_ITEM_USE_TYPE_TRAINTICKET = 41; // Train ticket. Allows a character to move to another server +const V_ITEM_USE_TYPE_VEHUPGRADE_PART = 42; // Vehicle update part item. Allows adding custom parts like spoilers, side skirts, roof scoops, etc +const V_ITEM_USE_TYPE_VEHTIRE = 43; // Vehicle tire item. Allows changing the tire/rim types +const V_ITEM_USE_TYPE_FUELCAN = 44; // Fuel can item. Allows refueling of a nearby vehicle anywhere +const V_ITEM_USE_TYPE_VEHCOLOUR = 45; // Vehicle colour item. Changes primary and secondary vehicle colours +const V_ITEM_USE_TYPE_VEHLIVERY = 46; // Vehicle livery/paintjob item. Applies decals and special paint jobs +const V_ITEM_USE_TYPE_VEHREPAIR = 47; // Vehicle repair item. Much longer use time +const V_ITEM_USE_TYPE_SMOKEDRUG = 48; // Smokable drug like weed. Action output shows "Player_Name smokes some (drug)" +const V_ITEM_USE_TYPE_SNORTDRUG = 49; // Snortable drug like cocaine. Action output shows "Player_Name snorts some (drug)" +const V_ITEM_USE_TYPE_PLANT = 50; // Plantable item. Pot plants, coke plants, etc +const V_ITEM_USE_TYPE_MEGAPHONE = 51; // Megaphone item. Allows shouting over greater distances. Also called a bullhorn +const V_ITEM_USE_TYPE_INJECTDRUG = 52; // Injectable drug like heroine. Action output shows "Player_Name injects some (drug)" +const V_ITEM_USE_TYPE_ALCOHOL = 53; // Alcohol. Applies an intoxication/drunkness effect +const V_ITEM_USE_TYPE_METH_LAB = 54; // Meth lab item. Allows creating meth +const V_ITEM_USE_TYPE_PLANTER = 55; // Plant pot. Can be used to plant item of use type V_ITEM_USE_TYPE_PLANT where terrain is not available +const V_ITEM_USE_TYPE_FISH = 56; // Fishing catch ... bass, catfish, etc +const V_ITEM_USE_TYPE_JUNK = 57; // Worthless junk. Some used as fishing catches +const V_ITEM_USE_TYPE_BAIT = 58; // Bait. Used for fishing +const V_ITEM_USE_TYPE_FISHINGROD = 59; // Fishing rod. Used for fishing. // =========================================================================== // Item Drop Types -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 +const V_ITEM_DROP_TYPE_NONE = 0; // Can't be dropped +const V_ITEM_DROP_TYPE_OBJECT = 1; // Drops as an object on the ground +const V_ITEM_DROP_TYPE_PICKUP = 2; // Drops as a pickup +const V_ITEM_DROP_TYPE_OBJECTLIGHT = 3; // Object that produces an area light effect (lamp, flashlight, etc) +const V_ITEM_DROP_TYPE_DESTROY = 4; // Will destroy the item on drop (keys mostly but for any tiny object) +const V_ITEM_DROP_TYPE_OBJECTSTACK = 5; // Stackable objects (crates and such). Will sit on top of closest other stackable // =========================================================================== // Item Occupied States -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) +const V_ITEM_ACTION_NONE = 0; // None +const V_ITEM_ACTION_USE = 1; // Using item +const V_ITEM_ACTION_PICKUP = 2; // Picking up item +const V_ITEM_ACTION_DROP = 3; // Dropping item +const V_ITEM_ACTION_SWITCH = 4; // Switching item +const V_ITEM_ACTION_PUT = 5; // Putting item (into trunk, dash, crate, etc) +const V_ITEM_ACTION_TAKE = 6; // Taking item (from trunk, dash, crate, etc) // =========================================================================== // Player Temporary Locker Types -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 +const V_TEMP_LOCKER_TYPE_NONE = 0; // None +const V_TEMP_LOCKER_TYPE_JOB = 1; // Job locker +const V_TEMP_LOCKER_TYPE_PAINTBALL = 2; // Paintball locker // =========================================================================== @@ -123,7 +122,7 @@ class ItemData { this.index = 0; this.itemTypeIndex = 0; this.itemType = 0; - this.ownerType = AGRP_ITEM_OWNER_NONE; + this.ownerType = V_ITEM_OWNER_NONE; this.ownerId = 0; this.ownerIndex = -1; this.position = toVector3(0.0, 0.0, 0.0); @@ -165,11 +164,11 @@ class ItemTypeData { this.index = 0; this.name = "Unknown"; this.enabled = false; - this.useType = AGRP_ITEM_USE_TYPE_NONE; + this.useType = V_ITEM_USE_TYPE_NONE; this.useId = 0; this.useValue = 0; this.maxValue = 0; - this.dropType = AGRP_ITEM_DROP_TYPE_NONE; + this.dropType = V_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); @@ -354,7 +353,7 @@ function createItem(itemTypeId, value, ownerType, ownerId, amount = 1) { // =========================================================================== function createGroundItem(itemTypeId, value, position, dimension = 0) { - let itemIndex = createItem(itemTypeId, value, AGRP_ITEM_OWNER_GROUND, 0); + let itemIndex = createItem(itemTypeId, value, V_ITEM_OWNER_GROUND, 0); getItemData(itemIndex).position = position; getItemData(itemIndex).dimension = dimension; createGroundItemObject(itemIndex); @@ -379,8 +378,8 @@ function createGroundItemObject(itemId) { setElementOnAllDimensions(getItemData(itemId).object, false); setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension); setElementInterior(getItemData(itemId).object, getItemData(itemId).interior); - setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true); - setEntityData(getItemData(itemId).object, "agrp.collisions", false, true); + setEntityData(getItemData(itemId).object, "v.rp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true); + setEntityData(getItemData(itemId).object, "v.rp.collisions", false, true); forcePlayerToSyncElementProperties(null, getItemData(itemId).object); addToWorld(getItemData(itemId).object); } @@ -456,7 +455,7 @@ function createItemCommand(command, params, client) { // return false; //} - let itemId = createItem(itemType, toInteger(value), AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); + let itemId = createItem(itemType, toInteger(value), V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); cachePlayerHotBarItems(client); messagePlayerSuccess(client, `You created a ${getItemTypeData(itemType).name} in your inventory`); } @@ -503,7 +502,7 @@ function useItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -517,7 +516,7 @@ function useItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).useAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_USE; + getPlayerData(client).itemActionState = V_ITEM_ACTION_USE; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemUseDelay(client, hotBarSlot); @@ -596,7 +595,7 @@ function pickupItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -610,7 +609,7 @@ function pickupItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).pickupAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_PICKUP; + getPlayerData(client).itemActionState = V_ITEM_ACTION_PICKUP; getPlayerData(client).itemActionItem = itemId; showPlayerItemPickupDelay(client, itemId); @@ -661,7 +660,7 @@ function dropItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -680,7 +679,7 @@ function dropItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).dropAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_DROP; + getPlayerData(client).itemActionState = V_ITEM_ACTION_DROP; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemDropDelay(client, hotBarSlot); @@ -727,7 +726,7 @@ function putItemCommand(command, params, client) { return false; } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -748,7 +747,7 @@ function putItemCommand(command, params, client) { forcePlayerPlayAnimation(client, getItemTypeData(getItemData(itemId).itemTypeIndex).putAnimationIndex, 0.0); } - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_PUT; + getPlayerData(client).itemActionState = V_ITEM_ACTION_PUT; getPlayerData(client).itemActionItem = hotBarSlot; showPlayerItemPutDelay(client, hotBarSlot); @@ -780,12 +779,12 @@ function takeItemCommand(command, params, client) { let bestOwner = getBestItemToTake(client, itemSlot); let itemId = bestOwner[2]; - if (bestOwner[1] == AGRP_ITEM_OWNER_NONE) { + if (bestOwner[1] == V_ITEM_OWNER_NONE) { messagePlayerError(client, getLocaleString(client, "NothingToTakeItemFrom")); return false; } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -805,7 +804,7 @@ function takeItemCommand(command, params, client) { } getPlayerData(client).itemActionItem = itemId; - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_TAKE; + getPlayerData(client).itemActionState = V_ITEM_ACTION_TAKE; showPlayerItemTakeDelay(client, itemId); //clearPlayerItemActionStateAfterDelay(client, getGlobalConfig().itemActionStateReset); @@ -1372,20 +1371,20 @@ function playerUseItem(client, hotBarSlot) { markPlayerActionTipSeen(client, "UseItemKeyAfterEquipping"); switch (toInteger(itemTypeData.useType)) { - case AGRP_ITEM_USE_TYPE_SKIN: { + case V_ITEM_USE_TYPE_SKIN: { getPlayerData(client).itemActionItem = itemIndex; forcePlayerIntoSkinSelect(client); break; } - case AGRP_ITEM_USE_TYPE_WEAPON: { + case V_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 == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { + if (getItemTypeData(getItemData(hotBarItems[i]).itemTypeIndex).useType == V_ITEM_USE_TYPE_AMMO_CLIP) { let ammoItemData = getItemData(hotBarItems[i]); let ammoItemTypeData = getItemTypeData(ammoItemData.itemTypeIndex); if (ammoItemTypeData.useId == itemTypeData.databaseId) { @@ -1406,7 +1405,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_AMMO_CLIP: { + case V_ITEM_USE_TYPE_AMMO_CLIP: { if (doesPlayerHaveKeyBindForCommand(client, "use")) { messagePlayerError(client, getLocaleString(client, "LoadAmmoIntoWeaponHelpKeyPress", `{ALTCOLOUR}${toUpperCase(getKeyNameFromId(getPlayerKeyBindForCommand(client, "use").key))}{MAINCOLOUR}`)); } else { @@ -1415,12 +1414,12 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_STORAGE: { + case V_ITEM_USE_TYPE_STORAGE: { showItemInventoryToPlayer(client, itemIndex); break; } - case AGRP_ITEM_USE_TYPE_FOOD: { + case V_ITEM_USE_TYPE_FOOD: { meActionToNearbyPlayers(client, `eats some of their ${itemTypeData.name}`); givePlayerHealth(client, itemTypeData.useValue); itemData.value = itemData.value - itemTypeData.useValue; @@ -1431,7 +1430,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_DRINK: { + case V_ITEM_USE_TYPE_DRINK: { meActionToNearbyPlayers(client, `drinks some of their ${itemTypeData.name}`); givePlayerHealth(client, itemTypeData.useValue); itemData.value = itemData.value - itemTypeData.useValue; @@ -1442,7 +1441,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_ARMOUR: { + case V_ITEM_USE_TYPE_ARMOUR: { meActionToNearbyPlayers(client, `puts on a ${itemTypeData.name}`); givePlayerArmour(client, itemTypeData.useValue); deleteItem(itemIndex); @@ -1450,7 +1449,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_ROPE: { + case V_ITEM_USE_TYPE_ROPE: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1483,7 +1482,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_HANDCUFF: { + case V_ITEM_USE_TYPE_HANDCUFF: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1511,7 +1510,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_VEHREPAIR: { + case V_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`); @@ -1529,7 +1528,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART: { + case V_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.`); @@ -1541,7 +1540,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_VEHLIVERY: { + case V_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.`); @@ -1550,7 +1549,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_VEHCOLOUR: { + case V_ITEM_USE_TYPE_VEHCOLOUR: { let vehicle = getClosestVehicle(getPlayerPosition(client)); if (getDistance(getPlayerPosition(client), getVehiclePosition(vehicle)) <= getGlobalConfig().vehicleRepairDistance) { if (itemData.useId == 1) { @@ -1570,7 +1569,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_FUELCAN: { + case V_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)) { @@ -1609,7 +1608,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_WALKIETALKIE: { + case V_ITEM_USE_TYPE_WALKIETALKIE: { itemData.enabled = !itemData.enabled; meActionToNearbyPlayers(client, `turns ${toLowerCase(getOnOffFromBool(itemData.enabled))} their walkie-talkie`); @@ -1621,7 +1620,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_PHONE: { + case V_ITEM_USE_TYPE_PHONE: { if (itemData.value == 0) { let phoneNumber = generateRandomPhoneNumber(); itemData.value = phoneNumber; @@ -1639,7 +1638,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_SMOKEDRUG: { + case V_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) { @@ -1650,7 +1649,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_SNORTDRUG: { + case V_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) { @@ -1661,7 +1660,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_INJECTDRUG: { + case V_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) { @@ -1672,7 +1671,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_PLANT: { + case V_ITEM_USE_TYPE_PLANT: { meActionToNearbyPlayers(client, `bends down and plants a ${itemTypeData.name} in the ground`); createGroundPlant(itemIndex); if (itemData.value == 0) { @@ -1682,7 +1681,7 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_BADGE: { + case V_ITEM_USE_TYPE_BADGE: { meActionToNearbyPlayers(client, `shows their badge to everyone nearby.`); let clients = getClients(); for (let i in clients) { @@ -1696,12 +1695,12 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_AMMO_CLIP: { + case V_ITEM_USE_TYPE_AMMO_CLIP: { messagePlayerError(client, `Equip a compatible weapon and press R to use an ammo clip/magazine`); break; } - case AGRP_ITEM_USE_TYPE_HEALTH: { + case V_ITEM_USE_TYPE_HEALTH: { let closestPlayer = getClosestPlayer(getPlayerPosition(client), client); if (!getPlayerData(closestPlayer)) { @@ -1716,26 +1715,26 @@ function playerUseItem(client, hotBarSlot) { break; } - case AGRP_ITEM_USE_TYPE_LOTTOTICKET: { + case V_ITEM_USE_TYPE_LOTTOTICKET: { messagePlayerError(client, getLocaleString(client, "ItemDoesntDoAnythingOnUse", itemTypeData.name)); break; } - case AGRP_ITEM_USE_TYPE_AREARADIO: { + case V_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 AGRP_ITEM_USE_TYPE_PERSONALRADIO: { + case V_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 AGRP_ITEM_USE_TYPE_NONE: { + case V_ITEM_USE_TYPE_NONE: { messagePlayerError(client, getLocaleString(client, "ItemDoesntDoAnythingOnUse", itemTypeData.name)); break; } @@ -1768,7 +1767,7 @@ function playerDropItem(client, hotBarSlot) { updatePlayerHotBar(client); clearPlayerWeapons(client); - getItemData(itemId).ownerType = AGRP_ITEM_OWNER_GROUND; + getItemData(itemId).ownerType = V_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); @@ -1786,42 +1785,42 @@ function playerPutItem(client, hotBarSlot) { let bestNewOwner = getBestNewOwnerToPutItem(client); - //if (bestNewOwner[0] == AGRP_ITEM_OWNER_NONE) { + //if (bestNewOwner[0] == V_ITEM_OWNER_NONE) { // return false; //} switch (bestNewOwner[0]) { - case AGRP_ITEM_OWNER_ITEM: + case V_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 AGRP_ITEM_OWNER_VEHTRUNK: + case V_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 AGRP_ITEM_OWNER_VEHDASH: + case V_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 AGRP_ITEM_OWNER_HOUSE: + case V_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 AGRP_ITEM_OWNER_BIZFLOOR: + case V_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 AGRP_ITEM_OWNER_BIZSTORAGE: + case V_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`); @@ -1847,7 +1846,7 @@ function playerPickupItem(client, itemId) { let firstSlot = getPlayerFirstEmptyHotBarSlot(client); if (firstSlot != -1) { - getItemData(itemId).ownerType = AGRP_ITEM_OWNER_PLAYER; + getItemData(itemId).ownerType = V_ITEM_OWNER_PLAYER; getItemData(itemId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getItemData(itemId).position = toVector3(0.0, 0.0, 0.0); getItemData(itemId).dimension = 0; @@ -1869,34 +1868,34 @@ function playerTakeItem(client, itemId) { let ownerId = getItemIdFromDatabaseId(getItemData(itemId).ownerId); - getItemData(itemId).ownerType = AGRP_ITEM_OWNER_PLAYER; + getItemData(itemId).ownerType = V_ITEM_OWNER_PLAYER; getItemData(itemId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getPlayerData(client).hotBarItems[firstSlot] = itemId; updatePlayerHotBar(client); switch (bestOwner[1]) { - case AGRP_ITEM_OWNER_HOUSE: + case V_ITEM_OWNER_HOUSE: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromHouse", getItemName(itemId))); break; - case AGRP_ITEM_OWNER_BIZFLOOR: + case V_ITEM_OWNER_BIZFLOOR: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromBusiness", getItemName(itemId))); break; - case AGRP_ITEM_OWNER_BIZSTORAGE: + case V_ITEM_OWNER_BIZSTORAGE: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromBusinessStorage", getItemName(itemId))); break; - case AGRP_ITEM_OWNER_VEHTRUNK: + case V_ITEM_OWNER_VEHTRUNK: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromVehicleTrunk", getItemName(itemId))); break; - case AGRP_ITEM_OWNER_VEHDASH: + case V_ITEM_OWNER_VEHDASH: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromVehicleDash", getItemName(itemId))); break; - case AGRP_ITEM_OWNER_ITEM: + case V_ITEM_OWNER_ITEM: meActionToNearbyPlayers(client, getLocaleString(client, "TakeItemFromItem", getItemName(itemId)), getItemName(ownerId)); break; } @@ -1944,28 +1943,28 @@ function playerSwitchItem(client, newHotBarSlot) { if (newHotBarItem != -1) { if (getItemData(newHotBarItem)) { - if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WEAPON) { + if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == V_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, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); + setPlayerWeaponDamageEvent(client, V_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, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); + setPlayerWeaponDamageEvent(client, V_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 == AGRP_ITEM_USE_TYPE_TAZER) { + } else if (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType == V_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, AGRP_WEAPON_DAMAGE_EVENT_TAZER); + setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_TAZER); } else { messagePlayerError(client, getLocaleString(client, "ItemUnequippableNoAmmo", getItemName(newHotBarItem), newHotBarSlot)); } @@ -1987,31 +1986,31 @@ function playerSwitchItem(client, newHotBarSlot) { } switch (getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).useType) { - case AGRP_ITEM_USE_TYPE_AMMO_CLIP: + case V_ITEM_USE_TYPE_AMMO_CLIP: if (!hasPlayerSeenActionTip(client, "AmmoClipItemUsage")) { messagePlayerTip(client, getGroupedLocaleString(client, "AmmoClipItemUsage", getKeyOrCommandForPlayerMessage(client, "use"))); } break; - case AGRP_ITEM_USE_TYPE_VEHREPAIR: + case V_ITEM_USE_TYPE_VEHREPAIR: if (!hasPlayerSeenActionTip(client, "VehicleRepairKitItemUsage")) { messagePlayerTip(client, getGroupedLocaleString(client, "VehicleRepairKitItemUsage", getKeyOrCommandForPlayerMessage(client, "use"))); } break; - case AGRP_ITEM_USE_TYPE_VEHCOLOUR: + case V_ITEM_USE_TYPE_VEHCOLOUR: if (!hasPlayerSeenActionTip(client, "VehicleColourKitItemUsage")) { messagePlayerTip(client, getGroupedLocaleString(client, "VehicleColourKitItemUsage", getKeyOrCommandForPlayerMessage(client, "use"))); } break; - case AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART: + case V_ITEM_USE_TYPE_VEHUPGRADE_PART: if (!hasPlayerSeenActionTip(client, "VehiclePartItemUsage")) { messagePlayerTip(client, getGroupedLocaleString(client, "VehiclePartItemUsage", getKeyOrCommandForPlayerMessage(client, "use"), getItemTypeData(getItemData(newHotBarItem).itemTypeIndex).name)); } break; - case AGRP_ITEM_USE_TYPE_WALKIETALKIE: + case V_ITEM_USE_TYPE_WALKIETALKIE: if (!hasPlayerSeenActionTip(client, "UseItemKeyAfterEquippingWalkieTalkie")) { messagePlayerInfo(client, getGroupedLocaleString(client, "ActionTips", "UseItemKeyAfterEquippingWalkieTalkie", (doesPlayerHaveKeyBindForCommand(client, "use")) ? `{ALTCOLOUR}U{MAINCOLOUR}` : `{ALTCOLOUR}/use{MAINCOLOUR}`)); } @@ -2066,7 +2065,7 @@ function playerSwitchHotBarSlotCommand(command, params, client) { } } - if (getPlayerData(client).itemActionState != AGRP_ITEM_ACTION_NONE) { + if (getPlayerData(client).itemActionState != V_ITEM_ACTION_NONE) { messagePlayerError(client, getLocaleString(client, "HandsBusy")); return false; } @@ -2130,7 +2129,7 @@ function setAllItemTypeDataIndexes() { function cacheAllGroundItems() { clearArray(getServerData().groundItemCache); for (let i in getServerData().items) { - if (getServerData().items[i].ownerType == AGRP_ITEM_OWNER_GROUND) { + if (getServerData().items[i].ownerType == V_ITEM_OWNER_GROUND) { getServerData().groundItemCache.push(i); } } @@ -2174,7 +2173,7 @@ function cachePlayerHotBarItems(client) { } for (let i in getServerData().items) { - if (getItemData(i).ownerType == AGRP_ITEM_OWNER_PLAYER) { + if (getItemData(i).ownerType == V_ITEM_OWNER_PLAYER) { if (getItemData(i).ownerId == getPlayerCurrentSubAccount(client).databaseId) { let firstSlot = getPlayerFirstEmptyHotBarSlot(client); if (firstSlot != -1) { @@ -2191,13 +2190,13 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { let owner = -1; let ownerTypeString = "Unknown"; switch (getItemData(itemId).ownerType) { - case AGRP_ITEM_OWNER_GROUND: + case V_ITEM_OWNER_GROUND: ownerTypeString = "Ground/Dropped"; deleteGroundItemObject(itemId); getServerData().groundItemCache.splice(getServerData().groundItemCache.indexOf(itemId), 1); break; - case AGRP_ITEM_OWNER_PLAYER: + case V_ITEM_OWNER_PLAYER: ownerTypeString = "Player"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2207,7 +2206,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_TEMPLOCKER: + case V_ITEM_OWNER_TEMPLOCKER: ownerTypeString = "Job Locker"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2215,7 +2214,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_LOCKER: + case V_ITEM_OWNER_LOCKER: ownerTypeString = "Locker"; owner = getPlayerFromCharacterId(getItemData(itemId).ownerId); if (getPlayerData(owner) != false) { @@ -2223,7 +2222,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_VEHTRUNK: + case V_ITEM_OWNER_VEHTRUNK: ownerTypeString = "Vehicle Trunk"; owner = getVehicleFromDatabaseId(getItemData(itemId).ownerId) if (getVehicleData(owner) != false) { @@ -2231,7 +2230,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_BIZFLOOR: + case V_ITEM_OWNER_BIZFLOOR: ownerTypeString = "Business Floor"; owner = getBusinessIdFromDatabaseId(getItemData(itemId).ownerId); if (getBusinessData(owner) != false) { @@ -2239,7 +2238,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_BIZSTORAGE: + case V_ITEM_OWNER_BIZSTORAGE: ownerTypeString = "Business Storage"; owner = getBusinessIdFromDatabaseId(getItemData(itemId).ownerId); if (getBusinessData(owner) != false) { @@ -2247,7 +2246,7 @@ function deleteItem(itemId, whoDeleted = -1, resetAllItemIndexes = true) { } break; - case AGRP_ITEM_OWNER_HOUSE: + case V_ITEM_OWNER_HOUSE: ownerTypeString = "House"; owner = getHouseIdFromDatabaseId(getItemData(itemId).ownerId); if (getHouseData(owner) != false) { @@ -2275,32 +2274,32 @@ function getBestNewOwnerToPutItem(client) { let possibleItem = getClosestItemOnGround(position); if (possibleItem != -1) { if (getDistance(getItemPosition(possibleItem), position) <= getGlobalConfig().itemContainerDistance) { - return [AGRP_ITEM_OWNER_ITEM, possibleItem]; + return [V_ITEM_OWNER_ITEM, possibleItem]; } } let possibleVehicle = getClosestVehicle(position); if (possibleVehicle != false) { if (getVehicleData(possibleVehicle) != false && getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= getGlobalConfig().vehicleTrunkDistance) { - return [AGRP_ITEM_OWNER_VEHTRUNK, possibleVehicle]; + return [V_ITEM_OWNER_VEHTRUNK, possibleVehicle]; } } let possibleHouse = getPlayerHouse(client); if (possibleHouse != -1) { if (getHouseData(possibleHouse) != false) { - return [AGRP_ITEM_OWNER_HOUSE, possibleHouse]; + return [V_ITEM_OWNER_HOUSE, possibleHouse]; } } let possibleBusiness = getPlayerBusiness(client); if (possibleBusiness != -1) { if (getBusinessData(possibleBusiness) != false) { - return [AGRP_ITEM_OWNER_BIZSTORAGE, possibleBusiness]; + return [V_ITEM_OWNER_BIZSTORAGE, possibleBusiness]; } } - return [AGRP_ITEM_OWNER_NONE, 0]; + return [V_ITEM_OWNER_NONE, 0]; } // =========================================================================== @@ -2309,14 +2308,14 @@ function getBestItemToTake(client, slot) { let closestDistance = 100.0; let position = getPlayerPosition(client); let itemId = -1; - let ownerType = AGRP_ITEM_OWNER_NONE; + let ownerType = V_ITEM_OWNER_NONE; let ownerId = 0; let possibleItem = getClosestItemOnGround(position); if (getItemData(possibleItem)) { if (typeof getItemData(possibleItem).itemCache[slot] != "undefined") { itemId = getItemData(possibleItem).itemCache[slot] - ownerType = AGRP_ITEM_OWNER_ITEM; + ownerType = V_ITEM_OWNER_ITEM; ownerId = possibleItem; } } @@ -2325,7 +2324,7 @@ function getBestItemToTake(client, slot) { if (getHouseData(possibleHouse)) { if (typeof getHouseData(possibleHouse).itemCache[slot] != "undefined") { itemId = getHouseData(possibleHouse).itemCache[slot]; - ownerType = AGRP_ITEM_OWNER_HOUSE; + ownerType = V_ITEM_OWNER_HOUSE; ownerId = possibleHouse; } } @@ -2334,7 +2333,7 @@ function getBestItemToTake(client, slot) { if (getBusinessData(possibleBusiness)) { if (typeof getBusinessData(possibleBusiness).floorItemCache[slot] != "undefined") { itemId = getBusinessData(possibleBusiness).floorItemCache[slot]; - ownerType = AGRP_ITEM_OWNER_BIZFLOOR; + ownerType = V_ITEM_OWNER_BIZFLOOR; ownerId = possibleBusiness; } } @@ -2344,7 +2343,7 @@ function getBestItemToTake(client, slot) { if (getDistance(getVehicleTrunkPosition(possibleVehicle), position) <= closestDistance) { if (typeof getVehicleData(possibleVehicle).trunkItemCache[slot] != "undefined") { itemId = getVehicleData(possibleVehicle).trunkItemCache[slot]; - ownerType = AGRP_ITEM_OWNER_VEHTRUNK; + ownerType = V_ITEM_OWNER_VEHTRUNK; ownerId = possibleVehicle; } } @@ -2481,7 +2480,7 @@ function listItemInventoryCommand(command, params, client) { return false; } - if (getItemTypeData(getItemData(itemId).itemTypeIndex).useType != AGRP_ITEM_USE_TYPE_STORAGE) { + if (getItemTypeData(getItemData(itemId).itemTypeIndex).useType != V_ITEM_USE_TYPE_STORAGE) { messagePlayerError(client, "This item can't hold anything!"); return false; } @@ -2726,7 +2725,7 @@ function restorePlayerTempLockerItems(client) { cachePlayerHotBarItems(client); updatePlayerHotBar(client); - getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE; + getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_NONE; } // =========================================================================== @@ -2756,27 +2755,27 @@ function getItemTypeIndexFromDatabaseId(databaseId) { function playerItemActionDelayComplete(client) { logToConsole(LOG_VERBOSE, `[AGRP.Item]: Player ${getPlayerDisplayForConsole(client)} item action delay complete (State: ${getPlayerData(client).itemActionState})`); switch (getPlayerData(client).itemActionState) { - case AGRP_ITEM_ACTION_USE: + case V_ITEM_ACTION_USE: playerUseItem(client, getPlayerData(client).itemActionItem); break; - case AGRP_ITEM_ACTION_DROP: + case V_ITEM_ACTION_DROP: playerDropItem(client, getPlayerData(client).itemActionItem); break; - case AGRP_ITEM_ACTION_TAKE: + case V_ITEM_ACTION_TAKE: playerTakeItem(client, getPlayerData(client).itemActionItem); break; - case AGRP_ITEM_ACTION_PUT: + case V_ITEM_ACTION_PUT: playerPutItem(client, getPlayerData(client).itemActionItem); break; - case AGRP_ITEM_ACTION_PICKUP: + case V_ITEM_ACTION_PICKUP: playerPickupItem(client, getPlayerData(client).itemActionItem); break; - case AGRP_ITEM_ACTION_SWITCH: + case V_ITEM_ACTION_SWITCH: playerSwitchItem(client, getPlayerData(client).itemActionItem); break; @@ -2804,22 +2803,22 @@ function getItemValueDisplayForItem(itemId) { // =========================================================================== function getItemValueDisplay(itemType, value) { - if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_SKIN) { + if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_SKIN) { return "any"; - } 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) { + } else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_FOOD || getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_DRINK || getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_EXTINGUISHER || getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_SPRAYPAINT || getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_PEPPERSPRAY) { return getPercentage(toString(value), getItemTypeData(itemType).capacity) + "%"; - } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_PHONE) { + } else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_PHONE) { return toString(value); - } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_WEAPON || getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_TAZER) { + } else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_WEAPON || getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_TAZER) { if (isMeleeWeapon(getItemTypeData(itemType).useId)) { return false; } return toString(value) + " rounds"; - } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { + } else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_WALKIETALKIE) { return toString(toString(value).slice(0, -2) + "." + toString(value).slice(-1) + "MHz"); - } else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_BADGE) { + } else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_BADGE) { return `#${value}`; - //} else if (getItemTypeData(itemType).useType == AGRP_ITEM_USE_TYPE_VEHCOLOUR) { + //} else if (getItemTypeData(itemType).useType == V_ITEM_USE_TYPE_VEHCOLOUR) { // return `[${getGameConfig().vehicleColourHex[value]}]SAMPLE[#FFFFFF]`; } else { return value; @@ -3008,42 +3007,42 @@ function getOrderPriceForItemType(itemType) { function clearPlayerItemActionState(client) { if (getPlayerData(client).itemActionItem != -1) { switch (getPlayerData(client).itemActionState) { - case AGRP_ITEM_ACTION_DROP: { + case V_ITEM_ACTION_DROP: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).dropAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } break; } - case AGRP_ITEM_ACTION_USE: { + case V_ITEM_ACTION_USE: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).useAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } break; } - case AGRP_ITEM_ACTION_PICKUP: { + case V_ITEM_ACTION_PICKUP: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).pickupAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } break; } - case AGRP_ITEM_ACTION_TAKE: { + case V_ITEM_ACTION_TAKE: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).takeAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } break; } - case AGRP_ITEM_ACTION_PUT: { + case V_ITEM_ACTION_PUT: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).putAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } break; } - case AGRP_ITEM_ACTION_SWITCH: { + case V_ITEM_ACTION_SWITCH: { if (getItemTypeData(getItemData(getPlayerData(client).itemActionItem).itemTypeIndex).switchAnimationIndex != -1 && !isPlayerInAnyVehicle(client)) { makePlayerStopAnimation(client); } @@ -3052,7 +3051,7 @@ function clearPlayerItemActionState(client) { } } - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_NONE; + getPlayerData(client).itemActionState = V_ITEM_ACTION_NONE; getPlayerData(client).itemActionItem = -1; } @@ -3182,7 +3181,7 @@ function showHouseInventoryToPlayer(client, houseId) { function switchPlayerActiveHotBarSlot(client, slotId) { getPlayerData(client).itemActionItem = slotId; - getPlayerData(client).itemActionState = AGRP_ITEM_ACTION_SWITCH; + getPlayerData(client).itemActionState = V_ITEM_ACTION_SWITCH; if (slotId != -1) { showPlayerItemSwitchDelay(client, slotId); } @@ -3208,14 +3207,14 @@ function isPlayerItemFromJobEquipment(client, hotBarSlot) { function getItemPosition(itemId) { switch (getItemData(itemId).ownerType) { - case AGRP_ITEM_OWNER_PLAYER: + case V_ITEM_OWNER_PLAYER: return getPlayerPosition(getPlayerFromCharacterId(getItemData(itemId).ownerId)); - case AGRP_ITEM_OWNER_VEHDASH: - case AGRP_ITEM_OWNER_VEHTRUNK: + case V_ITEM_OWNER_VEHDASH: + case V_ITEM_OWNER_VEHTRUNK: return getVehiclePosition(getVehicleFromDatabaseId(getItemData(itemId).ownerId)); - case AGRP_ITEM_OWNER_GROUND: + case V_ITEM_OWNER_GROUND: return getItemData(itemId).position; } } @@ -3251,7 +3250,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 == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { + if (getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useType == V_ITEM_USE_TYPE_AMMO_CLIP) { if (getItemTypeData(getItemData(getPlayerData(client).hotBarItems[i]).itemTypeIndex).useId == weaponId) { return i; } @@ -3266,7 +3265,7 @@ function getPlayerFirstAmmoItemForWeapon(client, weaponId) { // =========================================================================== function getItemPosition(itemId) { - if (getItemData(itemId).ownerType == AGRP_ITEM_OWNER_GROUND) { + if (getItemData(itemId).ownerType == V_ITEM_OWNER_GROUND) { if (getItemData(itemId).object != null) { return getElementPosition(getItemData(itemId).object); } @@ -3288,7 +3287,7 @@ function cacheAllItemItems() { function cacheItemItems(itemId) { let items = getServerData().items; for (let i in items) { - if (items[i].ownerType == AGRP_ITEM_OWNER_ITEM && items[i].ownerId == getItemData(itemId).databaseId) { + if (items[i].ownerType == V_ITEM_OWNER_ITEM && items[i].ownerId == getItemData(itemId).databaseId) { getItemData(itemId).itemCache.push(i); } } diff --git a/scripts/server/item/drink.js b/scripts/server/item/drink.js index 0dc61521..5ab3344e 100644 --- a/scripts/server/item/drink.js +++ b/scripts/server/item/drink.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: drink.js // DESC: Provides features and usage for the drink item type diff --git a/scripts/server/item/food.js b/scripts/server/item/food.js index f0c85a4d..73527dbe 100644 --- a/scripts/server/item/food.js +++ b/scripts/server/item/food.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: food.js // DESC: Provides features and usage for the food item type diff --git a/scripts/server/item/handcuff.js b/scripts/server/item/handcuff.js index e58695c3..68ad006a 100644 --- a/scripts/server/item/handcuff.js +++ b/scripts/server/item/handcuff.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: handcuff.js // DESC: Provides features and usage for the handcuff item type @@ -11,20 +10,20 @@ // =========================================================================== function isPlayerHandCuffed(client) { - return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED); + return (getPlayerData(client).pedState == V_PEDSTATE_BINDED); } // =========================================================================== function handCuffPlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED; + getPlayerData(client).pedState = V_PEDSTATE_BINDED; setPlayerControlState(client, false); } // =========================================================================== function unHandCuffPlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; setPlayerControlState(client, true); } diff --git a/scripts/server/item/phone.js b/scripts/server/item/phone.js index 9e3d510b..cf09d165 100644 --- a/scripts/server/item/phone.js +++ b/scripts/server/item/phone.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: phone.js // DESC: Provides features and usage for the phone item type @@ -10,7 +9,7 @@ function getItemWithPhoneNumber(phoneNumber) { for (let i in getServerData().items) { - if (getItemTypeData(getItemData(i).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_PHONE) { + if (getItemTypeData(getItemData(i).itemTypeIndex).useType == V_ITEM_USE_TYPE_PHONE) { if (getItemData(i).value == phoneNumber) { return i; } @@ -31,15 +30,15 @@ function ringPhoneForNearbyPlayers(itemIndex) { /* if(isPhoneItemEnabled(itemIndex)) { switch(getItemData(itemIndex).ownerType) { - case AGRP_ITEM_OWNER_GROUND: + case V_ITEM_OWNER_GROUND: playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra); break; - case AGRP_ITEM_OWNER_VEHTRUNK: + case V_ITEM_OWNER_VEHTRUNK: playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); break; - case AGRP_ITEM_OWNER_VEHDASH: + case V_ITEM_OWNER_VEHDASH: playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); break; } diff --git a/scripts/server/item/rope.js b/scripts/server/item/rope.js index 88c724e5..d22880ef 100644 --- a/scripts/server/item/rope.js +++ b/scripts/server/item/rope.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: handcuff.js // DESC: Provides features and usage for the handcuff item type @@ -11,20 +10,20 @@ // =========================================================================== function isPlayerTied(client) { - return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED); + return (getPlayerData(client).pedState == V_PEDSTATE_BINDED); } // =========================================================================== function ropeTiePlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED; + getPlayerData(client).pedState = V_PEDSTATE_BINDED; setPlayerControlState(client, false); } // =========================================================================== function ropeUnTiePlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; setPlayerControlState(client, true); } diff --git a/scripts/server/item/tazer.js b/scripts/server/item/tazer.js index e2be72ad..0f472362 100644 --- a/scripts/server/item/tazer.js +++ b/scripts/server/item/tazer.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: tazer.js // DESC: Provides features and usage for the tazer item type @@ -11,13 +10,13 @@ // =========================================================================== function isPlayerTazed(client) { - return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED); + return (getPlayerData(client).pedState == V_PEDSTATE_TAZED); } // =========================================================================== function tazePlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_TAZED; + getPlayerData(client).pedState = V_PEDSTATE_TAZED; setPlayerControlState(client, false); let animationId = getAnimationFromParams("tazed"); @@ -34,7 +33,7 @@ function tazePlayer(client) { // =========================================================================== function unTazePlayer(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; setPlayerControlState(client, true); setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo); diff --git a/scripts/server/item/walkie-talkie.js b/scripts/server/item/walkie-talkie.js index 551dac88..199ae3f2 100644 --- a/scripts/server/item/walkie-talkie.js +++ b/scripts/server/item/walkie-talkie.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: walkie-talkie.js // DESC: Provides features and usage for the walkie-talkie item type @@ -9,7 +8,7 @@ // =========================================================================== function getPlayerActiveWalkieTalkieFrequency(client) { - let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE); + let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE); if (walkieTalkieSlot != -1) { if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) { @@ -32,7 +31,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) { // if(isPlayerSpawned(clients[i])) { // if(!isSamePlayer(transmittingPlayer, clients[i])) { // if(getPlayerActiveWalkieTalkieFrequency(clients[i]) == radioFrequency) { - // if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], AGRP_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) { + // if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], V_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) { // walkieTalkieIncomingToNearbyPlayers(clients[i], messageText); // } // } @@ -43,7 +42,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) { let items = getServerData().items; for (let i in items) { if (items[i].enabled) { - if (getItemTypeData(items[i].itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { + if (getItemTypeData(items[i].itemTypeIndex).useType == V_ITEM_USE_TYPE_WALKIETALKIE) { if (items[i].value == radioFrequency) { walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i)); } @@ -126,7 +125,7 @@ function walkieTalkieChatCommand(command, params, client) { return false; } - let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE); + let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE); if (!getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot]).enabled) { messagePlayerError(client, "Please turn on a walkie talkie first!"); return false; diff --git a/scripts/server/job.js b/scripts/server/job.js index e7282d39..65c6537e 100644 --- a/scripts/server/job.js +++ b/scripts/server/job.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: job.js // DESC: Provides job functions and usage @@ -9,37 +8,37 @@ // =========================================================================== // Job Types -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; +const V_JOB_NONE = 0; +const V_JOB_POLICE = 1; +const V_JOB_MEDICAL = 2; +const V_JOB_FIRE = 3; +const V_JOB_BUS = 4; +const V_JOB_TAXI = 5; +const V_JOB_GARBAGE = 6; +const V_JOB_WEAPON = 7; +const V_JOB_DRUG = 8; +const V_JOB_PIZZA = 9; +const V_JOB_GENERIC = 10; // =========================================================================== // Job Route States -const AGRP_JOB_ROUTE_STATE_NONE = 0; // None -const AGRP_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one. -const AGRP_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route -const AGRP_JOB_ROUTE_STATE_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_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one +const V_JOB_ROUTE_STATE_NONE = 0; // None +const V_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one. +const V_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route +const V_JOB_ROUTE_STATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume +const V_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one // =========================================================================== // Job Route Location Types -const AGRP_JOB_ROUTE_LOC_TYPE_NONE = 0; // None -const AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes) -const AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job) -const AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job) -const AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job) -const AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job) -const AGRP_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such +const V_JOB_ROUTE_LOC_TYPE_NONE = 0; // None +const V_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes) +const V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job) +const V_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job) +const V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job) +const V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job) +const V_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such // =========================================================================== @@ -57,7 +56,7 @@ class JobData { constructor(dbAssoc = false) { this.databaseId = 0; this.serverId = 0; - this.type = AGRP_JOB_NONE; + this.type = V_JOB_NONE; this.name = "Unnamed"; this.enabled = true; this.blipModel = -1 @@ -176,7 +175,7 @@ class JobRouteLocationData { this.position = toVector3(0.0, 0.0, 0.0); this.stopDelay = 0; this.pay = 0; - this.type = AGRP_JOB_ROUTE_LOC_TYPE_NONE; + this.type = V_JOB_ROUTE_LOC_TYPE_NONE; this.gotoMessage = ""; this.departMessage = ""; this.whoCreated = 0; @@ -469,60 +468,60 @@ class JobRouteLocationType { // For use with the /jobrouteloctype command let jobRouteLocationTypes = { - [AGRP_GAME_GTA_III]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_GTA_III]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_GTA_VC]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_GTA_VC]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_GTA_SA]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_GTA_SA]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_GTA_IV]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_GTA_IV]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_MAFIA_ONE]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_MAFIA_ONE]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_MAFIA_TWO]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_MAFIA_TWO]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], - [AGRP_GAME_MAFIA_ONE_DE]: [ - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), - new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), + [V_GAME_MAFIA_ONE_DE]: [ + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), + new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), ], } @@ -811,11 +810,11 @@ 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", 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", 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); + setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.type", V_PICKUP_JOB, false); + setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.id", j, false); + setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.type", V_LABEL_JOB, true); + setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.name", getServerData().jobs[i].name, true); + setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.jobType", getServerData().jobs[i].databaseId, true); setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false); setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension); addToWorld(getServerData().jobs[i].locations[j].pickup); @@ -840,7 +839,7 @@ function showJobInformationToPlayer(client, jobType) { } switch (jobType) { - case AGRP_JOB_POLICE: + case V_JOB_POLICE: if (!canPlayerUsePoliceJob(client)) { return false; } @@ -853,7 +852,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_MEDICAL: + case V_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."); @@ -862,7 +861,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_FIRE: + case V_JOB_FIRE: if (!canClientUseFireJob(client)) { return false; } @@ -874,7 +873,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_BUS: + case V_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."); @@ -883,7 +882,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_TAXI: + case V_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."); @@ -893,7 +892,7 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_GARBAGE: + case V_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."); @@ -904,10 +903,10 @@ function showJobInformationToPlayer(client, jobType) { messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); break; - case AGRP_JOB_WEAPON: + case V_JOB_WEAPON: break; - case AGRP_JOB_DRUG: + case V_JOB_DRUG: break; default: @@ -949,7 +948,7 @@ function takeJobCommand(command, params, client) { return false; } - if (getPlayerCurrentSubAccount(client).job > AGRP_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job > V_JOB_NONE) { messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}")); return false; } @@ -981,7 +980,7 @@ function startWorkingCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -993,7 +992,7 @@ function startWorkingCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) { messagePlayerError(client, getLocaleString(client, "DontHaveAJob")); messagePlayerInfo(client, "You can get a job by going the yellow points on the map."); return false; @@ -1054,41 +1053,41 @@ function startWorking(client) { switchPlayerActiveHotBarSlot(client, -1); getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client); storePlayerItemsInTempLocker(client); - getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB; + getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_JOB; messagePlayerInfo(client, getLocaleString(client, "ItemsStoredForJob")); getPlayerCurrentSubAccount(client).isWorking = true; let jobId = getPlayerCurrentSubAccount(client).job; switch (getJobIndexFromDatabaseId(jobId)) { - case AGRP_JOB_POLICE: + case V_JOB_POLICE: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case AGRP_JOB_MEDICAL: + case V_JOB_MEDICAL: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case AGRP_JOB_FIRE: + case V_JOB_FIRE: messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); break; - case AGRP_JOB_BUS: + case V_JOB_BUS: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus"))); break; - case AGRP_JOB_TAXI: + case V_JOB_TAXI: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi"))); break; - case AGRP_JOB_GARBAGE: + case V_JOB_GARBAGE: messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck"))); break; - case AGRP_JOB_WEAPON: + case V_JOB_WEAPON: break; - case AGRP_JOB_DRUG: + case V_JOB_DRUG: break; default: @@ -1131,10 +1130,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 == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { + if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == V_ITEM_USE_TYPE_WALKIETALKIE) { value = getJobData(jobId).walkieTalkieFrequency; } - let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); + let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); getItemData(itemId).needsSaved = false; getItemData(itemId).databaseId = -1; // Make sure it doesnt save let freeSlot = getPlayerFirstEmptyHotBarSlot(client); @@ -1188,37 +1187,37 @@ function stopWorking(client) { /* switch (getJobType(jobId)) { - case AGRP_JOB_POLICE: + case V_JOB_POLICE: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station"); break; - case AGRP_JOB_MEDICAL: + case V_JOB_MEDICAL: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital"); break; - case AGRP_JOB_FIRE: + case V_JOB_FIRE: messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station"); break; - case AGRP_JOB_BUS: + case V_JOB_BUS: messagePlayerInfo(client, "Your vehicle has been returned to the bus depot"); break; - case AGRP_JOB_TAXI: + case V_JOB_TAXI: messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot"); break; - case AGRP_JOB_GARBAGE: + case V_JOB_GARBAGE: messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump"); break; - case AGRP_JOB_WEAPON: + case V_JOB_WEAPON: break; - case AGRP_JOB_DRUG: + case V_JOB_DRUG: break; - case AGRP_JOB_GENERIC: + case V_JOB_GENERIC: messagePlayerInfo(client, "Your vehicle has been respawned at your job location"); break; @@ -1259,7 +1258,7 @@ function jobUniformCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -1271,7 +1270,7 @@ function jobUniformCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) { messagePlayerError(client, getLocaleString(client, "NotYourJob")); messagePlayerInfo(client, getLocaleString(client, "JobPoints")); return false; @@ -1362,7 +1361,7 @@ function jobEquipmentCommand(command, params, client) { return false; } - if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { + if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) { messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); return false; } @@ -1374,7 +1373,7 @@ function jobEquipmentCommand(command, params, client) { jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); } else { - if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { + if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) { messagePlayerError(client, getLocaleString(client, "NotYourJob")); if (hasPlayerSeenActionTip(client, "JobLocations")) { @@ -2407,7 +2406,7 @@ function jobStopRouteCommand(command, params, client) { return false; } - //if(!doesPlayerHaveJobType(client, AGRP_JOB_BUS) && !doesPlayerHaveJobType(client, AGRP_JOB_GARBAGE)) { + //if(!doesPlayerHaveJobType(client, V_JOB_BUS) && !doesPlayerHaveJobType(client, V_JOB_GARBAGE)) { // messagePlayerError(client, "Your job doesn't use a route!"); // return false; //} @@ -3193,11 +3192,11 @@ function createJobLocationPickup(jobId, locationId) { tempJobData.locations[locationId].pickup = pickup; setElementDimension(pickup, tempJobData.locations[locationId].dimension); setElementOnAllDimensions(pickup, false); - setEntityData(pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false); - setEntityData(pickup, "agrp.owner.id", locationId, false); - 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); + setEntityData(pickup, "v.rp.owner.type", V_PICKUP_JOB, false); + setEntityData(pickup, "v.rp.owner.id", locationId, false); + setEntityData(pickup, "v.rp.label.type", V_LABEL_JOB, true); + setEntityData(pickup, "v.rp.label.name", tempJobData.name, true); + setEntityData(pickup, "v.rp.label.jobType", tempJobData.databaseId, true); addToWorld(pickup); } } else { @@ -3597,7 +3596,7 @@ function createJobRoute(routeName, closestJobLocation, whoCreated = defaultNoAcc // =========================================================================== -function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = AGRP_JOB_ROUTE_LOC_TYPE_NONE) { +function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = V_JOB_ROUTE_LOC_TYPE_NONE) { let tempJobRouteLocationData = new JobRouteLocationData(false); tempJobRouteLocationData.name = routeLocationName; tempJobRouteLocationData.routeId = jobRouteData.databaseId; diff --git a/scripts/server/job/bus.js b/scripts/server/job/bus.js index 2861bea3..453913c4 100644 --- a/scripts/server/job/bus.js +++ b/scripts/server/job/bus.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: bus.js // DESC: Provides bus driver job functions and usage diff --git a/scripts/server/job/drug.js b/scripts/server/job/drug.js index f314b648..51e1b76b 100644 --- a/scripts/server/job/drug.js +++ b/scripts/server/job/drug.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: drug.js // DESC: Provides drug runner/dealer job functions and usage diff --git a/scripts/server/job/fire.js b/scripts/server/job/fire.js index 2c82d6ef..7e9c39ca 100644 --- a/scripts/server/job/fire.js +++ b/scripts/server/job/fire.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: fire.js // DESC: Provides firefighter job functions and usage diff --git a/scripts/server/job/garbage.js b/scripts/server/job/garbage.js index 1b5fd3ea..a4c1e736 100644 --- a/scripts/server/job/garbage.js +++ b/scripts/server/job/garbage.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: garbage.js // DESC: Provides garbage collector job functions and usage diff --git a/scripts/server/job/medic.js b/scripts/server/job/medic.js index 22c79174..9e1c911f 100644 --- a/scripts/server/job/medic.js +++ b/scripts/server/job/medic.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: medic.js // DESC: Provides paramedic job functions and usage diff --git a/scripts/server/job/pizza-delivery.js b/scripts/server/job/pizza-delivery.js index 2c96f315..fbc7da73 100644 --- a/scripts/server/job/pizza-delivery.js +++ b/scripts/server/job/pizza-delivery.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: pizza-delivery.js // DESC: Provides pizza delivery driver job functions and usage diff --git a/scripts/server/job/police.js b/scripts/server/job/police.js index 2ace530a..5a437ab9 100644 --- a/scripts/server/job/police.js +++ b/scripts/server/job/police.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: police.js // DESC: Provides police officer job functions and usage @@ -24,7 +23,7 @@ function policeTazerCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } @@ -50,7 +49,7 @@ function policeCuffCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } @@ -76,7 +75,7 @@ function policeArrestCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } @@ -102,7 +101,7 @@ function policeSearchCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } @@ -128,7 +127,7 @@ function policeDragCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } @@ -154,7 +153,7 @@ function policeDetainCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { + if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) { messagePlayerError(client, "You don't have a police job."); return false; } diff --git a/scripts/server/job/taxi.js b/scripts/server/job/taxi.js index 0380091c..349fe098 100644 --- a/scripts/server/job/taxi.js +++ b/scripts/server/job/taxi.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: taxi.js // DESC: Provides taxi driver job functions and usage @@ -24,7 +23,7 @@ function taxiSetFareCommand(command, params, client) { return false; } - if (!doesPlayerHaveJobType(client, AGRP_JOB_TAXI)) { + if (!doesPlayerHaveJobType(client, V_JOB_TAXI)) { messagePlayerError(client, "You don't have a taxi job."); return false; } diff --git a/scripts/server/job/weapon.js b/scripts/server/job/weapon.js index ec0fd497..9b4f9614 100644 --- a/scripts/server/job/weapon.js +++ b/scripts/server/job/weapon.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: weapon.js // DESC: Provides weapons dealer job functions and usage diff --git a/scripts/server/keybind.js b/scripts/server/keybind.js index 6641fe4d..fe6e5aed 100644 --- a/scripts/server/keybind.js +++ b/scripts/server/keybind.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: keybind.js // DESC: Provides keybind handlers and functions @@ -10,7 +9,7 @@ // =========================================================================== class KeyBindData { - constructor(dbAssoc = false, key = 0, commandString = "", keyState = AGRP_KEYSTATE_UP) { + constructor(dbAssoc = false, key = 0, commandString = "", keyState = V_KEYSTATE_UP) { this.databaseId = 0; this.key = key; this.account = 0; @@ -89,7 +88,7 @@ function removeKeyBindCommand(command, params, client) { // =========================================================================== function resetKeyBindsCommand(command, params, client) { - getPlayerData(client).promptType = AGRP_PROMPT_RESETKEYBINDS; + getPlayerData(client).promptType = V_PROMPT_RESETKEYBINDS; showPlayerPrompt(client, getLocaleString(client, "ResetAllKeyBindsConfirm"), getLocaleString(client, "GUIWarningTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); //removePlayerKeyBind(client, keyId); //messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`); @@ -98,7 +97,7 @@ function resetKeyBindsCommand(command, params, client) { // =========================================================================== function copyKeyBindsToServerCommand(command, params, client) { - getPlayerData(client).promptType = AGRP_PROMPT_COPYKEYBINDSTOSERVER; + getPlayerData(client).promptType = V_PROMPT_COPYKEYBINDSTOSERVER; showPlayerPrompt(client, getLocaleString(client, "CopyAllKeyBindsToServerConfirm"), getLocaleString(client, "GUIWarningTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); //removePlayerKeyBind(client, keyId); //messagePlayerSuccess(client, `You removed the keybind for the {ALTCOLOUR}${toUpperCase(getKeyNameFromId(keyId))} {MAINCOLOUR}key`); @@ -113,7 +112,7 @@ function addPlayerKeyBind(client, keyId, command, params, tempKey = false) { } getPlayerData(client).keyBinds.push(keyBindData); - sendAddAccountKeyBindToClient(client, keyId, AGRP_KEYSTATE_UP); + sendAddAccountKeyBindToClient(client, keyId, V_KEYSTATE_UP); if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { let keyId = getPlayerKeyBindForCommand(client, "enter"); diff --git a/scripts/server/locale.js b/scripts/server/locale.js index 742b08aa..52bfbbaa 100644 --- a/scripts/server/locale.js +++ b/scripts/server/locale.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: locale.js // DESC: Provides locale structures, functions and usage diff --git a/scripts/server/misc.js b/scripts/server/misc.js index a631e848..5d0a8e66 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: misc.js // DESC: Provides any uncategorized functions and usage @@ -9,48 +8,48 @@ // =========================================================================== // Pickup Types -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; +const V_PICKUP_NONE = 0; +const V_PICKUP_JOB = 1; +const V_PICKUP_BUSINESS_ENTRANCE = 2; +const V_PICKUP_BUSINESS_EXIT = 3; +const V_PICKUP_HOUSE_ENTRANCE = 4; +const V_PICKUP_HOUSE_EXIT = 5; +const V_PICKUP_EXIT = 6; // =========================================================================== // Blip Owner Types -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; +const V_BLIP_NONE = 0; +const V_BLIP_JOB = 1; +const V_BLIP_BUSINESS_ENTRANCE = 2; +const V_BLIP_BUSINESS_EXIT = 3; +const V_BLIP_HOUSE_ENTRANCE = 4; +const V_BLIP_HOUSE_EXIT = 5; +const V_BLIP_EXIT = 6; // =========================================================================== // Ped States -const AGRP_PEDSTATE_NONE = 0; // 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 +const V_PEDSTATE_NONE = 0; // None +const V_PEDSTATE_READY = 1; // Ready +const V_PEDSTATE_DRIVER = 2; // Driving a vehicle +const V_PEDSTATE_PASSENGER = 3; // In a vehicle as passenger +const V_PEDSTATE_DEAD = 4; // Dead +const V_PEDSTATE_ENTERINGPROPERTY = 5; // Entering a property +const V_PEDSTATE_EXITINGPROPERTY = 6; // Exiting a property +const V_PEDSTATE_ENTERINGVEHICLE = 7; // Entering a vehicle +const V_PEDSTATE_EXITINGVEHICLE = 8; // Exiting a vehicle +const V_PEDSTATE_BINDED = 9; // Binded by rope or handcuffs +const V_PEDSTATE_TAZED = 10; // Under incapacitating effect of tazer +const V_PEDSTATE_INTRUNK = 11; // In vehicle trunk +const V_PEDSTATE_INITEM = 12; // In item (crate, box, etc) +const V_PEDSTATE_HANDSUP = 13; // Has hands up (surrendering) +const V_PEDSTATE_SPAWNING = 14; // Spawning // Property Types -const AGRP_PROPERTY_TYPE_NONE = 0; // None -const AGRP_PROPERTY_TYPE_BUSINESS = 1; // Business -const AGRP_PROPERTY_TYPE_HOUSE = 2; // House +const V_PROPERTY_TYPE_NONE = 0; // None +const V_PROPERTY_TYPE_BUSINESS = 1; // Business +const V_PROPERTY_TYPE_HOUSE = 2; // House // =========================================================================== @@ -116,7 +115,7 @@ function suicideCommand(command, params, client) { // =========================================================================== function toggleMouseCameraCommand(command, params, client) { - if (getGame() != AGRP_GAME_GTA_VC) { + if (getGame() != V_GAME_GTA_VC) { sendPlayerMouseCameraToggle(client); } return true; @@ -206,7 +205,7 @@ function enterExitPropertyCommand(command, params, client) { let isBusiness = false; // Make sure they aren't already trying to enter/exit a property - if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGPROPERTY || getPlayerData(client).pedState == AGRP_PEDSTATE_EXITINGPROPERTY) { + if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGPROPERTY || getPlayerData(client).pedState == V_PEDSTATE_EXITINGPROPERTY) { messagePlayerError(client, getLocaleString(client, "UnableToDoThat")); return false; } @@ -219,29 +218,29 @@ function enterExitPropertyCommand(command, params, client) { // Needs further testing and tweaks. if (getPlayerData(client).currentPickup != null) { if (getDistance(getPlayerData(client).currentPickup.position, getPlayerPosition(client)) <= 2) { - let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type"); - let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id"); + let ownerType = getEntityData(getPlayerData(client).currentPickup, "v.rp.owner.type"); + let ownerId = getEntityData(getPlayerData(client).currentPickup, "v.rp.owner.id"); switch (ownerType) { - case AGRP_PICKUP_BUSINESS_ENTRANCE: + case V_PICKUP_BUSINESS_ENTRANCE: isBusiness = true; isEntrance = true; closestProperty = getServerData().businesses[ownerId]; break; - case AGRP_PICKUP_BUSINESS_EXIT: + case V_PICKUP_BUSINESS_EXIT: isBusiness = true; isEntrance = false; closestProperty = getServerData().businesses[ownerId]; break; - case AGRP_PICKUP_HOUSE_ENTRANCE: + case V_PICKUP_HOUSE_ENTRANCE: isBusiness = false; isEntrance = true; closestProperty = getServerData().houses[ownerId]; break; - case AGRP_PICKUP_HOUSE_EXIT: + case V_PICKUP_HOUSE_EXIT: isBusiness = false; isEntrance = false; closestProperty = getServerData().houses[ownerId]; @@ -361,8 +360,8 @@ function enterExitPropertyCommand(command, params, client) { } clearPlayerStateToEnterExitProperty(client); - getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGPROPERTY; - getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index]; + getPlayerData(client).pedState = V_PEDSTATE_ENTERINGPROPERTY; + getPlayerData(client).enteringExitingProperty = [(isBusiness) ? V_PROPERTY_TYPE_BUSINESS : V_PROPERTY_TYPE_HOUSE, closestProperty.index]; meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "EntersProperty", typeString, nameString)); @@ -393,8 +392,8 @@ function enterExitPropertyCommand(command, params, client) { } clearPlayerStateToEnterExitProperty(client); - getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGPROPERTY; - getPlayerData(client).enteringExitingProperty = [(isBusiness) ? AGRP_PROPERTY_TYPE_BUSINESS : AGRP_PROPERTY_TYPE_HOUSE, closestProperty.index]; + getPlayerData(client).pedState = V_PEDSTATE_EXITINGPROPERTY; + getPlayerData(client).enteringExitingProperty = [(isBusiness) ? V_PROPERTY_TYPE_BUSINESS : V_PROPERTY_TYPE_HOUSE, closestProperty.index]; meActionToNearbyPlayers(client, getLanguageLocaleString(englishId, "ExitsProperty", typeString, nameString)); @@ -604,7 +603,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 == AGRP_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_SKINSELECT) { messagePlayerAlert(client, "You canceled the skin change."); restorePlayerCamera(client); @@ -618,11 +617,11 @@ function stuckPlayerCommand(command, params, client) { getPlayerData(client).returnToInterior = null; getPlayerData(client).returnToDimension = null; - getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_NONE; + getPlayerData(client).returnToType = V_RETURNTO_TYPE_NONE; } } - //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_ADMINGET) { + //if(getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_ADMINGET) { // messagePlayerError(client, `You were teleported by an admin and can't use the stuck command`); // return false; //} @@ -922,7 +921,7 @@ function deletePlayerBlip(client) { // =========================================================================== function processPlayerDeath(client) { - getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD; + getPlayerData(client).pedState = V_PEDSTATE_DEAD; updatePlayerSpawnedState(client, false); setPlayerControlState(client, false); setTimeout(function () { @@ -984,13 +983,13 @@ function processPlayerDeath(client) { // =========================================================================== function isPlayerSurrendered(client) { - return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED || getPlayerData(client).pedState == AGRP_PEDSTATE_HANDSUP); + return (getPlayerData(client).pedState == V_PEDSTATE_TAZED || getPlayerData(client).pedState == V_PEDSTATE_HANDSUP); } // =========================================================================== function isPlayerRestrained(client) { - return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED); + return (getPlayerData(client).pedState == V_PEDSTATE_BINDED); } // =========================================================================== @@ -998,13 +997,13 @@ function isPlayerRestrained(client) { function getPlayerInPropertyData(client) { let businessId = getPlayerBusiness(client); if (businessId != -1) { - getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_BUSINESS, businessId]; + getPlayerData(client).inProperty = [V_PROPERTY_TYPE_BUSINESS, businessId]; return false; } let houseId = getPlayerHouse(client); if (houseId != -1) { - getPlayerData(client).inProperty = [AGRP_PROPERTY_TYPE_HOUSE, houseId]; + getPlayerData(client).inProperty = [V_PROPERTY_TYPE_HOUSE, houseId]; return false; } diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 834eaef4..27b48b7b 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods @@ -193,8 +192,8 @@ function getVehicleHeading(vehicle) { // =========================================================================== function setVehicleHeading(vehicle, heading) { - //if (getGame() == AGRP_GAME_GTA_IV) { - // return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); + //if (getGame() == V_GAME_GTA_IV) { + // return sendNetworkEventToPlayer("v.rp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); //} return vehicle.heading = heading; } @@ -227,7 +226,7 @@ function getVehicleSyncer(vehicle) { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - //if (getGame() == AGRP_GAME_GTA_IV) { + //if (getGame() == V_GAME_GTA_IV) { // if (getVehicleData(vehicle).ivNetworkId != -1) { // return getVehicleData(vehicle).ivNetworkId; // } @@ -267,8 +266,8 @@ 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() == AGRP_GAME_GTA_IV) { - triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); + if (getGame() == V_GAME_GTA_IV) { + triggerNetworkEvent("v.rp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); } else { getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; } @@ -581,24 +580,24 @@ function repairVehicle(vehicle) { // =========================================================================== function setVehicleLights(vehicle, lights) { - setEntityData(vehicle, "agrp.lights", lights, true); - sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights); + setEntityData(vehicle, "v.rp.lights", lights, true); + sendNetworkEventToPlayer("v.rp.veh.lights", null, vehicle.id, lights); } // =========================================================================== function setVehicleEngine(vehicle, engine) { //vehicle.engine = engine; - setEntityData(vehicle, "agrp.engine", engine, true); - sendNetworkEventToPlayer("agrp.veh.engine", null, vehicle.id, engine); + setEntityData(vehicle, "v.rp.engine", engine, true); + sendNetworkEventToPlayer("v.rp.veh.engine", null, vehicle.id, engine); } // =========================================================================== function setVehicleLocked(vehicle, locked) { vehicle.locked = locked; - setEntityData(vehicle, "agrp.locked", locked, true); - sendNetworkEventToPlayer("agrp.veh.locked", null, vehicle.id, locked); + setEntityData(vehicle, "v.rp.locked", locked, true); + sendNetworkEventToPlayer("v.rp.veh.locked", null, vehicle.id, locked); } // =========================================================================== @@ -672,15 +671,15 @@ function createGamePed(modelIndex, position, heading, toClient = null) { // =========================================================================== function getIsland(position) { - if (getGame() == AGRP_GAME_GTA_III) { + if (getGame() == V_GAME_GTA_III) { if (position.x > 616) { - return AGRP_ISLAND_PORTLAND; + return V_ISLAND_PORTLAND; } else if (position.x < -283) { - return AGRP_ISLAND_SHORESIDEVALE; + return V_ISLAND_SHORESIDEVALE; } - return AGRP_ISLAND_STAUNTON; + return V_ISLAND_STAUNTON; } else { - return AGRP_ISLAND_NONE; + return V_ISLAND_NONE; } //return game.getIslandFromPosition(position); @@ -725,7 +724,7 @@ function setPlayerFightStyle(client, fightStyleId) { return false; } - setEntityData(getPlayerElement(client), "agrp.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]); + setEntityData(getPlayerElement(client), "v.rp.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]); forcePlayerToSyncElementProperties(null, getPlayerElement(client)); } @@ -744,7 +743,7 @@ function getPlayerElement(client) { // =========================================================================== function setElementPosition(element, position) { - sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position); + sendNetworkEventToPlayer("v.rp.elementPosition", null, element.id, position); } // =========================================================================== @@ -762,14 +761,14 @@ function getElementHeading(element) { // =========================================================================== function setElementInterior(element, interior) { - setEntityData(element, "agrp.interior", interior, true); + setEntityData(element, "v.rp.interior", interior, true); forcePlayerToSyncElementProperties(null, element); } // =========================================================================== function setElementCollisionsEnabled(element, state) { - sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state); + sendNetworkEventToPlayer("v.rp.elementCollisions", null, element.id, state); } // =========================================================================== @@ -1003,7 +1002,7 @@ function setConstantsAsGlobalVariablesInDatabase() { let entries = Object.entries(global); for (let i in entries) { logToConsole(LOG_DEBUG, `[AGRP.Database] Checking entry ${i} (${entries[i]})`); - if (toString(i).slice(0, 3).indexOf("AGRP_") != -1) { + if (toString(i).slice(0, 3).indexOf("V_") != -1) { logToConsole(LOG_DEBUG, `[AGRP.Database] Adding ${i} (${entries[i]}) to database global variables`); } } @@ -1126,7 +1125,7 @@ function getClosestCivilian(position) { // =========================================================================== function getVehiclesInRange(position, range) { - //if (getGame() == AGRP_GAME_GTA_IV) { + //if (getGame() == V_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); @@ -1159,7 +1158,7 @@ function getVehicleFirstEmptySeat(vehicle) { // =========================================================================== function isVehicleTrain(vehicle) { - if (getGame() == AGRP_GAME_GTA_III) { + if (getGame() == V_GAME_GTA_III) { if (vehicle.modelIndex == 124) { return true; } @@ -1190,13 +1189,13 @@ function setVehicleHealth(vehicle, health) { function givePlayerWeapon(client, weaponId, ammo, active = true) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); - sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active); + sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active); } // =========================================================================== function setPlayerWantedLevel(client, wantedLevel) { - sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel); + sendNetworkEventToPlayer("v.rp.wantedLevel", client, wantedLevel); return true; } @@ -1255,7 +1254,7 @@ function getPlayerPed(client) { return null; } - //if (getGame() == AGRP_GAME_GTA_IV) { + //if (getGame() == V_GAME_GTA_IV) { // return getPlayerData(client).ped; //} else { return client.player; @@ -1363,7 +1362,7 @@ function serverBanIP(ip) { // =========================================================================== function setVehicleTrunkState(vehicle, trunkState) { - sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); + sendNetworkEventToPlayer("v.rp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); } // =========================================================================== @@ -1490,7 +1489,7 @@ function deletePlayerPed(client) { if (areServerElementsSupported()) { destroyElement(client.player); } else { - sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client); + sendNetworkEventToPlayer("v.rp.deleteLocalPlayerPed", client); } } diff --git a/scripts/server/native/ragemp.js b/scripts/server/native/ragemp.js index dbbb3423..076f29be 100644 --- a/scripts/server/native/ragemp.js +++ b/scripts/server/native/ragemp.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: connected.js // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods @@ -164,8 +163,8 @@ function getVehicleHeading(vehicle) { // =========================================================================== function setVehicleHeading(vehicle, heading) { - if (getGame() == AGRP_GAME_GTA_IV) { - return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); + if (getGame() == V_GAME_GTA_IV) { + return sendNetworkEventToPlayer("v.rp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); } return vehicle.heading = heading; } @@ -198,7 +197,7 @@ function getVehicleSyncer(vehicle) { // =========================================================================== function getVehicleForNetworkEvent(vehicle) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_GAME_GTA_IV) { if (getVehicleData(vehicle).ivNetworkId != -1) { return getVehicleData(vehicle).ivNetworkId; } @@ -238,8 +237,8 @@ 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() == AGRP_GAME_GTA_IV) { - triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); + if (getGame() == V_GAME_GTA_IV) { + triggerNetworkEvent("v.rp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); } else { getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; } @@ -531,15 +530,15 @@ function repairVehicle(vehicle) { // =========================================================================== function setVehicleLights(vehicle, lights) { - setEntityData(vehicle, "agrp.lights", lights, true); - sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights); + setEntityData(vehicle, "v.rp.lights", lights, true); + sendNetworkEventToPlayer("v.rp.veh.lights", null, vehicle.id, lights); } // =========================================================================== function setVehicleEngine(vehicle, engine) { vehicle.engine = engine; - setEntityData(vehicle, "agrp.engine", engine, true); + setEntityData(vehicle, "v.rp.engine", engine, true); } // =========================================================================== @@ -674,7 +673,7 @@ function getPlayerElement(client) { // =========================================================================== function setElementPosition(element, position) { - sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position); + sendNetworkEventToPlayer("v.rp.elementPosition", null, element.id, position); } // =========================================================================== @@ -698,7 +697,7 @@ function setElementInterior(element, interior) { // =========================================================================== function setElementCollisionsEnabled(element, state) { - //sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state); + //sendNetworkEventToPlayer("v.rp.elementCollisions", null, element.id, state); } // =========================================================================== @@ -941,7 +940,7 @@ function getClosestCivilian(position) { // =========================================================================== function getVehiclesInRange(position, range) { - if (getGame() == AGRP_GAME_GTA_IV) { + if (getGame() == V_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); @@ -1000,14 +999,14 @@ function setVehicleHealth(vehicle, health) { function givePlayerWeapon(client, weaponId, ammo, active = true) { //logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); - //sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active); + //sendNetworkEventToPlayer("v.rp.giveWeapon", client, weaponId, ammo, active); client.giveWeapon(weaponId, ammo); } // =========================================================================== function setPlayerWantedLevel(client, wantedLevel) { - //sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel); + //sendNetworkEventToPlayer("v.rp.wantedLevel", client, wantedLevel); return true; } @@ -1110,7 +1109,7 @@ function despawnPlayer(client) { // =========================================================================== function getGame() { - return AGRP_GAME_GTA_V; + return V_GAME_GTA_V; } // =========================================================================== @@ -1155,7 +1154,7 @@ function serverBanIP(ip) { // =========================================================================== function setVehicleTrunkState(vehicle, trunkState) { - //sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); + //sendNetworkEventToPlayer("v.rp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); } // =========================================================================== @@ -1247,7 +1246,7 @@ function deletePlayerPed(client) { //if (areServerElementsSupported()) { // destroyElement(client.player); //} else { - // sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client); + // sendNetworkEventToPlayer("v.rp.deleteLocalPlayerPed", client); //} } diff --git a/scripts/server/netevents.js b/scripts/server/netevents.js index a8f31c04..1f39770b 100644 --- a/scripts/server/netevents.js +++ b/scripts/server/netevents.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: netevents.js // DESC: Provides client communication and cross-endpoint network events @@ -19,62 +18,62 @@ function addAllNetworkEventHandlers() { logToConsole(LOG_DEBUG, "[AGRP.Client]: Adding network handlers ..."); // KeyBind - addNetworkEventHandler("agrp.useKeyBind", playerUsedKeyBind); + addNetworkEventHandler("v.rp.useKeyBind", playerUsedKeyBind); // GUI - addNetworkEventHandler("agrp.promptAnswerNo", playerPromptAnswerNo); - addNetworkEventHandler("agrp.promptAnswerYes", playerPromptAnswerYes); - addNetworkEventHandler("agrp.toggleGUI", playerToggledGUI); - addNetworkEventHandler("agrp.2fa", checkPlayerTwoFactorAuthentication); + addNetworkEventHandler("v.rp.promptAnswerNo", playerPromptAnswerNo); + addNetworkEventHandler("v.rp.promptAnswerYes", playerPromptAnswerYes); + addNetworkEventHandler("v.rp.toggleGUI", playerToggledGUI); + addNetworkEventHandler("v.rp.2fa", checkPlayerTwoFactorAuthentication); // AFK - addNetworkEventHandler("agrp.afk", playerChangeAFKState); + addNetworkEventHandler("v.rp.afk", playerChangeAFKState); // Event - addNetworkEventHandler("agrp.pickup", onPlayerNearPickup); - addNetworkEventHandler("agrp.playerDeath", onPlayerDeath); + addNetworkEventHandler("v.rp.pickup", onPlayerNearPickup); + addNetworkEventHandler("v.rp.playerDeath", onPlayerDeath); // Job - addNetworkEventHandler("agrp.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation); + addNetworkEventHandler("v.rp.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation); // Client - addNetworkEventHandler("agrp.clientReady", playerClientReady); - addNetworkEventHandler("agrp.guiReady", playerGUIReady); - addNetworkEventHandler("agrp.clientStarted", playerClientStarted); - addNetworkEventHandler("agrp.clientStopped", playerClientStopped); + addNetworkEventHandler("v.rp.clientReady", playerClientReady); + addNetworkEventHandler("v.rp.guiReady", playerGUIReady); + addNetworkEventHandler("v.rp.clientStarted", playerClientStarted); + addNetworkEventHandler("v.rp.clientStopped", playerClientStopped); // Account - addNetworkEventHandler("agrp.checkLogin", checkLogin); - addNetworkEventHandler("agrp.checkRegistration", checkRegistration); - addNetworkEventHandler("agrp.checkResetPassword", checkAccountResetPasswordRequest); - addNetworkEventHandler("agrp.checkChangePassword", checkAccountChangePassword); + addNetworkEventHandler("v.rp.checkLogin", checkLogin); + addNetworkEventHandler("v.rp.checkRegistration", checkRegistration); + addNetworkEventHandler("v.rp.checkResetPassword", checkAccountResetPasswordRequest); + addNetworkEventHandler("v.rp.checkChangePassword", checkAccountChangePassword); // Developer - addNetworkEventHandler("agrp.runCodeSuccess", clientRunCodeSuccess); - addNetworkEventHandler("agrp.runCodeFail", clientRunCodeFail); + addNetworkEventHandler("v.rp.runCodeSuccess", clientRunCodeSuccess); + addNetworkEventHandler("v.rp.runCodeFail", clientRunCodeFail); // SubAccount - addNetworkEventHandler("agrp.checkNewCharacter", checkNewCharacter); - addNetworkEventHandler("agrp.nextCharacter", checkNextCharacter); - addNetworkEventHandler("agrp.previousCharacter", checkPreviousCharacter); - addNetworkEventHandler("agrp.selectCharacter", selectCharacter); + addNetworkEventHandler("v.rp.checkNewCharacter", checkNewCharacter); + addNetworkEventHandler("v.rp.nextCharacter", checkNextCharacter); + addNetworkEventHandler("v.rp.previousCharacter", checkPreviousCharacter); + addNetworkEventHandler("v.rp.selectCharacter", selectCharacter); // Item - addNetworkEventHandler("agrp.itemActionDelayComplete", playerItemActionDelayComplete); - addNetworkEventHandler("agrp.weaponDamage", playerDamagedByPlayer); + addNetworkEventHandler("v.rp.itemActionDelayComplete", playerItemActionDelayComplete); + addNetworkEventHandler("v.rp.weaponDamage", playerDamagedByPlayer); // Locale - addNetworkEventHandler("agrp.localeSelect", playerSelectedNewLocale); + addNetworkEventHandler("v.rp.localeSelect", playerSelectedNewLocale); // Misc - addNetworkEventHandler("agrp.plr.pos", updatePositionInPlayerData); - addNetworkEventHandler("agrp.plr.rot", updateHeadingInPlayerData); - addNetworkEventHandler("agrp.skinSelected", playerFinishedSkinSelection); - addNetworkEventHandler("agrp.clientInfo", updateConnectionLogOnClientInfoReceive); - addNetworkEventHandler("agrp.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); - addNetworkEventHandler("agrp.playerPedId", receivePlayerPedNetworkId); - addNetworkEventHandler("agrp.playerCop", setPlayerAsCopState); - addNetworkEventHandler("agrp.mapLoaded", playerMapLoaded); + addNetworkEventHandler("v.rp.plr.pos", updatePositionInPlayerData); + addNetworkEventHandler("v.rp.plr.rot", updateHeadingInPlayerData); + addNetworkEventHandler("v.rp.skinSelected", playerFinishedSkinSelection); + addNetworkEventHandler("v.rp.clientInfo", updateConnectionLogOnClientInfoReceive); + addNetworkEventHandler("v.rp.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); + addNetworkEventHandler("v.rp.playerPedId", receivePlayerPedNetworkId); + addNetworkEventHandler("v.rp.playerCop", setPlayerAsCopState); + addNetworkEventHandler("v.rp.mapLoaded", playerMapLoaded); } // =========================================================================== @@ -89,7 +88,7 @@ function updatePlayerNameTag(client) { } logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`); - sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client)); + sendNetworkEventToPlayer("v.rp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client)); } // =========================================================================== @@ -106,7 +105,7 @@ function updateAllPlayerNameTags() { function updatePlayerPing(client) { //logToConsole(LOG_DEBUG, `[AGRP.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`); - sendNetworkEventToPlayer("agrp.ping", null, getPlayerName(client), getPlayerPing(client)); + sendNetworkEventToPlayer("v.rp.ping", null, getPlayerName(client), getPlayerPing(client)); } // =========================================================================== @@ -149,12 +148,12 @@ function playerClientStopped(client) { function showSmallGameMessage(client, text, colour, duration, fontName = "Roboto") { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`); - if (getGame() <= AGRP_GAME_GTA_IV_EFLC) { + if (getGame() <= V_GAME_GTA_IV_EFLC) { fontName = "Pricedown"; } else { fontName = "AuroraBdCnBT"; } - sendNetworkEventToPlayer("agrp.smallGameMessage", client, text, colour, duration, fontName); + sendNetworkEventToPlayer("v.rp.smallGameMessage", client, text, colour, duration, fontName); } // =========================================================================== @@ -165,7 +164,7 @@ function enableCityAmbienceForPlayer(client, clearElements = false) { //} //logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); - //sendNetworkEventToPlayer("agrp.ambience", client, true); + //sendNetworkEventToPlayer("v.rp.ambience", client, true); } // =========================================================================== @@ -176,14 +175,14 @@ function disableCityAmbienceForPlayer(client, clearElements = false) { //} //logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); - //sendNetworkEventToPlayer("agrp.ambience", client, false, clearElements); + //sendNetworkEventToPlayer("v.rp.ambience", client, false, clearElements); } // =========================================================================== function clearPlayerOwnedPeds(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.clearPeds", client); + sendNetworkEventToPlayer("v.rp.clearPeds", client); } // =========================================================================== @@ -191,41 +190,41 @@ function clearPlayerOwnedPeds(client) { function updatePlayerSpawnedState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`); getPlayerData(client).spawned = true; - sendNetworkEventToPlayer("agrp.spawned", client, state); + sendNetworkEventToPlayer("v.rp.spawned", client, state); } // =========================================================================== function setPlayerControlState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`); - sendNetworkEventToPlayer("agrp.control", client, state, !state); + sendNetworkEventToPlayer("v.rp.control", client, state, !state); } // =========================================================================== function updatePlayerShowLogoState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`); - sendNetworkEventToPlayer("agrp.logo", client, state); + sendNetworkEventToPlayer("v.rp.logo", client, state); } // =========================================================================== function restorePlayerCamera(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`); - sendNetworkEventToPlayer("agrp.restoreCamera", client); + sendNetworkEventToPlayer("v.rp.restoreCamera", client); } // =========================================================================== function setPlayer2DRendering(client, hudState = false, labelState = false, smallGameMessageState = false, scoreboardState = false, hotBarState = false, itemActionDelayState = false) { - sendNetworkEventToPlayer("agrp.set2DRendering", client, hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState); + sendNetworkEventToPlayer("v.rp.set2DRendering", client, hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState); } // =========================================================================== function syncPlayerProperties(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`); - sendNetworkEventToPlayer("agrp.syncElement", null, getPlayerPed(client).id); + sendNetworkEventToPlayer("v.rp.syncElement", null, getPlayerPed(client).id); } // =========================================================================== @@ -233,7 +232,7 @@ function syncPlayerProperties(client) { function updatePlayerSnowState(client, forceGroundSnow = false) { if (isSnowSupported(getGame())) { logToConsole(LOG_DEBUG, `[AGRP.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`); - sendNetworkEventToPlayer("agrp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow, forceGroundSnow); + sendNetworkEventToPlayer("v.rp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow, forceGroundSnow); } } @@ -257,21 +256,21 @@ function updatePlayerHotBar(client) { } tempHotBarItems.push([i, itemExists, itemImage, itemValue]); } - sendNetworkEventToPlayer("agrp.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems); + sendNetworkEventToPlayer("v.rp.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems); } // =========================================================================== function setPlayerWeaponDamageEnabled(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`); - sendNetworkEventToPlayer("agrp.weaponDamageEnabled", null, getPlayerName(client), state); + sendNetworkEventToPlayer("v.rp.weaponDamageEnabled", null, getPlayerName(client), state); } // =========================================================================== function setPlayerWeaponDamageEvent(client, eventType) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`); - sendNetworkEventToPlayer("agrp.weaponDamageEvent", null, getPlayerName(client), eventType); + sendNetworkEventToPlayer("v.rp.weaponDamageEvent", null, getPlayerName(client), eventType); getPlayerData(client).weaponDamageEvent = eventType; } @@ -279,259 +278,259 @@ function setPlayerWeaponDamageEvent(client, eventType) { function sendJobRouteLocationToPlayer(client, position, colour) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job route location data to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showJobRouteLocation", client, position, colour); + sendNetworkEventToPlayer("v.rp.showJobRouteLocation", client, position, colour); } // =========================================================================== function showPlayerLoginSuccessGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.loginSuccess", client); + sendNetworkEventToPlayer("v.rp.loginSuccess", client); } // =========================================================================== function showPlayerLoginFailedGUI(client, errorMessage) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.loginFailed", client, errorMessage); + sendNetworkEventToPlayer("v.rp.loginFailed", client, errorMessage); } // =========================================================================== function showPlayerRegistrationSuccessGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.registrationSuccess", client); + sendNetworkEventToPlayer("v.rp.registrationSuccess", client); } // =========================================================================== function showPlayerRegistrationFailedGUI(client, errorMessage) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.registrationFailed", client, errorMessage); + sendNetworkEventToPlayer("v.rp.registrationFailed", client, errorMessage); } // =========================================================================== function sendPlayerGUIColours(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]); + sendNetworkEventToPlayer("v.rp.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]); } // =========================================================================== function sendPlayerGUIInit(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.guiInit", client); + sendNetworkEventToPlayer("v.rp.guiInit", client); } // =========================================================================== function showPlayerLoginGUI(client, errorMessage = "") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showLogin", client); + sendNetworkEventToPlayer("v.rp.showLogin", client); } // =========================================================================== function showPlayerRegistrationGUI(client, errorMessage = "") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showRegistration", client); + sendNetworkEventToPlayer("v.rp.showRegistration", client); } // =========================================================================== function showPlayerNewCharacterGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showNewCharacter", client); + sendNetworkEventToPlayer("v.rp.showNewCharacter", client); } // =========================================================================== function showPlayerChangePasswordGUI(client, errorMessage = "") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showChangePassword", client, errorMessage); + sendNetworkEventToPlayer("v.rp.showChangePassword", client, errorMessage); } // =========================================================================== function showPlayerResetPasswordCodeInputGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showResetPasswordCodeInput", client); + sendNetworkEventToPlayer("v.rp.showResetPasswordCodeInput", client); } // =========================================================================== function showPlayerResetPasswordEmailInputGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showResetPasswordEmailInput", client); + sendNetworkEventToPlayer("v.rp.showResetPasswordEmailInput", client); } // =========================================================================== function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); + sendNetworkEventToPlayer("v.rp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); } // =========================================================================== function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); + sendNetworkEventToPlayer("v.rp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); } // =========================================================================== function showPlayerCharacterSelectSuccessGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.characterSelectSuccess", client); + sendNetworkEventToPlayer("v.rp.characterSelectSuccess", client); } // =========================================================================== function showPlayerCharacterSelectFailedGUI(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.characterSelectFailed", client); + sendNetworkEventToPlayer("v.rp.characterSelectFailed", client); } // =========================================================================== function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`); - sendNetworkEventToPlayer("agrp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText); + sendNetworkEventToPlayer("v.rp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText); } // =========================================================================== function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`); - sendNetworkEventToPlayer("agrp.showInfo", client, infoMessage, infoTitle, buttonText); + sendNetworkEventToPlayer("v.rp.showInfo", client, infoMessage, infoTitle, buttonText); } // =========================================================================== function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`); - sendNetworkEventToPlayer("agrp.showError", client, errorMessage, errorTitle, buttonText); + sendNetworkEventToPlayer("v.rp.showError", client, errorMessage, errorTitle, buttonText); } // =========================================================================== function sendRunCodeToClient(client, code, returnTo) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`); - sendNetworkEventToPlayer("agrp.runCode", client, code, getPlayerId(returnTo)); + sendNetworkEventToPlayer("v.rp.runCode", client, code, getPlayerId(returnTo)); } // =========================================================================== function sendPlayerWorkingState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.working", client, state); + sendNetworkEventToPlayer("v.rp.working", client, state); } // =========================================================================== function sendPlayerJobType(client, jobType) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.jobType", client, jobType); + sendNetworkEventToPlayer("v.rp.jobType", client, jobType); } // =========================================================================== function sendPlayerStopJobRoute(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.hideJobRouteLocation", client); + sendNetworkEventToPlayer("v.rp.hideJobRouteLocation", client); } // =========================================================================== function sendPlayerMouseCameraToggle(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.mouseCamera", client); + sendNetworkEventToPlayer("v.rp.mouseCamera", client); } // =========================================================================== function setPlayerMouseCameraState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.mouseCameraForce", client, state); + sendNetworkEventToPlayer("v.rp.mouseCameraForce", client, state); } // =========================================================================== function sendPlayerMouseCursorToggle(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.mouseCursor", client); + sendNetworkEventToPlayer("v.rp.mouseCursor", client); } // =========================================================================== function sendAddAccountKeyBindToClient(client, key, keyState) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); - sendNetworkEventToPlayer("agrp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); + sendNetworkEventToPlayer("v.rp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); } // =========================================================================== function sendClearKeyBindsToClient(client, key, keyState) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); - sendNetworkEventToPlayer("agrp.clearKeyBinds", client); + sendNetworkEventToPlayer("v.rp.clearKeyBinds", client); } // =========================================================================== function sendRemoveAccountKeyBindToClient(client, key) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`); - sendNetworkEventToPlayer("agrp.delKeyBind", client, toInteger(key)); + sendNetworkEventToPlayer("v.rp.delKeyBind", client, toInteger(key)); } // =========================================================================== function sendPlayerSetPosition(client, position) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`); - sendNetworkEventToPlayer("agrp.position", client, position); + sendNetworkEventToPlayer("v.rp.position", client, position); } // =========================================================================== function sendPlayerSetHeading(client, heading) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`); - sendNetworkEventToPlayer("agrp.heading", client, heading); + sendNetworkEventToPlayer("v.rp.heading", client, heading); } // =========================================================================== function sendPlayerSetInterior(client, interior) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`); - sendNetworkEventToPlayer("agrp.interior", client, interior); + sendNetworkEventToPlayer("v.rp.interior", client, interior); } // =========================================================================== function sendPlayerFrozenState(client, state) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`); - sendNetworkEventToPlayer("agrp.frozen", client, state); + sendNetworkEventToPlayer("v.rp.frozen", client, state); } // =========================================================================== function clearPlayerWeapons(client, clearData = true) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`); - sendNetworkEventToPlayer("agrp.clearWeapons", client, clearData); + sendNetworkEventToPlayer("v.rp.clearWeapons", client, clearData); } // =========================================================================== function showPlayerNewCharacterFailedGUI(client, errorMessage) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.newCharacterFailed", client, errorMessage); + sendNetworkEventToPlayer("v.rp.newCharacterFailed", client, errorMessage); } // =========================================================================== function sendPlayerRemoveFromVehicle(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.removeFromVehicle", client); + sendNetworkEventToPlayer("v.rp.removeFromVehicle", client); } // =========================================================================== @@ -549,7 +548,7 @@ function showPlayerItemTakeDelay(client, itemId) { let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -564,7 +563,7 @@ function showPlayerItemUseDelay(client, itemSlot) { let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -579,7 +578,7 @@ function showPlayerItemDropDelay(client, itemSlot) { let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -594,7 +593,7 @@ function showPlayerItemPickupDelay(client, itemId) { let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -609,7 +608,7 @@ function showPlayerItemPutDelay(client, itemSlot) { let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -625,7 +624,7 @@ function showPlayerItemSwitchDelay(client, itemSlot) { let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay; if (delay > 0) { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); - sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay); + sendNetworkEventToPlayer("v.rp.showItemActionDelay", client, delay); } else { logToConsole(LOG_DEBUG, `[AGRP.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); playerItemActionDelayComplete(client); @@ -644,14 +643,14 @@ function showPlayerItemSwitchDelay(client, itemSlot) { function sendPlayerDrunkEffect(client, amount, duration) { logToConsole(LOG_DEBUG, `[AGRP.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`); - sendNetworkEventToPlayer("agrp.drunkEffect", client, amount, duration); + sendNetworkEventToPlayer("v.rp.drunkEffect", client, amount, duration); } // =========================================================================== function sendPlayerClearPedState(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`); - sendNetworkEventToPlayer("agrp.clearPedState", client); + sendNetworkEventToPlayer("v.rp.clearPedState", client); } // =========================================================================== @@ -679,7 +678,7 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager is ${getPlayerDisplayForConsole(damagerEntity)}`); switch (getPlayerData(damagerEntity).weaponDamageEvent) { - case AGRP_WEAPON_DAMAGE_EVENT_TAZER: + case V_WEAPON_DAMAGE_EVENT_TAZER: logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} is using a tazer`); if (!isPlayerTazed(client) && !isPlayerHandCuffed(client) && !isPlayerInAnyVehicle(client)) { logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)} was not previously tazed, binded, or in a vehicle. Taze successful`); @@ -688,13 +687,13 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he } break; - case AGRP_WEAPON_DAMAGE_EVENT_EXTINGUISH: + case V_WEAPON_DAMAGE_EVENT_EXTINGUISH: break; - case AGRP_WEAPON_DAMAGE_EVENT_MACE: + case V_WEAPON_DAMAGE_EVENT_MACE: break; - case AGRP_WEAPON_DAMAGE_EVENT_NORMAL: + case V_WEAPON_DAMAGE_EVENT_NORMAL: logToConsole(LOG_DEBUG, `[AGRP.Client] ${getPlayerDisplayForConsole(client)}'s damager ${getPlayerDisplayForConsole(damagerEntity)} caused ${healthLoss} damage (damage reduction makes it ${(healthLoss * getPlayerData(client).incomingDamageMultiplier)})`); let remainingDamage = healthLoss * getPlayerData(client).incomingDamageMultiplier; if (getPlayerArmour(client) > 0) { @@ -719,13 +718,13 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he // =========================================================================== function setPlayerCameraLookAt(client, cameraPosition, lookAtPosition) { - sendNetworkEventToPlayer("agrp.cameraLookAt", client, cameraPosition, lookAtPosition); + sendNetworkEventToPlayer("v.rp.cameraLookAt", client, cameraPosition, lookAtPosition); } // =========================================================================== function sendTimeMinuteDurationToPlayer(client, minuteDuration) { - sendNetworkEventToPlayer("agrp.minuteDuration", client, minuteDuration); + sendNetworkEventToPlayer("v.rp.minuteDuration", client, minuteDuration); } // =========================================================================== @@ -760,7 +759,7 @@ function forcePlayerIntoSkinSelect(client) { getPlayerData(client).returnToHeading = getPlayerHeading(client); getPlayerData(client).returnToInterior = getPlayerInterior(client); getPlayerData(client).returnToDimension = getPlayerDimension(client); - getPlayerData(client).returnToType = AGRP_RETURNTO_TYPE_SKINSELECT; + getPlayerData(client).returnToType = V_RETURNTO_TYPE_SKINSELECT; setPlayerPosition(client, getGameConfig().skinChangePosition[getGame()][0]); setPlayerHeading(client, getGameConfig().skinChangePosition[getGame()][1]); @@ -768,13 +767,13 @@ function forcePlayerIntoSkinSelect(client) { setPlayerDimension(client, getPlayerId(client) + 500); } - sendNetworkEventToPlayer("agrp.skinSelect", client, true); + sendNetworkEventToPlayer("v.rp.skinSelect", client, true); } // =========================================================================== function updatePlayerCash(client) { - sendNetworkEventToPlayer("agrp.money", client, getPlayerCurrentSubAccount(client).cash); + sendNetworkEventToPlayer("v.rp.money", client, getPlayerCurrentSubAccount(client).cash); } // =========================================================================== @@ -792,7 +791,7 @@ function sendAllPoliceStationBlips(client) { getColourByName("policeBlue"), ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } @@ -811,7 +810,7 @@ function sendAllFireStationBlips(client) { getColourByName("firefighterRed"), ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } @@ -830,7 +829,7 @@ function sendAllHospitalBlips(client) { getColourByName("medicPink"), ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } @@ -849,7 +848,7 @@ function sendAllAmmunationBlips(client) { 0 ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } @@ -868,7 +867,7 @@ function sendAllPayAndSprayBlips(client) { 0 ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } @@ -887,31 +886,31 @@ function sendAllFuelStationBlips(client) { getColourByName("burntOrange"), ]); } - sendNetworkEventToPlayer("agrp.blips", client, tempBlips); + sendNetworkEventToPlayer("v.rp.blips", client, tempBlips); } } // =========================================================================== function sendPlayerSetHealth(client, health) { - sendNetworkEventToPlayer("agrp.health", client, toInteger(health)); + sendNetworkEventToPlayer("v.rp.health", client, toInteger(health)); } // =========================================================================== function sendPlayerSetArmour(client, armour) { - sendNetworkEventToPlayer("agrp.armour", client, armour); + sendNetworkEventToPlayer("v.rp.armour", client, armour); } // =========================================================================== function playerFinishedSkinSelection(client, allowedSkinIndex) { - sendNetworkEventToPlayer("agrp.skinSelect", client, false); + sendNetworkEventToPlayer("v.rp.skinSelect", client, false); if (allowedSkinIndex == -1) { messagePlayerAlert(client, "You canceled the skin change."); restorePlayerCamera(client); - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_SKINSELECT) { setPlayerPosition(client, getPlayerData(client).returnToPosition); setPlayerHeading(client, getPlayerData(client).returnToHeading); setPlayerInterior(client, getPlayerData(client).returnToInterior); @@ -932,7 +931,7 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) { setPlayerSkin(client, getPlayerCurrentSubAccount(client).skin); } - if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == AGRP_RETURNTO_TYPE_SKINSELECT) { + if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType == V_RETURNTO_TYPE_SKINSELECT) { setPlayerPosition(client, getPlayerData(client).returnToPosition); setPlayerHeading(client, getPlayerData(client).returnToHeading); setPlayerInterior(client, getPlayerData(client).returnToInterior); @@ -958,34 +957,34 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) { // =========================================================================== function sendPlayerChatScrollLines(client, amount) { - sendNetworkEventToPlayer("agrp.chatScrollLines", client, amount); + sendNetworkEventToPlayer("v.rp.chatScrollLines", client, amount); } // =========================================================================== function sendPlayerChatAutoHideDelay(client, delay) { - sendNetworkEventToPlayer("agrp.chatAutoHideDelay", client, delay); + sendNetworkEventToPlayer("v.rp.chatAutoHideDelay", client, delay); } // =========================================================================== function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) { logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`); - sendNetworkEventToPlayer("agrp.radioStream", client, streamURL, loop, volume, element); + sendNetworkEventToPlayer("v.rp.radioStream", client, streamURL, loop, volume, element); } // =========================================================================== function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) { logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`); - sendNetworkEventToPlayer("agrp.audioFileStream", client, audioName, loop, volume); + sendNetworkEventToPlayer("v.rp.audioFileStream", client, audioName, loop, volume); } // =========================================================================== function stopRadioStreamForPlayer(client) { logToConsole(LOG_DEBUG, `[AGRP.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`); - sendNetworkEventToPlayer("agrp.stopRadioStream", client); + sendNetworkEventToPlayer("v.rp.stopRadioStream", client); } // =========================================================================== @@ -993,67 +992,67 @@ function stopRadioStreamForPlayer(client) { function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) { getPlayerData(client).accountData.streamingRadioVolume = volumeLevel; getPlayerData(client).streamingRadioElement = elementId; - sendNetworkEventToPlayer("agrp.radioVolume", client, volumeLevel, elementId); + sendNetworkEventToPlayer("v.rp.radioVolume", client, volumeLevel, elementId); } // =========================================================================== function setVehicleLightsState(vehicle, state) { - setEntityData(vehicle, "agrp.lights", getVehicleData(vehicle).lights); - sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, state); + setEntityData(vehicle, "v.rp.lights", getVehicleData(vehicle).lights); + sendNetworkEventToPlayer("v.rp.veh.lights", null, vehicle.id, state); } // =========================================================================== function sendPlayerEnterPropertyKey(client, key) { - sendNetworkEventToPlayer("agrp.enterPropertyKey", client, key); + sendNetworkEventToPlayer("v.rp.enterPropertyKey", client, key); } // =========================================================================== function makePedPlayAnimation(ped, animationSlot, positionOffset) { if (getAnimationData(animationSlot).loop == true) { - setEntityData(ped, "agrp.anim", animationSlot, true); + setEntityData(ped, "v.rp.anim", animationSlot, true); } - sendNetworkEventToPlayer("agrp.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); + sendNetworkEventToPlayer("v.rp.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); } // =========================================================================== function makePedStopAnimation(ped) { - removeEntityData(ped, "agrp.anim"); - sendNetworkEventToPlayer("agrp.stopAnim", null, getPedForNetworkEvent(ped)); + removeEntityData(ped, "v.rp.anim"); + sendNetworkEventToPlayer("v.rp.stopAnim", null, getPedForNetworkEvent(ped)); } // =========================================================================== function forcePedAnimation(ped, animationSlot, positionOffset = 0) { - setEntityData(ped, "agrp.anim", animationSlot, true); - sendNetworkEventToPlayer("agrp.forceAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); + setEntityData(ped, "v.rp.anim", animationSlot, true); + sendNetworkEventToPlayer("v.rp.forceAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); } // =========================================================================== function hideAllPlayerGUI(client) { - sendNetworkEventToPlayer("agrp.hideAllGUI", client); + sendNetworkEventToPlayer("v.rp.hideAllGUI", client); } // =========================================================================== function requestClientInfo(client) { - sendNetworkEventToPlayer("agrp.clientInfo", client); + sendNetworkEventToPlayer("v.rp.clientInfo", client); } // =========================================================================== function updateInteriorLightsForPlayer(client, state) { - sendNetworkEventToPlayer("agrp.interiorLights", client, state); + sendNetworkEventToPlayer("v.rp.interiorLights", client, state); } // =========================================================================== function forcePlayerToSyncElementProperties(client, element) { - sendNetworkEventToPlayer("agrp.syncElement", client, element.id); + sendNetworkEventToPlayer("v.rp.syncElement", client, element.id); } // =========================================================================== @@ -1062,7 +1061,7 @@ function sendPlayerPedPartsAndProps(client) { let bodyParts = getPlayerCurrentSubAccount(client).bodyParts; let bodyProps = getPlayerCurrentSubAccount(client).bodyProps; - sendNetworkEventToPlayer("agrp.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]); + sendNetworkEventToPlayer("v.rp.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]); } // =========================================================================== @@ -1087,7 +1086,7 @@ function updateAllInteriorVehiclesForPlayer(client, interior, dimension) { function setPlayerBuyingVehicleState(client, state, vehicleId, position) { if (getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { - sendNetworkEventToPlayer("agrp.vehBuyState", client, state, vehicleId, position); + sendNetworkEventToPlayer("v.rp.vehBuyState", client, state, vehicleId, position); } } @@ -1102,37 +1101,37 @@ function receiveVehiclePurchaseStateUpdateFromClient(client, state) { // =========================================================================== function sendPlayerLogLevel(client, tempLogLevel = logLevel) { - sendNetworkEventToPlayer("agrp.logLevel", client, tempLogLevel); + sendNetworkEventToPlayer("v.rp.logLevel", client, tempLogLevel); } // ========================================================================== function setPlayerInfiniteRun(client, state) { - sendNetworkEventToPlayer("agrp.infiniteRun", client, state); + sendNetworkEventToPlayer("v.rp.infiniteRun", client, state); } // ========================================================================== function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems) { - sendNetworkEventToPlayer("agrp.business", client, businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems); + sendNetworkEventToPlayer("v.rp.business", client, businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems); } // ========================================================================== function sendHouseToPlayer(client, houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { - sendNetworkEventToPlayer("agrp.house", client, houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked); + sendNetworkEventToPlayer("v.rp.house", client, houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked); } // ========================================================================== function sendJobToPlayer(client, jobId, jobLocationId, name, position, blipModel, pickupModel) { - sendNetworkEventToPlayer("agrp.job", client, jobId, jobLocationId, name, position); + sendNetworkEventToPlayer("v.rp.job", client, jobId, jobLocationId, name, position); } // ========================================================================== function sendVehicleToPlayer(client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4) { - sendNetworkEventToPlayer("agrp.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4); + sendNetworkEventToPlayer("v.rp.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4); } // ========================================================================== @@ -1176,7 +1175,7 @@ function sendAllVehiclesToPlayer(client) { // ========================================================================== function makePlayerHoldObjectModel(client, modelIndex) { - sendNetworkEventToPlayer("agrp.holdObject", client, getPlayerData(client).ped, modelIndex); + sendNetworkEventToPlayer("v.rp.holdObject", client, getPlayerData(client).ped, modelIndex); } // ========================================================================== @@ -1188,44 +1187,44 @@ function receivePlayerPedNetworkId(client, pedId) { // ========================================================================== function requestPlayerPedNetworkId(client) { - sendNetworkEventToPlayer("agrp.playerPedId", client); + sendNetworkEventToPlayer("v.rp.playerPedId", client); } // ========================================================================== function setPlayerScene(client, sceneName) { getPlayerData(client).scene = sceneName; - sendNetworkEventToPlayer("agrp.scene", client, sceneName); + sendNetworkEventToPlayer("v.rp.scene", client, sceneName); } // ========================================================================== function makePlayerPedSpeak(client, pedSpeechName) { - sendNetworkEventToPlayer("agrp.pedSpeak", client, pedSpeechName); + sendNetworkEventToPlayer("v.rp.pedSpeak", client, pedSpeechName); } // ========================================================================== function setPlayerAsCopState(client, state) { - sendNetworkEventToPlayer("agrp.playerCop", client, state); + sendNetworkEventToPlayer("v.rp.playerCop", client, state); } // ========================================================================== function tellPlayerToSpawn(client, skinId, position) { - sendNetworkEventToPlayer("agrp.spawn", client, skinId, position); + sendNetworkEventToPlayer("v.rp.spawn", client, skinId, position); } // ========================================================================== function sendNameTagDistanceToClient(client, distance) { - sendNetworkEventToPlayer("agrp.nameTagDistance", client, distance); + sendNetworkEventToPlayer("v.rp.nameTagDistance", client, distance); } // ========================================================================== function sendGPSBlipToPlayer(client, position, colour) { - sendNetworkEventToPlayer("agrp.showGPSBlip", client, position, colour); + sendNetworkEventToPlayer("v.rp.showGPSBlip", client, position, colour); } // ========================================================================== @@ -1238,13 +1237,13 @@ function playerSelectedNewLocale(client, localeId) { // ========================================================================== function sendPlayerLocaleId(client, localeId) { - sendNetworkEventToPlayer("agrp.locale", client, localeId); + sendNetworkEventToPlayer("v.rp.locale", client, localeId); } // ========================================================================== function showLocaleChooserForPlayer(client) { - sendNetworkEventToPlayer("agrp.localeChooser", client); + sendNetworkEventToPlayer("v.rp.localeChooser", client); } // ========================================================================== @@ -1252,56 +1251,56 @@ function showLocaleChooserForPlayer(client) { function sendPlayerLocaleStrings(client) { let strings = getGlobalConfig().locale.sendStringsToClient; for (let i in strings) { - sendNetworkEventToPlayer("agrp.localeString", client, strings[i], getLocaleString(client, strings[i])); + sendNetworkEventToPlayer("v.rp.localeString", client, strings[i], getLocaleString(client, strings[i])); } } // ========================================================================== function clearLocalPickupsForPlayer(client) { - sendNetworkEventToPlayer("agrp.clearPickups", client); + sendNetworkEventToPlayer("v.rp.clearPickups", client); } // ========================================================================== function sendPlayerChatBoxTimeStampsState(client, state) { - sendNetworkEventToPlayer("agrp.chatTimeStamps", client, state); + sendNetworkEventToPlayer("v.rp.chatTimeStamps", client, state); } // ========================================================================== function sendPlayerChatEmojiState(client, state) { - sendNetworkEventToPlayer("agrp.chatEmoji", client, state); + sendNetworkEventToPlayer("v.rp.chatEmoji", client, state); } // ========================================================================== function sendPlayerProfanityFilterState(client, state) { - sendNetworkEventToPlayer("agrp.profanityFilter", client, state); + sendNetworkEventToPlayer("v.rp.profanityFilter", client, state); } // ========================================================================== function sendPlayerToggleVehicleCruiseControl(client) { - sendNetworkEventToPlayer("agrp.cruiseControl", client); + sendNetworkEventToPlayer("v.rp.cruiseControl", client); } // ========================================================================== function showSingleParticleEffect(position, particleEffectId, strength = 1.0, duration = 5000) { - sendNetworkEventToPlayer("agrp.particleEffectSingle", null, position, particleEffectId, strength, duration); + sendNetworkEventToPlayer("v.rp.particleEffectSingle", null, position, particleEffectId, strength, duration); } // ========================================================================== function sendPlayerCurrencyString(client) { - sendNetworkEventToPlayer("agrp.currencyString", client, getGlobalConfig().economy.currencyString); + sendNetworkEventToPlayer("v.rp.currencyString", client, getGlobalConfig().economy.currencyString); } // ========================================================================== function sendMapChangeWarningToPlayer(client, changingToNight) { - sendNetworkEventToPlayer("agrp.mapChangingSoon", client, changingToNight); + sendNetworkEventToPlayer("v.rp.mapChangingSoon", client, changingToNight); } // ========================================================================== @@ -1318,25 +1317,25 @@ function playerMapLoaded(client, mapName) { // ========================================================================== function setMapChangeWarningForPlayer(client, isChanging) { - sendNetworkEventToPlayer("agrp.mapChangeWarning", client, isChanging); + sendNetworkEventToPlayer("v.rp.mapChangeWarning", client, isChanging); } // ========================================================================== function fadePlayerCamera(client, fadeIn, time, colour = toColour(0, 0, 0, 255)) { - sendNetworkEventToPlayer("agrp.fadeCamera", client, fadeIn, time, colour); + sendNetworkEventToPlayer("v.rp.fadeCamera", client, fadeIn, time, colour); } // ========================================================================== function sendClientVariablesToClient(client) { - sendNetworkEventToPlayer("agrp.cvar", client, JSON.stringify(clientVariables)); + sendNetworkEventToPlayer("v.rp.cvar", client, JSON.stringify(clientVariables)); } // ========================================================================== function requestPlayerToken(client) { - sendNetworkEventToPlayer("agrp.token", client); + sendNetworkEventToPlayer("v.rp.token", client); } // ========================================================================== \ No newline at end of file diff --git a/scripts/server/npc.js b/scripts/server/npc.js index 9fc804e4..04bee12a 100644 --- a/scripts/server/npc.js +++ b/scripts/server/npc.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: npc.js // DESC: Provides NPC usage and functions @@ -9,27 +8,27 @@ // =========================================================================== // NPC Trigger Condition Match Types -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) +const V_NPC_COND_MATCH_NONE = 0; // None (invalid) +const V_NPC_COND_MATCH_EQ = 1; // Must be equal to +const V_NPC_COND_MATCH_GT = 2; // Must be greater than +const V_NPC_COND_MATCH_LT = 3; // Must be less than +const V_NPC_COND_MATCH_GTEQ = 4; // Must be greater than or equal to +const V_NPC_COND_MATCH_LTEQ = 5; // Must be less than or equal to +const V_NPC_COND_MATCH_CONTAINS = 6; // Must contain string (case insensitive) +const V_NPC_COND_MATCH_CONTAINS_CASE = 7; // Must contain string (case sensitive) +const V_NPC_COND_MATCH_EXACT = 8; // Must match string exactly (case insensitive) +const V_NPC_COND_MATCH_EXACT_CASE = 9; // Must match string exactly (case insensitive) // =========================================================================== // NPC Owner Types -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 +const V_NPC_OWNER_NONE = 0; // Not owned +const V_NPC_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const V_NPC_OWNER_JOB = 2; // Owned by a job +const V_NPC_OWNER_CLAN = 3; // Owned by a clan +const V_NPC_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const V_NPC_OWNER_PUBLIC = 5; // Public NPC. Anybody can do stuff with it. +const V_NPC_OWNER_BIZ = 6; // Owned by a business // =========================================================================== @@ -57,14 +56,14 @@ class NPCData { this.fightStyle = 0; this.health = 100; this.armour = 100; - this.currentAction = AGRP_NPC_ACTION_NONE; + this.currentAction = V_NPC_ACTION_NONE; this.triggers = []; this.typeFlags = 0; this.heedThreats = false; this.threats = 0; this.invincible = false; this.animationName = ""; - this.ownerType = AGRP_NPC_OWNER_NONE; + this.ownerType = V_NPC_OWNER_NONE; this.ownerId = 0; this.enabled = false; @@ -481,11 +480,11 @@ function spawnNPC(npcIndex) { let ped = createGamePed(npcData.skin, npcData.position, npcData.rotation.z); if (ped) { getNPCData(npcIndex).ped = ped; - setEntityData(ped, "agrp.dataIndex", npcIndex, false); + setEntityData(ped, "v.rp.dataIndex", npcIndex, false); if (npcData.animationName != "") { let animationId = getAnimationFromParams(npcData.animationName); if (animationId != false) { - setEntityData(ped, "agrp.anim", animationId, true); + setEntityData(ped, "v.rp.anim", animationId, true); } } setElementDimension(ped, npcData.dimension); @@ -614,7 +613,7 @@ function setNPCClanCommand(command, params, client) { return false; } - getNPCData(closestNPC).ownerType = AGRP_NPC_OWNER_CLAN; + getNPCData(closestNPC).ownerType = V_NPC_OWNER_CLAN; getNPCData(closestNPC).ownerId = getClanData(clanId).databaseId; getNPCData(closestNPC).needsSaved = true; @@ -649,7 +648,7 @@ function toggleNPCLookAtClosestPlayerCommand(command, params, client) { getNPCData(closestNPC).lookAtClosestPlayer = !getNPCData(closestNPC).lookAtClosestPlayer; getNPCData(closestNPC).needsSaved = true; - setEntityData(getNPCData(closestNPC).ped, "agrp.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true); + setEntityData(getNPCData(closestNPC).ped, "v.rp.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true); forcePlayerToSyncElementProperties(null, getNPCData(closestNPC).ped); //messagePlayerSuccess(client, getLocaleString(client, "NPCLookAtClosestPlayerSet", `{ALTCOLOUR}${getNPCData(closestNPC).name}{MAINCOLOUR})); } @@ -674,28 +673,28 @@ function getNPCInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (npcData.ownerType) { - case AGRP_NPC_OWNER_CLAN: + case V_NPC_OWNER_CLAN: ownerName = getClanData(getClanIndexFromDatabaseId(npcData.ownerId)).name; ownerType = "clan"; break; - case AGRP_NPC_OWNER_JOB: + case V_NPC_OWNER_JOB: ownerName = getJobData(getJobIndexFromDatabaseId(npcData.ownerId)).name; ownerType = "job"; break; - case AGRP_NPC_OWNER_PLAYER: + case V_NPC_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(npcData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case AGRP_NPC_OWNER_BIZ: + case V_NPC_OWNER_BIZ: ownerName = getBusinessData(getBusinessIdFromDatabaseId(npcData.ownerId)).name; ownerType = "business"; break; - case AGRP_NPC_OWNER_PUBLIC: + case V_NPC_OWNER_PUBLIC: ownerName = "Nobody"; ownerType = "public"; break; diff --git a/scripts/server/paintball.js b/scripts/server/paintball.js index b11e91cd..1b40924d 100644 --- a/scripts/server/paintball.js +++ b/scripts/server/paintball.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: paintball.js // DESC: Provides paintball/airsoft arena functions and commands @@ -13,7 +12,7 @@ let paintBallItems = []; // =========================================================================== let paintBallItemNames = { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ "Colt 45", "Uzi", "Shotgun", @@ -21,7 +20,7 @@ let paintBallItemNames = { "Sniper Rifle", ], - [AGRP_GAME_GTA_VC]: [ + [V_GAME_GTA_VC]: [ "Colt 45", "Pump Shotgun", "Ingram", @@ -30,7 +29,7 @@ let paintBallItemNames = { "Sniper Rifle", ], - [AGRP_GAME_GTA_SA]: [ + [V_GAME_GTA_SA]: [ "Desert Eagle", "Shotgun", "MP5", @@ -38,7 +37,7 @@ let paintBallItemNames = { "Sniper Rifle", ], - [AGRP_GAME_GTA_IV]: [ + [V_GAME_GTA_IV]: [ "Glock 9mm", "Micro Uzi", "Stubby Shotgun", @@ -67,7 +66,7 @@ function startPaintBall(client) { } storePlayerItemsInTempLocker(client); - getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_PAINTBALL; + getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_PAINTBALL; getPlayerData(client).inPaintBall = true; getPlayerData(client).paintBallBusiness = getPlayerBusiness(client); @@ -114,7 +113,7 @@ function stopPaintBall(client) { getPlayerData(client).inPaintBall = false; getPlayerData(client).paintBallBusiness = false; - getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE; + getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_NONE; getPlayerData(client).paintBallKills = 0; getPlayerData(client).paintBallDeaths = 0; @@ -128,7 +127,7 @@ function stopPaintBall(client) { function givePlayerPaintBallItems(client) { logToConsole(LOG_DEBUG, `[AGRP.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`); for (let i in paintBallItems) { - let itemId = createItem(paintBallItems[i], 999999, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); + let itemId = createItem(paintBallItems[i], 999999, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); getItemData(itemId).needsSaved = false; getItemData(itemId).databaseId = -1; // Make sure it doesnt save let freeSlot = getPlayerFirstEmptyHotBarSlot(client); diff --git a/scripts/server/prompt.js b/scripts/server/prompt.js index 5a555cae..fe5def97 100644 --- a/scripts/server/prompt.js +++ b/scripts/server/prompt.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: prompt.js // DESC: Provides prompt (yes/no confirmations) functions and usage @@ -9,15 +8,15 @@ // =========================================================================== // Prompts (used for prompt responses) -const AGRP_PROMPT_NONE = 0; -const AGRP_PROMPT_CREATEFIRSTCHAR = 1; -const AGRP_PROMPT_BIZORDER = 2; -const AGRP_PROMPT_GIVEVEHTOCLAN = 3; -const AGRP_PROMPT_GIVEBIZTOCLAN = 4; -const AGRP_PROMPT_GIVEHOUSETOCLAN = 5; -const AGRP_PROMPT_BUYBIZ = 6; -const AGRP_PROMPT_BUYHOUSE = 7; -const AGRP_PROMPT_RESETKEYBINDS = 8; +const V_PROMPT_NONE = 0; +const V_PROMPT_CREATEFIRSTCHAR = 1; +const V_PROMPT_BIZORDER = 2; +const V_PROMPT_GIVEVEHTOCLAN = 3; +const V_PROMPT_GIVEBIZTOCLAN = 4; +const V_PROMPT_GIVEHOUSETOCLAN = 5; +const V_PROMPT_BUYBIZ = 6; +const V_PROMPT_BUYHOUSE = 7; +const V_PROMPT_RESETKEYBINDS = 8; // =========================================================================== @@ -29,21 +28,21 @@ function initPromptScript() { // =========================================================================== function playerPromptAnswerNo(client) { - if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) { + if (getPlayerData(client).promptType == V_PROMPT_NONE) { return false; } logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`); switch (getPlayerData(client).promptType) { - case AGRP_PROMPT_CREATEFIRSTCHAR: + case V_PROMPT_CREATEFIRSTCHAR: logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`); showPlayerErrorGUI(client, getLocaleString(client, "DidNotCreateCharacter"), getLocaleString(client, getLocaleString(client, "GUIWarningTitle"))); getPlayerData(targetClient).customDisconnectReason = "FailedToCreateCharacter"; setTimeout(function () { disconnectPlayer(client); }, 5000); break; - case AGRP_PROMPT_BIZORDER: + case V_PROMPT_BIZORDER: if (getPlayerData(client).businessOrderAmount > 0) { if (doesPlayerUseGUI(client)) { showPlayerErrorGUI(client, getLocaleString(client, "BusinessOrderCanceled"), getLocaleString(client, "GUIWarning")); @@ -62,25 +61,25 @@ function playerPromptAnswerNo(client) { break; } - getPlayerData(client).promptType = AGRP_PROMPT_NONE; + getPlayerData(client).promptType = V_PROMPT_NONE; } // =========================================================================== function playerPromptAnswerYes(client) { - if (getPlayerData(client).promptType == AGRP_PROMPT_NONE) { + if (getPlayerData(client).promptType == V_PROMPT_NONE) { return false; } logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`); switch (getPlayerData(client).promptType) { - case AGRP_PROMPT_CREATEFIRSTCHAR: { + case V_PROMPT_CREATEFIRSTCHAR: { showPlayerNewCharacterGUI(client); break; } - case AGRP_PROMPT_BIZORDER: { + case V_PROMPT_BIZORDER: { if (getPlayerData(client).businessOrderAmount > 0) { if (getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) { logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${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)`); @@ -97,7 +96,7 @@ function playerPromptAnswerYes(client) { logToConsole(LOG_DEBUG, `[AGRP.Prompt] ${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, getLocaleString(client, "BusinessOrderSuccessInfo", getPlayerData(client).businessOrderAmount, getItemTypeData(getPlayerData(client).businessOrderItem).name, getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue), getPlayerData(client).businessOrderCost), getLocaleString(client, "GUIInfoTitle")); - createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount); + createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, V_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); @@ -112,7 +111,7 @@ function playerPromptAnswerYes(client) { break; } - case AGRP_PROMPT_GIVEVEHTOCLAN: { + case V_PROMPT_GIVEVEHTOCLAN: { if (!isPlayerInAnyVehicle(client)) { messagePlayerError(client, getLocaleString(client, "MustBeInVehicle")); return false; @@ -123,7 +122,7 @@ function playerPromptAnswerYes(client) { return false; } - if (getVehicleData(getPlayerVehicle(client)).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getVehicleData(getPlayerVehicle(client)).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnVehicle")); return false; } @@ -133,21 +132,21 @@ function playerPromptAnswerYes(client) { return false; } - getVehicleData(getPlayerVehicle(client)).ownerType = AGRP_VEHOWNER_CLAN; + getVehicleData(getPlayerVehicle(client)).ownerType = V_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 AGRP_PROMPT_GIVEHOUSETOCLAN: { + case V_PROMPT_GIVEHOUSETOCLAN: { let houseId = getPlayerHouse(client); if (!houseId) { messagePlayerError(client, getLocaleString(client, "InvalidHouse")); return false; } - if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getHouseData(houseId).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnHouse")); return false; } @@ -157,21 +156,21 @@ function playerPromptAnswerYes(client) { return false; } - getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_CLAN; + getHouseData(houseId).ownerType = V_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 AGRP_PROMPT_GIVEBIZTOCLAN: { + case V_PROMPT_GIVEBIZTOCLAN: { let businessId = getPlayerBusiness(client); if (!businessId) { messagePlayerError(client, getLocaleString(client, "InvalidBusiness")); return false; } - if (getBusinessData(businessId).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getBusinessData(businessId).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnBusiness")); return false; } @@ -181,14 +180,14 @@ function playerPromptAnswerYes(client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN; + getBusinessData(businessId).ownerType = V_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 AGRP_PROMPT_BUYHOUSE: { + case V_PROMPT_BUYHOUSE: { let houseId = getPlayerHouse(client); if (!houseId) { messagePlayerError(client, getLocaleString(client, "InvalidHouse")); @@ -205,7 +204,7 @@ function playerPromptAnswerYes(client) { return false; } - getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER; + getHouseData(houseId).ownerType = V_HOUSE_OWNER_PLAYER; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getHouseData(houseId).buyPrice = 0; getHouseData(houseId).needsSaved = true; @@ -216,7 +215,7 @@ function playerPromptAnswerYes(client) { break; } - case AGRP_PROMPT_BUYBIZ: { + case V_PROMPT_BUYBIZ: { let businessId = getPlayerBusiness(client); if (!businessId) { messagePlayerError(client, getLocaleString(client, "InvalidBusiness")); @@ -233,7 +232,7 @@ function playerPromptAnswerYes(client) { return false; } - getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER; + getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(client).databaseId; getBusinessData(businessId).buyPrice = 0; getBusinessData(businessId).needsSaved = true; @@ -245,7 +244,7 @@ function playerPromptAnswerYes(client) { break; } - case AGRP_PROMPT_RESETKEYBINDS: { + case V_PROMPT_RESETKEYBINDS: { // TODO: Needs database query! //for (let i in getPlayerData(client).keyBinds) { @@ -265,7 +264,7 @@ function playerPromptAnswerYes(client) { break; } - case AGRP_PROMPT_COPYKEYBINDSTOSERVER: { + case V_PROMPT_COPYKEYBINDSTOSERVER: { //messagePlayerSuccess(client, getLocaleString(client, "KeyBindsCopiedToServer", serverName)); break; } @@ -277,7 +276,7 @@ function playerPromptAnswerYes(client) { } } - getPlayerData(client).promptType = AGRP_PROMPT_NONE; + getPlayerData(client).promptType = V_PROMPT_NONE; } // =========================================================================== @@ -295,7 +294,7 @@ function playerPromptAnswerNoCommand(command, params, client) { // =========================================================================== function showPlayerTwoFactorAuthenticationGUI(client) { - sendNetworkEventToPlayer("agrp.2fa", client); + sendNetworkEventToPlayer("v.rp.2fa", client); } // =========================================================================== \ No newline at end of file diff --git a/scripts/server/property.js b/scripts/server/property.js index fd1d9b4f..2217314c 100644 --- a/scripts/server/property.js +++ b/scripts/server/property.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: property.js // DESC: Provides property (house, business, etc) with functions and usage @@ -9,35 +8,35 @@ // =========================================================================== // Property Types -const AGRP_PROP_TYPE_NONE = 0; // None (invalid) -const AGRP_PROP_TYPE_BIZ_NORMAL = 1; // Normal business (sells items) -const AGRP_PROP_TYPE_BIZ_BANK = 2; // Bank business -const AGRP_PROP_TYPE_BIZ_PUBLIC = 3; // Public business (Government, public service, etc) -const AGRP_PROP_TYPE_BIZ_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter -const AGRP_PROP_TYPE_BIZ_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc) -const AGRP_PROP_TYPE_HOUSE = 6; // House +const V_PROP_TYPE_NONE = 0; // None (invalid) +const V_PROP_TYPE_BIZ_NORMAL = 1; // Normal business (sells items) +const V_PROP_TYPE_BIZ_BANK = 2; // Bank business +const V_PROP_TYPE_BIZ_PUBLIC = 3; // Public business (Government, public service, etc) +const V_PROP_TYPE_BIZ_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter +const V_PROP_TYPE_BIZ_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc) +const V_PROP_TYPE_HOUSE = 6; // House // =========================================================================== // Property Location Types -const AGRP_PROP_LOC_NONE = 0; // None -const AGRP_PROP_LOC_GATE = 1; // Moveable gate that belongs to the property -const AGRP_PROP_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped -const AGRP_PROP_LOC_FUEL = 3; // Fuel pump -const AGRP_PROP_LOC_DRIVETHRU = 4; // Drivethrough -const AGRP_PROP_LOC_VENDMACHINE = 5; // Vending machine -const AGRP_PROP_LOC_ATM = 6; // ATM -const AGRP_PROP_LOC_PAYPHONE = 7; // Payphone +const V_PROP_LOC_NONE = 0; // None +const V_PROP_LOC_GATE = 1; // Moveable gate that belongs to the property +const V_PROP_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped +const V_PROP_LOC_FUEL = 3; // Fuel pump +const V_PROP_LOC_DRIVETHRU = 4; // Drivethrough +const V_PROP_LOC_VENDMACHINE = 5; // Vending machine +const V_PROP_LOC_ATM = 6; // ATM +const V_PROP_LOC_PAYPHONE = 7; // Payphone // =========================================================================== // Property Owner Types -const AGRP_PROP_OWNER_NONE = 0; // Not owned -const AGRP_PROP_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) -const AGRP_PROP_OWNER_JOB = 2; // Owned by a job -const AGRP_PROP_OWNER_CLAN = 3; // Owned by a clan -const AGRP_PROP_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) -const AGRP_PROP_OWNER_PUBLIC = 5; // Public property. Used for goverment/official places like police, fire, city hall, DMV, etc +const V_PROP_OWNER_NONE = 0; // Not owned +const V_PROP_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const V_PROP_OWNER_JOB = 2; // Owned by a job +const V_PROP_OWNER_CLAN = 3; // Owned by a clan +const V_PROP_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const V_PROP_OWNER_PUBLIC = 5; // Public property. Used for goverment/official places like police, fire, city hall, DMV, etc // =========================================================================== @@ -49,7 +48,7 @@ class PropertyData { constructor(dbAssoc = false) { this.databaseId = 0; this.name = ""; - this.ownerType = AGRP_PROP_OWNER_NONE; + this.ownerType = V_PROP_OWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.locked = false; @@ -57,7 +56,7 @@ class PropertyData { this.index = -1; this.needsSaved = false; this.interiorLights = true; - this.propertyType = AGRP_PROP_TYPE_NONE; + this.propertyType = V_PROP_TYPE_NONE; this.entrancePosition = false; this.entranceRotation = 0.0; @@ -82,7 +81,7 @@ class PropertyData { this.streamingRadioStation = 0; this.streamingRadioStationIndex = -1; - this.labelHelpType = AGRP_PROPLABEL_INFO_NONE; + this.labelHelpType = V_PROPLABEL_INFO_NONE; if (dbAssoc) { this.databaseId = toInteger(dbAssoc["prop_id"]); @@ -353,7 +352,7 @@ function setPropertyNameCommand(command, params, client) { let oldPropertyName = getPropertyData(propertyIndex).name; getPropertyData(propertyIndex).name = newPropertyName; - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.name", getPropertyData(propertyIndex).name, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.name", getPropertyData(propertyIndex).name, true); getPropertyData(propertyIndex).needsSaved = true; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed property ${getInlinePropertyColour(propertyIndex)}${oldPropertyName}{MAINCOLOUR} to ${getInlinePropertyColour(propertyIndex)}${newPropertyName}`); } @@ -384,7 +383,7 @@ function setPropertyOwnerCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_PLAYER; + getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_PLAYER; getPropertyData(propertyIndex).ownerId = getPlayerCurrentSubAccount(newPropertyOwner).databaseId; getPropertyData(propertyIndex).needsSaved = true; @@ -417,7 +416,7 @@ function setPropertyJobCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_JOB; + getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_JOB; getPropertyData(propertyIndex).ownerId = getJobData(jobId).databaseId; getPropertyData(propertyIndex).needsSaved = true; @@ -441,7 +440,7 @@ function setPropertyClanCommand(command, params, client) { return false; } - if (getPropertyData(business).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getPropertyData(business).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnProperty")); return false; } @@ -452,9 +451,9 @@ function setPropertyClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetPropertyClanConfirmMessage"), getLocaleString(client, "SetPropertyClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_BIZGIVETOCLAN; + getPlayerData(client).promptType = V_PROMPT_BIZGIVETOCLAN; - //getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_CLAN; + //getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_CLAN; //getPropertyData(propertyIndex).ownerId = getClanData(clanId).databaseId; //getPropertyData(propertyIndex).needsSaved = true; } @@ -476,7 +475,7 @@ function setPropertyRankCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) { let clanId = getClanIndexFromDatabaseId(getPropertyData(propertyIndex).ownerId); rankId = getClanRankFromParams(clanId, params); if (!getClanRankData(clanId, rankId)) { @@ -485,7 +484,7 @@ function setPropertyRankCommand(command, params, client) { } getPropertyData(propertyIndex).rank = getClanRankData(clanId, rankId).databaseId; messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); - } else if (getPropertyData(propertyIndex).ownerType == AGRP_VEHOWNER_JOB) { + } else if (getPropertyData(propertyIndex).ownerType == V_VEHOWNER_JOB) { getPropertyData(propertyIndex).rank = rankId; messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getPropertyData(propertyIndex).ownerId)).name} {MAINCOLOUR}job!`); } @@ -564,7 +563,7 @@ function setPropertyJobCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_JOB; + getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_JOB; getPropertyData(propertyIndex).ownerId = getJobData(jobId).databaseId; getPropertyData(propertyIndex).needsSaved = true; @@ -585,7 +584,7 @@ function setPropertyPublicCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_PUBLIC; + getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_PUBLIC; getPropertyData(propertyIndex).ownerId = 0; getPropertyData(propertyIndex).needsSaved = true; @@ -606,7 +605,7 @@ function removePropertyOwnerCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).ownerType = AGRP_BIZ_OWNER_NONE; + getPropertyData(propertyIndex).ownerType = V_BIZ_OWNER_NONE; getPropertyData(propertyIndex).ownerId = -1; getPropertyData(propertyIndex).needsSaved = true; @@ -671,7 +670,7 @@ function setPropertyPaintBallCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).type = AGRP_BIZ_TYPE_PAINTBALL; + getPropertyData(propertyIndex).type = V_BIZ_TYPE_PAINTBALL; getPropertyData(propertyIndex).needsSaved = true; messagePlayerSuccess(client, getLocaleString(client, "PropertyIsNowPaintBall")); } @@ -694,24 +693,24 @@ function getPropertyInfoCommand(command, params, client) { let ownerName = "Unknown"; switch (propertyData.ownerType) { - case AGRP_BIZ_OWNER_CLAN: + case V_BIZ_OWNER_CLAN: ownerName = getClanData(propertyData.ownerId).name; break; - case AGRP_BIZ_OWNER_JOB: + case V_BIZ_OWNER_JOB: ownerName = getJobData(propertyData.ownerId).name; break; - case AGRP_BIZ_OWNER_PLAYER: + case V_BIZ_OWNER_PLAYER: let subAccountData = loadSubAccountFromId(propertyData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; break; - case AGRP_BIZ_OWNER_PUBLIC: + case V_BIZ_OWNER_PUBLIC: ownerName = "Public"; break; - case AGRP_BIZ_OWNER_NONE: + case V_BIZ_OWNER_NONE: //submitBugReport(client, `[AUTOMATED REPORT] getPropertyInfoCommand() - Invalid ownerType for business ${propertyIndex}/${getPropertyData(propertyIndex).databaseId}`); ownerName = "None"; break; @@ -1014,7 +1013,7 @@ function giveDefaultItemsToPropertyCommand(command, params, client) { let itemTypeId = getItemTypeFromParams(getGameConfig().defaultPropertyItems[getGame()][typeParam][i][0]); let itemTypeData = getItemTypeData(itemTypeId); if (itemTypeData) { - let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, AGRP_ITEM_OWNER_BIZFLOOR, getPropertyData(propertyIndex).databaseId, getGameConfig().defaultPropertyItems[getGame()][typeParam][i][1]); + let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, V_ITEM_OWNER_BIZFLOOR, getPropertyData(propertyIndex).databaseId, getGameConfig().defaultPropertyItems[getGame()][typeParam][i][1]); getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultPropertyItems[getGame()][typeParam][i][2]; } } @@ -1034,8 +1033,8 @@ function setPropertyDealershipCommand(command, params, client) { return false; } - getPropertyData(propertyIndex).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE; - getPropertyData(propertyIndex).type = AGRP_BIZ_TYPE_DEALERSHIP; + getPropertyData(propertyIndex).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE; + getPropertyData(propertyIndex).type = V_BIZ_TYPE_DEALERSHIP; updatePropertyPickupLabelData(propertyIndex); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the property type of ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name}{MAINCOLOUR} to dealership`); } @@ -1141,7 +1140,7 @@ function setPropertyBuyPriceCommand(command, params, client) { } getPropertyData(propertyIndex).buyPrice = amount; - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.price", getPropertyData(propertyIndex).buyPrice, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.price", getPropertyData(propertyIndex).buyPrice, true); getPropertyData(propertyIndex).needsSaved = true; messagePlayerSuccess(client, `{MAINCOLOUR}You set property ${getInlinePropertyColour(propertyIndex)}${getPropertyData(propertyIndex).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`); @@ -1223,7 +1222,7 @@ function orderItemForPropertyCommand(command, params, client) { let orderTotalCost = pricePerItem * amount; - //getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; + //getPlayerData(client).promptType = V_PROMPT_BIZORDER; getPlayerData(client).businessOrderAmount = amount; getPlayerData(client).businessOrderProperty = propertyIndex; getPlayerData(client).businessOrderItem = itemType; @@ -1232,7 +1231,7 @@ function orderItemForPropertyCommand(command, params, client) { getPropertyData(propertyIndex).needsSaved = true; showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(pricePerItem)} each will cost a total of ${getCurrencyString(orderTotalCost)}`, "Property Order Cost"); - getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; + getPlayerData(client).promptType = V_PROMPT_BIZORDER; } // =========================================================================== @@ -1292,7 +1291,7 @@ function buyPropertyCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "BuyPropertyConfirmMessage"), getLocaleString(client, "BuyPropertyConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_BIZBUY; + getPlayerData(client).promptType = V_PROMPT_BIZBUY; } // =========================================================================== @@ -1578,7 +1577,7 @@ function createPropertyEntrancePickup(propertyIndex) { logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for property ${propertyData.name}`); - if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE) { + if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE) { let entrancePickup = null; if (isGameFeatureSupported("pickup")) { let pickupModelId = getGameConfig().pickupModels[getGame()].Property; @@ -1859,17 +1858,17 @@ function exitProperty(client) { function getPropertyOwnerTypeText(ownerType) { switch (ownerType) { - case AGRP_BIZ_OWNER_CLAN: + case V_BIZ_OWNER_CLAN: return "clan"; - case AGRP_BIZ_OWNER_JOB: + case V_BIZ_OWNER_JOB: return "job"; - case AGRP_BIZ_OWNER_PLAYER: + case V_BIZ_OWNER_PLAYER: return "player"; - case AGRP_BIZ_OWNER_NONE: - case AGRP_BIZ_OWNER_PUBLIC: + case V_BIZ_OWNER_NONE: + case V_BIZ_OWNER_PUBLIC: return "not owned"; default: @@ -2003,7 +2002,7 @@ function setPropertyDataIndexes() { //} for (let j in getServerData().properties[i].locations) { - if (getServerData().properties[i].locations[j].type == AGRP_BIZ_LOC_ATM) { + if (getServerData().properties[i].locations[j].type == V_BIZ_LOC_ATM) { getServerData().atmLocationCache.push([i, j, getServerData().properties[i].locations[j].position]); } } @@ -2019,7 +2018,7 @@ function addToPropertyInventory(propertyIndex, itemType, amount, buyPrice) { tempItemData.buyPrice = buyPrice; tempItemData.itemType = getItemTypeData(itemType).databaseId; tempItemData.ownerId = getPropertyData(propertyIndex).databaseId; - tempItemData.ownerType = AGRP_ITEMOWNER_BIZ; + tempItemData.ownerType = V_ITEMOWNER_BIZ; tempItemData.ownerIndex = propertyIndex; tempItemData.itemTypeIndex = itemType; saveItemToDatabase(tempItemData); @@ -2102,7 +2101,7 @@ function buyFromPropertyCommand(command, params, client) { } takePlayerCash(client, totalCost); - createItem(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); + createItem(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); cachePlayerHotBarItems(client); getPropertyData(propertyIndex).till = getPropertyData(propertyIndex).till + totalCost; @@ -2112,7 +2111,7 @@ function buyFromPropertyCommand(command, params, client) { } let useType = getItemTypeData(getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).itemTypeIndex).useType; - if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { + if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) { if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) { messagePlayerError(client, getLocaleString(client, "WeaponBanned")); return false; @@ -2197,7 +2196,7 @@ function storeItemInPropertyStorageCommand(command, params, client) { return false; } - getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE; + getItemData(getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZSTORAGE; getPropertyData(propertyIndex).storageItemCache[firstSlot] = getPropertyData(propertyIndex).floorItemCache[itemSlot - 1]; getPropertyData(propertyIndex).storageItemCache[itemSlot - 1] = -1; messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getPropertyData(propertyIndex).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`); @@ -2232,7 +2231,7 @@ function stockItemOnPropertyFloorCommand(command, params, client) { return false; } - getItemData(getPropertyData(propertyIndex).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR; + getItemData(getPropertyData(propertyIndex).storageItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZFLOOR; getPropertyData(propertyIndex).floorItemCache[firstSlot] = getPropertyData(propertyIndex).storageItemCache[itemSlot - 1]; getPropertyData(propertyIndex).storageItemCache[itemSlot - 1] = -1; messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getPropertyData(propertyIndex).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`); @@ -2272,14 +2271,14 @@ function cachePropertyItems(propertyIndex) { //let propertyData = getPropertyData(propertyIndex); //logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${propertyData.name}) ...`); - //getPropertyData(propertyIndex).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == propertyData.databaseId).map(i => i.index); - //getPropertyData(propertyIndex).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == propertyData.databaseId); + //getPropertyData(propertyIndex).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == propertyData.databaseId).map(i => i.index); + //getPropertyData(propertyIndex).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == propertyData.databaseId); logToConsole(LOG_VERBOSE, `[AGRP.Property] Caching business items for business ${propertyIndex} (${getPropertyData(propertyIndex).name}) ...`); for (let i in getServerData().items) { - if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) { + if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) { getPropertyData(propertyIndex).floorItemCache.push(i); - } else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) { + } else if (getItemData(i).ownerType == V_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getPropertyData(propertyIndex).databaseId) { getPropertyData(propertyIndex).storageItemCache.push(i); } } @@ -2303,50 +2302,50 @@ function updatePropertyPickupLabelData(propertyIndex) { } if (getPropertyData(propertyIndex).exitPickup != null) { - setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_EXIT, false); - setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.owner.id", propertyIndex, false); - setEntityData(getPropertyData(propertyIndex).exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true); + setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.owner.type", V_PICKUP_BUSINESS_EXIT, false); + setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.owner.id", propertyIndex, false); + setEntityData(getPropertyData(propertyIndex).exitPickup, "v.rp.label.type", V_LABEL_EXIT, true); } if (getPropertyData(propertyIndex).entrancePickup != null) { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_ENTRANCE, false); - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.owner.id", propertyIndex, false); - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.type", AGRP_LABEL_BUSINESS, true); - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.name", getPropertyData(propertyIndex).name, true); - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.locked", getPropertyData(propertyIndex).locked, true); - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_NONE, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.owner.type", V_PICKUP_BUSINESS_ENTRANCE, false); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.owner.id", propertyIndex, false); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.type", V_LABEL_BUSINESS, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.name", getPropertyData(propertyIndex).name, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.locked", getPropertyData(propertyIndex).locked, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_NONE, true); switch (getPropertyData(propertyIndex).labelHelpType) { - case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true); + case V_PROPLABEL_INFO_ENTERVEHICLE: { + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTERVEHICLE, true); break; } - case AGRP_PROPLABEL_INFO_ENTER: { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); + case V_PROPLABEL_INFO_ENTER: { + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true); break; } - case AGRP_PROPLABEL_INFO_REPAIR: { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true); + case V_PROPLABEL_INFO_REPAIR: { + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_REPAIR, true); break; } default: { if (getPropertyData(propertyIndex).hasInterior) { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true); } else { if (doesPropertyHaveAnyItemsToBuy(propertyIndex)) { - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUY, true); } else { - removeEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.help"); + removeEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.help"); } } break; } } - setEntityData(getPropertyData(propertyIndex).entrancePickup, "agrp.label.price", getPropertyData(propertyIndex).buyPrice, true); + setEntityData(getPropertyData(propertyIndex).entrancePickup, "v.rp.label.price", getPropertyData(propertyIndex).buyPrice, true); } } @@ -2424,7 +2423,7 @@ function doesPropertyHaveAnyItemsToBuy(propertyIndex) { //function clearPlayerPropertyGameScripts(client, propertyIndex) { // for(let i in getPropertyData(propertyIndex).gameScripts) { -// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); +// sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY); // } //} @@ -2446,11 +2445,11 @@ function canPlayerWithdrawFromPropertyTill(client, propertyIndex) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) { return true; } @@ -2466,11 +2465,11 @@ function canPlayerSetPropertyInteriorLights(client, propertyIndex) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) { return true; } @@ -2486,11 +2485,11 @@ function canPlayerLockUnlockProperty(client, propertyIndex) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER && getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN && getPropertyData(propertyIndex).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) { return true; } @@ -2506,13 +2505,13 @@ function canPlayerManageProperty(client, propertyIndex) { return true; } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_PLAYER) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_PLAYER) { if (getPropertyData(propertyIndex).ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (getPropertyData(propertyIndex).ownerType == AGRP_BIZ_OWNER_CLAN) { + if (getPropertyData(propertyIndex).ownerType == V_BIZ_OWNER_CLAN) { if (getPropertyData(propertyIndex).ownerId == getPlayerClan(client)) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManagePropertyes"))) { return true; @@ -2634,7 +2633,7 @@ function doesPropertyHaveBuyableItemOfUseType(propertyIndex, useType) { // =========================================================================== function getInlinePropertyColour(propertyIndex) { - if (getPropertyData(propertyIndex).type == AGRP_PROP_TYPE_HOUSE) { + if (getPropertyData(propertyIndex).type == V_PROP_TYPE_HOUSE) { return "{houseGreen}"; } else { return "{businessBlue}"; @@ -2644,7 +2643,7 @@ function getInlinePropertyColour(propertyIndex) { // =========================================================================== function getPropertyTypeName(propertyIndex) { - if (getPropertyData(propertyIndex).type == AGRP_PROP_TYPE_HOUSE) { + if (getPropertyData(propertyIndex).type == V_PROP_TYPE_HOUSE) { return "House"; } else { return "Business"; diff --git a/scripts/server/race.js b/scripts/server/race.js index 6b3c0415..85f9325f 100644 --- a/scripts/server/race.js +++ b/scripts/server/race.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: race.js // DESC: Provides racing usage and functions diff --git a/scripts/server/radio.js b/scripts/server/radio.js index d6c69cdb..c8a92976 100644 --- a/scripts/server/radio.js +++ b/scripts/server/radio.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: radio.js // DESC: Provides radio station streaming @@ -128,7 +127,7 @@ function playStreamingRadioCommand(command, params, client) { let clients = getClients(); for (let i in clients) { - if (getEntityData(clients[i], "agrp.inHouse") == houseId) { + if (getEntityData(clients[i], "v.rp.inHouse") == houseId) { playRadioStreamForPlayer(clients[i], ""); } } @@ -141,7 +140,7 @@ function playStreamingRadioCommand(command, params, client) { let clients = getClients(); for (let i in clients) { - if (getEntityData(clients[i], "agrp.inHouse") == houseId) { + if (getEntityData(clients[i], "v.rp.inHouse") == houseId) { playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i])); } } diff --git a/scripts/server/security.js b/scripts/server/security.js index a0e607a3..cce1cae3 100644 --- a/scripts/server/security.js +++ b/scripts/server/security.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: security.js // DESC: Provides security functions and usage diff --git a/scripts/server/staff.js b/scripts/server/staff.js index 25391369..0abbe37d 100644 --- a/scripts/server/staff.js +++ b/scripts/server/staff.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: staff.js // DESC: Provides staff commands, functions and usage @@ -900,7 +899,7 @@ function getPlayerCommand(command, params, client) { getPlayerData(targetClient).returnToHeading = getPlayerPosition(targetClient); getPlayerData(targetClient).returnToDimension = getPlayerDimension(targetClient); getPlayerData(targetClient).returnToInterior = getPlayerInterior(targetClient); - getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_ADMINGET; + getPlayerData(targetClient).returnToType = V_RETURNTO_TYPE_ADMINGET; setPlayerPosition(targetClient, getPosBehindPos(getPlayerPosition(client), getPlayerHeading(client), 2)); setPlayerHeading(targetClient, getPlayerHeading(client)); @@ -952,7 +951,7 @@ function returnPlayerCommand(command, params, client) { getPlayerData(targetClient).returnToInterior = null; getPlayerData(targetClient).returnToHouse = null; getPlayerData(targetClient).returnToBusiness = null; - getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_NONE; + getPlayerData(targetClient).returnToType = V_RETURNTO_TYPE_NONE; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`, true); messagePlayerAlert(targetClient, `An admin has returned you to your previous location`); diff --git a/scripts/server/startup.js b/scripts/server/startup.js index fe6c8250..435d71bb 100644 --- a/scripts/server/startup.js +++ b/scripts/server/startup.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: startup.js // DESC: Provides startup/shutdown procedures diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index 3632fa8b..b6bf9d87 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: subaccount.js // DESC: Provides subaccount (character) functions and usage @@ -514,12 +513,12 @@ function selectCharacter(client, characterId = -1) { logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`); //setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition); - getPlayerData(client).pedState = AGRP_PEDSTATE_SPAWNING; + getPlayerData(client).pedState = V_PEDSTATE_SPAWNING; - if (getGame() <= AGRP_GAME_GTA_IV_EFLC) { + if (getGame() <= V_GAME_GTA_IV_EFLC) { spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); onPlayerSpawn(client); - } else if (getGame() == AGRP_GAME_MAFIA_ONE) { + } else if (getGame() == V_GAME_MAFIA_ONE) { //spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); //logToConsole(LOG_DEBUG, `[AGRP.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); diff --git a/scripts/server/theme.js b/scripts/server/theme.js index d4d9a448..8c8b80a9 100644 --- a/scripts/server/theme.js +++ b/scripts/server/theme.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: theme.js // DESC: Provides server theme content diff --git a/scripts/server/timers.js b/scripts/server/timers.js index e40210b1..d05efb36 100644 --- a/scripts/server/timers.js +++ b/scripts/server/timers.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: timers.js // DESC: Provides timer functions and features @@ -237,7 +236,7 @@ function checkServerGameTime() { getServerConfig().minute = dateTime.getMinutes(); } - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { if (getGameConfig().mainWorldScene[getGame()] == "FREERIDE") { if (isServerGoingToChangeMapsSoon(getServerConfig().hour, getServerConfig().minute)) { sendMapChangeWarningToPlayer(null, true); @@ -300,7 +299,7 @@ function checkPayDays() { } for (let i in getServerData().businesses) { - if (getBusinessData(i).ownerType != AGRP_BIZ_OWNER_NONE && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_FACTION) { + if (getBusinessData(i).ownerType != V_BIZ_OWNER_NONE && getBusinessData(i).ownerType != V_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != V_BIZ_OWNER_FACTION) { getBusinessData(i).till += 1000; } } diff --git a/scripts/server/trigger.js b/scripts/server/trigger.js index a5191a44..df03dbc1 100644 --- a/scripts/server/trigger.js +++ b/scripts/server/trigger.js @@ -1,131 +1,130 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: trigger.js // DESC: Provides trigger system functions and usage // TYPE: Server (JavaScript) // =========================================================================== -const AGRP_TRIG_TYPE_NONE = 0; -const AGRP_TRIG_TYPE_BIZ_OWNER_CHANGE = 1; -const AGRP_TRIG_TYPE_BIZ_NAME_CHANGE = 2; -const AGRP_TRIG_TYPE_BIZ_LOCK_CHANGE = 3; -const AGRP_TRIG_TYPE_BIZ_PLAYER_ENTER = 4; -const AGRP_TRIG_TYPE_BIZ_PLAYER_EXIT = 5; -const AGRP_TRIG_TYPE_BIZ_NPC_ENTER = 6; -const AGRP_TRIG_TYPE_BIZ_NPC_EXIT = 7; -const AGRP_TRIG_TYPE_BIZ_DAMAGE = 8; -const AGRP_TRIG_TYPE_BIZ_ROBBED = 9; -const AGRP_TRIG_TYPE_BIZ_PLAYER_PURCHASE = 10; -const AGRP_TRIG_TYPE_BIZ_NPC_PURCHASE = 11; -const AGRP_TRIG_TYPE_HOUSE_OWNER_CHANGE = 12; -const AGRP_TRIG_TYPE_HOUSE_NAME_CHANGE = 13; -const AGRP_TRIG_TYPE_HOUSE_LOCK_CHANGE = 14; -const AGRP_TRIG_TYPE_HOUSE_PLAYER_ENTER = 15; -const AGRP_TRIG_TYPE_HOUSE_PLAYER_EXIT = 16; -const AGRP_TRIG_TYPE_HOUSE_NPC_ENTER = 17; -const AGRP_TRIG_TYPE_HOUSE_NPC_EXIT = 18; -const AGRP_TRIG_TYPE_HOUSE_DAMAGE = 19; -const AGRP_TRIG_TYPE_HOUSE_ROBBED = 20; -const AGRP_TRIG_TYPE_VEH_OWNER_CHANGE = 21; -const AGRP_TRIG_TYPE_VEH_PLAYER_ENTER = 22; -const AGRP_TRIG_TYPE_VEH_PLAYER_EXIT = 23; -const AGRP_TRIG_TYPE_VEH_NPC_ENTER = 24; -const AGRP_TRIG_TYPE_VEH_NPC_EXIT = 25; -const AGRP_TRIG_TYPE_VEH_COLLISION = 26; -const AGRP_TRIG_TYPE_VEH_DAMAGED = 27; -const AGRP_TRIG_TYPE_VEH_SHOT = 28; -const AGRP_TRIG_TYPE_VEH_TRUNK_CHANGE = 29; -const AGRP_TRIG_TYPE_VEH_ITEM_TAKEN = 30; -const AGRP_TRIG_TYPE_VEH_ITEM_STORED = 31; -const AGRP_TRIG_TYPE_VEH_ENGINE_CHANGE = 32; -const AGRP_TRIG_TYPE_VEH_LIGHTS_CHANGE = 33; -const AGRP_TRIG_TYPE_VEH_SIREN_CHANGE = 34; -const AGRP_TRIG_TYPE_VEH_LOCK_CHANGE = 35; -const AGRP_TRIG_TYPE_VEH_REPAIRED = 36; -const AGRP_TRIG_TYPE_VEH_COLOUR_CHANGE = 37; -const AGRP_TRIG_TYPE_VEH_EXTRA_CHANGE = 38; -const AGRP_TRIG_TYPE_PLAYER_SHOUT = 39; -const AGRP_TRIG_TYPE_PLAYER_TALK = 40; -const AGRP_TRIG_TYPE_PLAYER_WHISPER = 41; +const V_TRIG_TYPE_NONE = 0; +const V_TRIG_TYPE_BIZ_OWNER_CHANGE = 1; +const V_TRIG_TYPE_BIZ_NAME_CHANGE = 2; +const V_TRIG_TYPE_BIZ_LOCK_CHANGE = 3; +const V_TRIG_TYPE_BIZ_PLAYER_ENTER = 4; +const V_TRIG_TYPE_BIZ_PLAYER_EXIT = 5; +const V_TRIG_TYPE_BIZ_NPC_ENTER = 6; +const V_TRIG_TYPE_BIZ_NPC_EXIT = 7; +const V_TRIG_TYPE_BIZ_DAMAGE = 8; +const V_TRIG_TYPE_BIZ_ROBBED = 9; +const V_TRIG_TYPE_BIZ_PLAYER_PURCHASE = 10; +const V_TRIG_TYPE_BIZ_NPC_PURCHASE = 11; +const V_TRIG_TYPE_HOUSE_OWNER_CHANGE = 12; +const V_TRIG_TYPE_HOUSE_NAME_CHANGE = 13; +const V_TRIG_TYPE_HOUSE_LOCK_CHANGE = 14; +const V_TRIG_TYPE_HOUSE_PLAYER_ENTER = 15; +const V_TRIG_TYPE_HOUSE_PLAYER_EXIT = 16; +const V_TRIG_TYPE_HOUSE_NPC_ENTER = 17; +const V_TRIG_TYPE_HOUSE_NPC_EXIT = 18; +const V_TRIG_TYPE_HOUSE_DAMAGE = 19; +const V_TRIG_TYPE_HOUSE_ROBBED = 20; +const V_TRIG_TYPE_VEH_OWNER_CHANGE = 21; +const V_TRIG_TYPE_VEH_PLAYER_ENTER = 22; +const V_TRIG_TYPE_VEH_PLAYER_EXIT = 23; +const V_TRIG_TYPE_VEH_NPC_ENTER = 24; +const V_TRIG_TYPE_VEH_NPC_EXIT = 25; +const V_TRIG_TYPE_VEH_COLLISION = 26; +const V_TRIG_TYPE_VEH_DAMAGED = 27; +const V_TRIG_TYPE_VEH_SHOT = 28; +const V_TRIG_TYPE_VEH_TRUNK_CHANGE = 29; +const V_TRIG_TYPE_VEH_ITEM_TAKEN = 30; +const V_TRIG_TYPE_VEH_ITEM_STORED = 31; +const V_TRIG_TYPE_VEH_ENGINE_CHANGE = 32; +const V_TRIG_TYPE_VEH_LIGHTS_CHANGE = 33; +const V_TRIG_TYPE_VEH_SIREN_CHANGE = 34; +const V_TRIG_TYPE_VEH_LOCK_CHANGE = 35; +const V_TRIG_TYPE_VEH_REPAIRED = 36; +const V_TRIG_TYPE_VEH_COLOUR_CHANGE = 37; +const V_TRIG_TYPE_VEH_EXTRA_CHANGE = 38; +const V_TRIG_TYPE_PLAYER_SHOUT = 39; +const V_TRIG_TYPE_PLAYER_TALK = 40; +const V_TRIG_TYPE_PLAYER_WHISPER = 41; // =========================================================================== // Need to plan this out -const AGRP_TRIG_COND_TYPE_NONE = 0; -const AGRP_TRIG_COND_TYPE_VEH_OCCUPANT = 1; -const AGRP_TRIG_COND_TYPE_VEH_DRIVER = 3; -const AGRP_TRIG_COND_TYPE_VEH_OWNER_TYPE = 2; -const AGRP_TRIG_COND_TYPE_VEH_OWNER_ID = 4; +const V_TRIG_COND_TYPE_NONE = 0; +const V_TRIG_COND_TYPE_VEH_OCCUPANT = 1; +const V_TRIG_COND_TYPE_VEH_DRIVER = 3; +const V_TRIG_COND_TYPE_VEH_OWNER_TYPE = 2; +const V_TRIG_COND_TYPE_VEH_OWNER_ID = 4; // =========================================================================== // Need to plan this out -const AGRP_TRIG_COND_MATCH_NONE = 0; -const AGRP_TRIG_COND_MATCH_EXACT_VALUE = 1; -const AGRP_TRIG_COND_MATCH_GREATER_THAN = 2; -const AGRP_TRIG_COND_MATCH_LESS_THAN = 2; -const AGRP_TRIG_COND_MATCH_NOT_EQUAL = 3; -const AGRP_TRIG_COND_MATCH_CLAN = 4; -const AGRP_TRIG_COND_MATCH_JOB = 5; -const AGRP_TRIG_COND_MATCH_BIZ = 6; -const AGRP_TRIG_COND_MATCH_HOUSE = 7; -const AGRP_TRIG_COND_MATCH_VEH = 8; -const AGRP_TRIG_COND_MATCH_NPC = 9; +const V_TRIG_COND_MATCH_NONE = 0; +const V_TRIG_COND_MATCH_EXACT_VALUE = 1; +const V_TRIG_COND_MATCH_GREATER_THAN = 2; +const V_TRIG_COND_MATCH_LESS_THAN = 2; +const V_TRIG_COND_MATCH_NOT_EQUAL = 3; +const V_TRIG_COND_MATCH_CLAN = 4; +const V_TRIG_COND_MATCH_JOB = 5; +const V_TRIG_COND_MATCH_BIZ = 6; +const V_TRIG_COND_MATCH_HOUSE = 7; +const V_TRIG_COND_MATCH_VEH = 8; +const V_TRIG_COND_MATCH_NPC = 9; // =========================================================================== -const AGRP_TRIG_RESP_TYPE_NONE = 0; -const AGRP_TRIG_RESP_SHOUT = 1; -const AGRP_TRIG_RESP_TALK = 2; -const AGRP_TRIG_RESP_WHISPER = 3; +const V_TRIG_RESP_TYPE_NONE = 0; +const V_TRIG_RESP_SHOUT = 1; +const V_TRIG_RESP_TALK = 2; +const V_TRIG_RESP_WHISPER = 3; // =========================================================================== let triggerTypes = { - BusinessOwnerChange: AGRP_TRIG_TYPE_BIZ_OWNER_CHANGE, - BusinessNameChange: AGRP_TRIG_TYPE_BIZ_NAME_CHANGE, - BusinessLockChange: AGRP_TRIG_TYPE_BIZ_LOCK_CHANGE, - BusinessPlayerEnter: AGRP_TRIG_TYPE_BIZ_PLAYER_ENTER, - BusinessPlayerExit: AGRP_TRIG_TYPE_BIZ_PLAYER_EXIT, - BusinessNPCEnter: AGRP_TRIG_TYPE_BIZ_NPC_ENTER, - BusinessNPCExit: AGRP_TRIG_TYPE_BIZ_NPC_EXIT, - BusinessDamage: AGRP_TRIG_TYPE_BIZ_DAMAGE, - BusinessRobbed: AGRP_TRIG_TYPE_BIZ_ROBBED, - BusinessPlayerPurchase: AGRP_TRIG_TYPE_BIZ_PLAYER_PURCHASE, - BusinessNPCPurchase: AGRP_TRIG_TYPE_BIZ_NPC_PURCHASE, - HouseOwnerChange: AGRP_TRIG_TYPE_HOUSE_OWNER_CHANGE, - HouseNameChange: AGRP_TRIG_TYPE_HOUSE_NAME_CHANGE, - HouseLockChange: AGRP_TRIG_TYPE_HOUSE_LOCK_CHANGE, - HousePlayerEnter: AGRP_TRIG_TYPE_HOUSE_PLAYER_ENTER, - HousePlayerExit: AGRP_TRIG_TYPE_HOUSE_PLAYER_EXIT, - HouseNPCEnter: AGRP_TRIG_TYPE_HOUSE_NPC_ENTER, - HouseNPCExit: AGRP_TRIG_TYPE_HOUSE_NPC_EXIT, - HouseDamage: AGRP_TRIG_TYPE_HOUSE_DAMAGE, - HouseRobbed: AGRP_TRIG_TYPE_HOUSE_ROBBED, - VehicleOwnerChange: AGRP_TRIG_TYPE_VEH_OWNER_CHANGE, - VehiclePlayerEnter: AGRP_TRIG_TYPE_VEH_PLAYER_ENTER, - VehiclePlayerExit: AGRP_TRIG_TYPE_VEH_PLAYER_EXIT, - VehicleNPCEnter: AGRP_TRIG_TYPE_VEH_NPC_ENTER, - VehicleNPCExit: AGRP_TRIG_TYPE_VEH_NPC_EXIT, - VehicleCollision: AGRP_TRIG_TYPE_VEH_COLLISION, - VehicleDamaged: AGRP_TRIG_TYPE_VEH_DAMAGED, - VehicleShot: AGRP_TRIG_TYPE_VEH_SHOT, - VehicleTrunkChange: AGRP_TRIG_TYPE_VEH_TRUNK_CHANGE, - VehicleItemTaken: AGRP_TRIG_TYPE_VEH_ITEM_TAKEN, - VehicleItemStored: AGRP_TRIG_TYPE_VEH_ITEM_STORED, - VehicleEngineChange: AGRP_TRIG_TYPE_VEH_ENGINE_CHANGE, - VehicleLightsChange: AGRP_TRIG_TYPE_VEH_LIGHTS_CHANGE, - VehicleSirenChange: AGRP_TRIG_TYPE_VEH_SIREN_CHANGE, - VehicleLockChange: AGRP_TRIG_TYPE_VEH_LOCK_CHANGE, - VehicleRepaired: AGRP_TRIG_TYPE_VEH_REPAIRED, - VehicleColourChange: AGRP_TRIG_TYPE_VEH_COLOUR_CHANGE, - VehicleExtraChange: AGRP_TRIG_TYPE_VEH_EXTRA_CHANGE, - PlayerShout: AGRP_TRIG_TYPE_PLAYER_SHOUT, - PlayerTalk: AGRP_TRIG_TYPE_PLAYER_TALK, - PlayerWhisper: AGRP_TRIG_TYPE_PLAYER_WHISPER, + BusinessOwnerChange: V_TRIG_TYPE_BIZ_OWNER_CHANGE, + BusinessNameChange: V_TRIG_TYPE_BIZ_NAME_CHANGE, + BusinessLockChange: V_TRIG_TYPE_BIZ_LOCK_CHANGE, + BusinessPlayerEnter: V_TRIG_TYPE_BIZ_PLAYER_ENTER, + BusinessPlayerExit: V_TRIG_TYPE_BIZ_PLAYER_EXIT, + BusinessNPCEnter: V_TRIG_TYPE_BIZ_NPC_ENTER, + BusinessNPCExit: V_TRIG_TYPE_BIZ_NPC_EXIT, + BusinessDamage: V_TRIG_TYPE_BIZ_DAMAGE, + BusinessRobbed: V_TRIG_TYPE_BIZ_ROBBED, + BusinessPlayerPurchase: V_TRIG_TYPE_BIZ_PLAYER_PURCHASE, + BusinessNPCPurchase: V_TRIG_TYPE_BIZ_NPC_PURCHASE, + HouseOwnerChange: V_TRIG_TYPE_HOUSE_OWNER_CHANGE, + HouseNameChange: V_TRIG_TYPE_HOUSE_NAME_CHANGE, + HouseLockChange: V_TRIG_TYPE_HOUSE_LOCK_CHANGE, + HousePlayerEnter: V_TRIG_TYPE_HOUSE_PLAYER_ENTER, + HousePlayerExit: V_TRIG_TYPE_HOUSE_PLAYER_EXIT, + HouseNPCEnter: V_TRIG_TYPE_HOUSE_NPC_ENTER, + HouseNPCExit: V_TRIG_TYPE_HOUSE_NPC_EXIT, + HouseDamage: V_TRIG_TYPE_HOUSE_DAMAGE, + HouseRobbed: V_TRIG_TYPE_HOUSE_ROBBED, + VehicleOwnerChange: V_TRIG_TYPE_VEH_OWNER_CHANGE, + VehiclePlayerEnter: V_TRIG_TYPE_VEH_PLAYER_ENTER, + VehiclePlayerExit: V_TRIG_TYPE_VEH_PLAYER_EXIT, + VehicleNPCEnter: V_TRIG_TYPE_VEH_NPC_ENTER, + VehicleNPCExit: V_TRIG_TYPE_VEH_NPC_EXIT, + VehicleCollision: V_TRIG_TYPE_VEH_COLLISION, + VehicleDamaged: V_TRIG_TYPE_VEH_DAMAGED, + VehicleShot: V_TRIG_TYPE_VEH_SHOT, + VehicleTrunkChange: V_TRIG_TYPE_VEH_TRUNK_CHANGE, + VehicleItemTaken: V_TRIG_TYPE_VEH_ITEM_TAKEN, + VehicleItemStored: V_TRIG_TYPE_VEH_ITEM_STORED, + VehicleEngineChange: V_TRIG_TYPE_VEH_ENGINE_CHANGE, + VehicleLightsChange: V_TRIG_TYPE_VEH_LIGHTS_CHANGE, + VehicleSirenChange: V_TRIG_TYPE_VEH_SIREN_CHANGE, + VehicleLockChange: V_TRIG_TYPE_VEH_LOCK_CHANGE, + VehicleRepaired: V_TRIG_TYPE_VEH_REPAIRED, + VehicleColourChange: V_TRIG_TYPE_VEH_COLOUR_CHANGE, + VehicleExtraChange: V_TRIG_TYPE_VEH_EXTRA_CHANGE, + PlayerShout: V_TRIG_TYPE_PLAYER_SHOUT, + PlayerTalk: V_TRIG_TYPE_PLAYER_TALK, + PlayerWhisper: V_TRIG_TYPE_PLAYER_WHISPER, }; // =========================================================================== @@ -138,7 +137,7 @@ let triggerTypes = { class TriggerData { constructor(dbAssoc) { this.databaseId = 0 - this.type = AGRP_TRIG_TYPE_NONE; + this.type = V_TRIG_TYPE_NONE; this.enabled = false; this.whoAdded = 0; this.whenAdded = 0; @@ -168,8 +167,8 @@ class TriggerConditionData { this.index = -1; this.triggerId = 0; this.triggerIndex = -1; - this.type = AGRP_TRIG_COND_TYPE_NONE; - this.matchType = AGRP_TRIG_COND_MATCH_NONE; + this.type = V_TRIG_COND_TYPE_NONE; + this.matchType = V_TRIG_COND_MATCH_NONE; this.enabled = false; this.whoAdded = 0; this.whenAdded = 0; @@ -199,7 +198,7 @@ class TriggerResponseData { this.triggerId = 0; this.triggerIndex = -1; this.priority = 0; - this.type = AGRP_TRIG_RESP_TYPE_NONE; + this.type = V_TRIG_RESP_TYPE_NONE; this.enabled = false; this.whoAdded = 0; this.whenAdded = 0; diff --git a/scripts/server/tutorial.js b/scripts/server/tutorial.js index 0a2e9a9c..d81f2294 100644 --- a/scripts/server/tutorial.js +++ b/scripts/server/tutorial.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: tutorial.js // DESC: Provides tutorial functions and features diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index df6f617a..f44434d9 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: utilities.js // DESC: Provides util functions and arrays with data @@ -88,7 +87,7 @@ function updateServerRules() { timeWeatherRule.push(tempText); } } else { - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { if (isNightTime(getServerConfig().hour)) { tempText = "Night"; } else { @@ -260,8 +259,8 @@ function checkPlayerPedStates() { if (getPlayerData(clients[i])) { if (getPlayerData(clients[i]).pedState) { if (isPlayerInAnyVehicle(clients[i])) { - if (getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_EXITINGVEHICLE) { - getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_READY; + if (getPlayerData(clients[i]).pedState == V_PEDSTATE_EXITINGVEHICLE) { + getPlayerData(clients[i]).pedState == V_PEDSTATE_READY; } } } @@ -441,7 +440,7 @@ function isClientInitialized(client) { // =========================================================================== function getPedForNetworkEvent(ped) { - //if (getGame() == AGRP_GAME_GTA_IV) { + //if (getGame() == V_GAME_GTA_IV) { // return ped; //} else { // return ped.id; @@ -525,15 +524,15 @@ function processPlayerEnteringExitingProperty(client) { } let pedState = getPlayerData(client).pedState; - if (pedState != AGRP_PEDSTATE_ENTERINGPROPERTY && pedState != AGRP_PEDSTATE_EXITINGPROPERTY) { + if (pedState != V_PEDSTATE_ENTERINGPROPERTY && pedState != V_PEDSTATE_EXITINGPROPERTY) { logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Utilities]: Aborting property enter/exit for player ${getPlayerDisplayForConsole(client)}. Ped state is not entering or exiting property.`); return false; } let propertyData = null; - if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_BUSINESS) { + if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_BUSINESS) { propertyData = getBusinessData(getPlayerData(client).enteringExitingProperty[1]); - } else if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_HOUSE) { + } else if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_HOUSE) { propertyData = getHouseData(getPlayerData(client).enteringExitingProperty[1]); } @@ -542,7 +541,7 @@ function processPlayerEnteringExitingProperty(client) { return false; } - if (pedState == AGRP_PEDSTATE_ENTERINGPROPERTY) { + if (pedState == V_PEDSTATE_ENTERINGPROPERTY) { logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property ENTER for player ${getPlayerDisplayForConsole(client)} ...`); if (isGameFeatureSupported("interiorScene") && propertyData.exitScene != "") { logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is entering a property with interior scene (${propertyData.exitScene})`); @@ -563,8 +562,8 @@ function processPlayerEnteringExitingProperty(client) { updateInteriorLightsForPlayer(client, propertyData.interiorLights); }, 1000); - if (getPlayerData(client).enteringExitingProperty[0] == AGRP_PROPERTY_TYPE_BUSINESS) { - if (propertyData.type == AGRP_BIZ_TYPE_PAINTBALL) { + if (getPlayerData(client).enteringExitingProperty[0] == V_PROPERTY_TYPE_BUSINESS) { + if (propertyData.type == V_BIZ_TYPE_PAINTBALL) { startPaintBall(client); } } @@ -579,8 +578,8 @@ function processPlayerEnteringExitingProperty(client) { getPlayerData(client).inProperty = [getPlayerData(client).enteringExitingProperty[0], getPlayerData(client).enteringExitingProperty[1]]; getPlayerData(client).enteringExitingProperty = null; - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; - } else if (pedState == AGRP_PEDSTATE_EXITINGPROPERTY) { + getPlayerData(client).pedState = V_PEDSTATE_READY; + } else if (pedState == V_PEDSTATE_EXITINGPROPERTY) { logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Processing property EXIT for player ${getPlayerDisplayForConsole(client)} from property ID ${propertyData.index}/${propertyData.databaseId} ...`); if (isGameFeatureSupported("interiorScene") && propertyData.entranceScene != "") { logToConsole(LOG_VERBOSE, `[AGRP.Utilities]: Player ${getPlayerDisplayForConsole(client)} is exiting a property with external interior scene (${propertyData.entranceScene})`); @@ -596,22 +595,22 @@ function processPlayerEnteringExitingProperty(client) { // Check if exiting property was into another house/business let inProperty = false; - let inPropertyType = AGRP_PROPERTY_TYPE_NONE; + let inPropertyType = V_PROPERTY_TYPE_NONE; let inBusiness = getPlayerBusiness(client); if (inBusiness != -1) { inProperty = getBusinessData(inBusiness); - inPropertyType = AGRP_PROPERTY_TYPE_BUSINESS; + inPropertyType = V_PROPERTY_TYPE_BUSINESS; } else { let inHouse = getPlayerHouse(client); if (inHouse != -1) { inProperty = getHouseData(inHouse); - inPropertyType = AGRP_PROPERTY_TYPE_HOUSE; + inPropertyType = V_PROPERTY_TYPE_HOUSE; } } setTimeout(function () { - if (getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { + if (getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) { if (isFadeCameraSupported()) { fadeCamera(client, true, 1.0); } @@ -635,7 +634,7 @@ function processPlayerEnteringExitingProperty(client) { getPlayerData(client).inProperty = [inPropertyType, inProperty.index]; getPlayerData(client).enteringExitingProperty = null; - getPlayerData(client).pedState = AGRP_PEDSTATE_READY; + getPlayerData(client).pedState = V_PEDSTATE_READY; } } diff --git a/scripts/server/vehicle.js b/scripts/server/vehicle.js index 99c034b2..14a261a4 100644 --- a/scripts/server/vehicle.js +++ b/scripts/server/vehicle.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: vehicle.js // DESC: Provides vehicle functions and usage @@ -9,13 +8,13 @@ // =========================================================================== // Vehicle Owner Types -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) +const V_VEHOWNER_NONE = 0; // Not owned +const V_VEHOWNER_PLAYER = 1; // Owned by a player (character/subaccount) +const V_VEHOWNER_JOB = 2; // Owned by a job +const V_VEHOWNER_CLAN = 3; // Owned by a clan +const V_VEHOWNER_FACTION = 4; // Owned by a faction (not used at the moment) +const V_VEHOWNER_PUBLIC = 5; // Public vehicle. Anybody can drive it. +const V_VEHOWNER_BIZ = 6; // Owned by a business (also includes dealerships since they're businesses) // =========================================================================== @@ -40,7 +39,7 @@ class VehicleData { this.syncHeading = 0.0; // Ownership - this.ownerType = AGRP_VEHOWNER_NONE; + this.ownerType = V_VEHOWNER_NONE; this.ownerId = 0; this.buyPrice = 0; this.rentPrice = 0; @@ -325,7 +324,7 @@ function spawnAllVehicles() { for (let i in getServerData().vehicles) { let vehicle = spawnVehicle(getServerData().vehicles[i]); getServerData().vehicles[i].vehicle = vehicle; - setEntityData(vehicle, "agrp.dataSlot", i, false); + setEntityData(vehicle, "v.rp.dataSlot", i, false); } setAllVehicleIndexes(); } @@ -338,7 +337,7 @@ function spawnAllVehicles() { */ function getVehicleData(vehicle) { if (isVehicleObject(vehicle)) { - let dataIndex = getEntityData(vehicle, "agrp.dataSlot"); + let dataIndex = getEntityData(vehicle, "v.rp.dataSlot"); if (typeof getServerData().vehicles[dataIndex] != "undefined") { return getServerData().vehicles[dataIndex]; } @@ -363,7 +362,7 @@ function createVehicleCommand(command, params, client) { } let heading = getPlayerHeading(client); - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { heading = degToRad(getPlayerHeading(client)); } @@ -503,7 +502,7 @@ function deleteVehicleCommand(command, params, client) { return false; } - let dataIndex = getEntityData(vehicle, "agrp.dataSlot"); + let dataIndex = getEntityData(vehicle, "v.rp.dataSlot"); let vehicleName = getVehicleName(vehicle); quickDatabaseQuery(`UPDATE veh_main SET veh_deleted = 1 WHERE veh_id = ${getVehicleData(vehicle).databaseId}`); @@ -541,7 +540,7 @@ function vehicleEngineCommand(command, params, client) { getVehicleData(vehicle).engine = !getVehicleData(vehicle).engine; vehicle.engine = getVehicleData(vehicle).engine; - setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true); + setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true); getVehicleData(vehicle).needsSaved = true; @@ -667,7 +666,7 @@ function vehicleAdminLiveryCommand(command, params, client) { getVehicleData(vehicle).livery = livery; getVehicleData(vehicle).needsSaved = true; - setEntityData(vehicle, "agrp.livery", livery, true); + setEntityData(vehicle, "v.rp.livery", livery, true); forcePlayerToSyncElementProperties(null, vehicle); //meActionToNearbyPlayers(client, `sets the ${getVehicleName(vehicle)}'s livery/paintjob'`); @@ -706,10 +705,10 @@ function buyVehicleCommand(command, params, client) { getPlayerData(client).buyingVehicle = vehicle; getVehicleData(vehicle).engine = true; vehicle.engine = true; - setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true); + setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true); getVehicleData(vehicle).needsSaved = true; - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle)); + setPlayerBuyingVehicleState(client, V_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); @@ -777,7 +776,7 @@ function rentVehicleCommand(command, params, client) { // =========================================================================== function enterVehicleAsPassengerCommand(command, params, client) { - sendNetworkEventToPlayer("agrp.passenger", client); + sendNetworkEventToPlayer("v.rp.passenger", client); } // =========================================================================== @@ -804,17 +803,17 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { return true; } - if (vehicleData.ownerType == AGRP_VEHOWNER_PUBLIC) { + if (vehicleData.ownerType == V_VEHOWNER_PUBLIC) { return true; } - if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) { + if (vehicleData.ownerType == V_VEHOWNER_PLAYER) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).databaseId) { return true; } } - if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) { + if (vehicleData.ownerType == V_VEHOWNER_CLAN) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) { if (vehicleData.clanRank <= getPlayerCurrentSubAccount(client).clanRank) { return true; @@ -822,7 +821,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { } } - if (vehicleData.ownerType == AGRP_VEHOWNER_FACTION) { + if (vehicleData.ownerType == V_VEHOWNER_FACTION) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).faction) { if (vehicleData.factionRank <= getPlayerCurrentSubAccount(client).factionRank) { return true; @@ -830,7 +829,7 @@ function doesPlayerHaveVehicleKeys(client, vehicle) { } } - if (vehicleData.ownerType == AGRP_VEHOWNER_JOB) { + if (vehicleData.ownerType == V_VEHOWNER_JOB) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).job) { return true; } @@ -854,13 +853,13 @@ function canPlayerManageVehicle(client, vehicle, exemptAdminFlag = false) { } } - if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) { + if (vehicleData.ownerType == V_VEHOWNER_PLAYER) { if (vehicleData.ownerId == getPlayerData(client).accountData.databaseId) { return true; } } - if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) { + if (vehicleData.ownerType == V_VEHOWNER_CLAN) { if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) { if (doesPlayerHaveClanPermission(client, "ManageVehicles")) { return true; @@ -868,7 +867,7 @@ function canPlayerManageVehicle(client, vehicle, exemptAdminFlag = false) { } } - if (vehicleData.ownerType == AGRP_VEHOWNER_BIZ) { + if (vehicleData.ownerType == V_VEHOWNER_BIZ) { if (canPlayerManageBusiness(client, getBusinessIdFromDatabaseId(vehicleData.ownerId), exemptAdminFlag)) { return true; } @@ -905,7 +904,7 @@ function setVehicleJobCommand(command, params, client) { // return false; //} - getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_JOB; + getVehicleData(vehicle).ownerType = V_VEHOWNER_JOB; getVehicleData(vehicle).ownerId = getJobData(jobId).databaseId; getVehicleData(vehicle).needsSaved = true; @@ -934,7 +933,7 @@ function setVehicleRankCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) { rankId = getClanRankFromParams(getVehicleData(vehicle).ownerId, params); if (!getClanRankData(getVehicleData(vehicle).ownerId, rankId)) { messagePlayerError(client, getLocaleString(client, "InvalidClanRank")); @@ -942,7 +941,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} minimum rank to {ALTCOLOUR}${getClanRankData(getVehicleData(vehicle).ownerId, rankId).name}{MAINCOLOUR} of the {clanOrange}${getClanData(getVehicleData(vehicle).ownerId).name}{MAINCOLOUR} clan!`, true); - } else if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { + } else if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) { getVehicleData(vehicle).rank = rankId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} minimum rank to {ALTCOLOUR}${rankId}{MAINCOLOUR} of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name}{MAINCOLOUR} job!`, true); } @@ -971,7 +970,7 @@ function setVehicleClanCommand(command, params, client) { return false; } - if (getVehicleData(vehicle).ownerType != AGRP_VEHOWNER_PLAYER) { + if (getVehicleData(vehicle).ownerType != V_VEHOWNER_PLAYER) { messagePlayerError(client, getLocaleString(client, "MustOwnVehicle")); return false; } @@ -982,7 +981,7 @@ function setVehicleClanCommand(command, params, client) { } showPlayerPrompt(client, getLocaleString(client, "SetVehicleClanConfirmMessage"), getLocaleString(client, "SetVehicleClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); - getPlayerData(client).promptType = AGRP_PROMPT_GIVEVEHTOCLAN; + getPlayerData(client).promptType = V_PROMPT_GIVEVEHTOCLAN; getVehicleData(vehicle).needsSaved = true; } @@ -1012,7 +1011,7 @@ function setVehicleBusinessCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_BIZ; + getVehicleData(vehicle).ownerType = V_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`, true); @@ -1041,7 +1040,7 @@ function setVehicleOwnerCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PLAYER; + getVehicleData(vehicle).ownerType = V_VEHOWNER_PLAYER; getVehicleData(vehicle).ownerId = getPlayerCurrentSubAccount(targetClient).databaseId; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} owner to {ALTCOLOUR}${getClientSubAccountName(targetClient)}`, true); @@ -1064,7 +1063,7 @@ function setVehiclePublicCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_PUBLIC; + getVehicleData(vehicle).ownerType = V_VEHOWNER_PUBLIC; getVehicleData(vehicle).ownerId = 0; messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} to a public vehicle!`, true); @@ -1153,7 +1152,7 @@ function removeVehicleOwnerCommand(command, params, client) { return false; } - getVehicleData(vehicle).ownerType = AGRP_VEHOWNER_NONE; + getVehicleData(vehicle).ownerType = V_VEHOWNER_NONE; getVehicleData(vehicle).ownerId = 0; getVehicleData(vehicle).needsSaved = true; @@ -1182,28 +1181,28 @@ function getVehicleInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (vehicleData.ownerType) { - case AGRP_VEHOWNER_CLAN: + case V_VEHOWNER_CLAN: ownerName = getClanData(getClanIndexFromDatabaseId(vehicleData.ownerId)).name; ownerType = "clan"; break; - case AGRP_VEHOWNER_JOB: + case V_VEHOWNER_JOB: ownerName = getJobData(getJobIdFromDatabaseId(vehicleData.ownerId)).name; ownerType = "job"; break; - case AGRP_VEHOWNER_PLAYER: + case V_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(vehicleData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case AGRP_VEHOWNER_BIZ: + case V_VEHOWNER_BIZ: ownerName = getBusinessData(getBusinessIdFromDatabaseId(vehicleData.ownerId)).name; ownerType = "business"; break; - case AGRP_VEHOWNER_PUBLIC: + case V_VEHOWNER_PUBLIC: ownerName = "Nobody"; ownerType = "public"; break; @@ -1259,28 +1258,28 @@ function getLastVehicleInfoCommand(command, params, client) { let ownerName = "Nobody"; let ownerType = "None"; switch (vehicleData.ownerType) { - case AGRP_VEHOWNER_CLAN: + case V_VEHOWNER_CLAN: ownerName = getClanData(vehicleData.ownerId).name; ownerType = "clan"; break; - case AGRP_VEHOWNER_JOB: + case V_VEHOWNER_JOB: ownerName = getJobData(vehicleData.ownerId).name; ownerType = "job"; break; - case AGRP_VEHOWNER_PLAYER: + case V_VEHOWNER_PLAYER: let subAccountData = loadSubAccountFromId(vehicleData.ownerId); ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerType = "player"; break; - case AGRP_VEHOWNER_BIZ: + case V_VEHOWNER_BIZ: ownerName = getBusinessData(vehicleData.ownerId).name; ownerType = "business"; break; - case AGRP_VEHOWNER_PUBLIC: + case V_VEHOWNER_PUBLIC: ownerName = "None"; ownerType = "public"; break; @@ -1391,7 +1390,7 @@ function respawnEmptyVehiclesCommand(command, params, client) { function respawnJobVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_JOB) { + if (getServerData().vehicles[i].ownerType == V_VEHOWNER_JOB) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1403,7 +1402,7 @@ function respawnJobVehiclesCommand(command, params, client) { function respawnClanVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_CLAN) { + if (getServerData().vehicles[i].ownerType == V_VEHOWNER_CLAN) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1415,7 +1414,7 @@ function respawnClanVehiclesCommand(command, params, client) { function respawnPlayerVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PLAYER) { + if (getServerData().vehicles[i].ownerType == V_VEHOWNER_PLAYER) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1427,7 +1426,7 @@ function respawnPlayerVehiclesCommand(command, params, client) { function respawnPublicVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_PUBLIC) { + if (getServerData().vehicles[i].ownerType == V_VEHOWNER_PUBLIC) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1439,7 +1438,7 @@ function respawnPublicVehiclesCommand(command, params, client) { function respawnBusinessVehiclesCommand(command, params, client) { for (let i in getServerData().vehicles) { - if (getServerData().vehicles[i].ownerType == AGRP_VEHOWNER_BIZ) { + if (getServerData().vehicles[i].ownerType == V_VEHOWNER_BIZ) { respawnVehicle(getServerData().vehicles[i].vehicle); } } @@ -1467,7 +1466,7 @@ function respawnVehicle(vehicle) { vehicles[i].engine = false; } - if (vehicles[i].ownerType == AGRP_VEHOWNER_JOB) { + if (vehicles[i].ownerType == V_VEHOWNER_JOB) { vehicles[i].locked = true; } @@ -1476,7 +1475,7 @@ function respawnVehicle(vehicle) { let newVehicle = spawnVehicle(vehicles[i]); vehicles[i].vehicle = newVehicle; - setEntityData(newVehicle, "agrp.dataSlot", i, false); + setEntityData(newVehicle, "v.rp.dataSlot", i, false); } } @@ -1527,12 +1526,12 @@ function spawnVehicle(vehicleData) { //setVehicleHealth(vehicle, 1000); repairVehicle(vehicle); - setEntityData(vehicle, "agrp.livery", vehicleData.livery, true); - setEntityData(vehicle, "agrp.upgrades", vehicleData.extras, true); - setEntityData(vehicle, "agrp.interior", vehicleData.interior, true); - setEntityData(vehicle, "agrp.engine", vehicleData.engine, true); + setEntityData(vehicle, "v.rp.livery", vehicleData.livery, true); + setEntityData(vehicle, "v.rp.upgrades", vehicleData.extras, true); + setEntityData(vehicle, "v.rp.interior", vehicleData.interior, true); + setEntityData(vehicle, "v.rp.engine", vehicleData.engine, true); - setEntityData(vehicle, "agrp.server", true, true); + setEntityData(vehicle, "v.rp.server", true, true); forcePlayerToSyncElementProperties(null, vehicle); setElementTransient(vehicle, false); @@ -1555,19 +1554,19 @@ function isVehicleAtPayAndSpray(vehicle) { function getVehicleOwnerTypeText(ownerType) { switch (ownerType) { - case AGRP_VEHOWNER_CLAN: + case V_VEHOWNER_CLAN: return "clan"; - case AGRP_VEHOWNER_JOB: + case V_VEHOWNER_JOB: return "job"; - case AGRP_VEHOWNER_PLAYER: + case V_VEHOWNER_PLAYER: return "player"; - case AGRP_VEHOWNER_BIZ: + case V_VEHOWNER_BIZ: return "business"; - case AGRP_VEHOWNER_PUBLIC: + case V_VEHOWNER_PUBLIC: return "public"; default: @@ -1578,7 +1577,7 @@ function getVehicleOwnerTypeText(ownerType) { // =========================================================================== function isVehicleOwnedByJob(vehicle, jobId) { - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) { return (getVehicleData(vehicle).ownerId == jobId); } return false; @@ -1612,14 +1611,14 @@ function createNewDealershipVehicle(modelIndex, spawnPosition, spawnRotation, pr tempVehicleData.spawnLocked = true; tempVehicleData.spawnPosition = spawnPosition; tempVehicleData.spawnRotation = spawnRotation; - tempVehicleData.ownerType = AGRP_VEHOWNER_BIZ; + tempVehicleData.ownerType = V_VEHOWNER_BIZ; tempVehicleData.ownerId = dealershipId; tempVehicleData.needsSaved = true; tempVehicleData.interior = interior; tempVehicleData.dimension = dimension; let slot = getServerData().vehicles.push(tempVehicleData); - setEntityData(vehicle, "agrp.dataSlot", slot - 1, false); + setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false); } // =========================================================================== @@ -1647,7 +1646,7 @@ function createTemporaryVehicle(modelIndex, position, heading, interior = 0, dim setAllVehicleIndexes(); if (areServerElementsSupported()) { - setEntityData(vehicle, "agrp.dataSlot", slot - 1, false); + setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false); } return vehicle; @@ -1677,7 +1676,7 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim setAllVehicleIndexes(); if (areServerElementsSupported()) { - setEntityData(vehicle, "agrp.dataSlot", slot - 1, false); + setEntityData(vehicle, "v.rp.dataSlot", slot - 1, false); } return vehicle; @@ -1702,22 +1701,22 @@ function processVehiclePurchasing() { function checkVehiclePurchasing(client) { if (!isPlayerLoggedIn(client)) { - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return false; } if (!isPlayerSpawned(client)) { - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return false; } if (!getPlayerData(client)) { - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return false; } if (!getPlayerData(client).buyingVehicle) { - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return false; } @@ -1727,7 +1726,7 @@ function checkVehiclePurchasing(client) { messagePlayerError(client, getLocaleString(client, "DealershipPurchaseExitedVehicle")); respawnVehicle(getPlayerData(client).buyingVehicle); getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); } return false; } @@ -1738,24 +1737,24 @@ function checkVehiclePurchasing(client) { messagePlayerError(client, getLocaleString(client, "VehiclePurchaseNotEnoughMoney")); respawnVehicle(getPlayerData(client).buyingVehicle); getPlayerData(client).buyingVehicle = false; - setPlayerBuyingVehicleState(client, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return false; } getServerData().purchasingVehicleCache.splice(getServerData().purchasingVehicleCache.indexOf(client), 1); - if (getVehicleData(getPlayerData(client).buyingVehicle).ownerType == AGRP_VEHOWNER_BIZ || getVehicleData(getPlayerData(client).buyingVehicle).ownerType == AGRP_VEHOWNER_NONE) { + if (getVehicleData(getPlayerData(client).buyingVehicle).ownerType == V_VEHOWNER_BIZ || getVehicleData(getPlayerData(client).buyingVehicle).ownerType == V_VEHOWNER_NONE) { createNewDealershipVehicle(getVehicleData(getPlayerData(client).buyingVehicle).model, getVehicleData(getPlayerData(client).buyingVehicle).spawnPosition, getVehicleData(getPlayerData(client).buyingVehicle).spawnRotation, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice, getVehicleData(getPlayerData(client).buyingVehicle).ownerId); } takePlayerCash(client, getVehicleData(getPlayerData(client).buyingVehicle).buyPrice); updatePlayerCash(client); getVehicleData(getPlayerData(client).buyingVehicle).ownerId = getPlayerCurrentSubAccount(client).databaseId; - getVehicleData(getPlayerData(client).buyingVehicle).ownerType = AGRP_VEHOWNER_PLAYER; + getVehicleData(getPlayerData(client).buyingVehicle).ownerType = V_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, AGRP_VEHBUYSTATE_NONE, null, null); + setPlayerBuyingVehicleState(client, V_VEHBUYSTATE_NONE, null, null); return true; } } @@ -1782,9 +1781,9 @@ function processVehicleBurning() { function cacheAllVehicleItems() { for (let i in getServerData().vehicles) { for (let j in getServerData().items) { - if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { + if (getItemData(j).ownerType == V_ITEM_OWNER_VEHTRUNK && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { getServerData().vehicles[i].trunkItemCache.push(j); - } else if (getItemData(j).ownerType == AGRP_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { + } else if (getItemData(j).ownerType == V_ITEM_OWNER_VEHDASH && getItemData(j).ownerId == getServerData().vehicles[i].databaseId) { getServerData().vehicles[i].dashItemCache.push(j); } } @@ -1815,16 +1814,16 @@ function setAllVehicleIndexes() { // =========================================================================== function doesVehicleHaveMegaphone(vehicle) { - if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_POLICE) { + if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_POLICE) { return true; } - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_FIRE) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_FIRE) { return true; } - if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == AGRP_JOB_MEDICAL) { + if (getJobType(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)) == V_JOB_MEDICAL) { return true; } } diff --git a/scripts/shared/const.js b/scripts/shared/const.js index 7efe2014..45c5c8e2 100644 --- a/scripts/shared/const.js +++ b/scripts/shared/const.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: const.js // DESC: Provides shared constants @@ -11,10 +10,10 @@ "use strict"; // Label Types -const AGRP_LABEL_JOB = 1; -const AGRP_LABEL_BUSINESS = 2; -const AGRP_LABEL_HOUSE = 3; -const AGRP_LABEL_EXIT = 4; +const V_LABEL_JOB = 1; +const V_LABEL_BUSINESS = 2; +const V_LABEL_HOUSE = 3; +const V_LABEL_EXIT = 4; // Log Levels const LOG_ALL = -1; @@ -26,121 +25,121 @@ const LOG_VERBOSE = 8; const LOG_DEBUG = 16; // Weapon Damage Event Types -const AGRP_WEAPON_DAMAGE_EVENT_NONE = 0; -const AGRP_WEAPON_DAMAGE_EVENT_NORMAL = 1; -const AGRP_WEAPON_DAMAGE_EVENT_TAZER = 2; -const AGRP_WEAPON_DAMAGE_EVENT_EXTINGUISH = 3; -const AGRP_WEAPON_DAMAGE_EVENT_MACE = 4; +const V_WEAPON_DAMAGE_EVENT_NONE = 0; +const V_WEAPON_DAMAGE_EVENT_NORMAL = 1; +const V_WEAPON_DAMAGE_EVENT_TAZER = 2; +const V_WEAPON_DAMAGE_EVENT_EXTINGUISH = 3; +const V_WEAPON_DAMAGE_EVENT_MACE = 4; // Games -const AGRP_GAME_GTA_III = 1; -const AGRP_GAME_GTA_VC = 2; -const AGRP_GAME_GTA_SA = 3; -const AGRP_GAME_GTA_IV = 5; -const AGRP_GAME_GTA_IV_EFLC = 6; -const AGRP_GAME_GTA_V = 50; -const AGRP_GAME_MAFIA_ONE = 10; -const AGRP_GAME_MAFIA_TWO = 11; -const AGRP_GAME_MAFIA_THREE = 12; -const AGRP_GAME_MAFIA_ONE_DE = 13; +const V_GAME_GTA_III = 1; +const V_GAME_GTA_VC = 2; +const V_GAME_GTA_SA = 3; +const V_GAME_GTA_IV = 5; +const V_GAME_GTA_IV_EFLC = 6; +const V_GAME_GTA_V = 50; +const V_GAME_MAFIA_ONE = 10; +const V_GAME_MAFIA_TWO = 11; +const V_GAME_MAFIA_THREE = 12; +const V_GAME_MAFIA_ONE_DE = 13; // Key States -const AGRP_KEYSTATE_NONE = 0; -const AGRP_KEYSTATE_UP = 1; -const AGRP_KEYSTATE_DOWN = 2; -const AGRP_KEYSTATE_HOLDSHORT = 3; -const AGRP_KEYSTATE_HOLDLONG = 4; -const AGRP_KEYSTATE_COMBO = 4; +const V_KEYSTATE_NONE = 0; +const V_KEYSTATE_UP = 1; +const V_KEYSTATE_DOWN = 2; +const V_KEYSTATE_HOLDSHORT = 3; +const V_KEYSTATE_HOLDLONG = 4; +const V_KEYSTATE_COMBO = 4; // Business Label Info Types -const AGRP_PROPLABEL_INFO_NONE = 0; -const AGRP_PROPLABEL_INFO_BUY = 1; -const AGRP_PROPLABEL_INFO_ENTER = 2; -const AGRP_PROPLABEL_INFO_ENTERVEHICLE = 3; -const AGRP_PROPLABEL_INFO_REFUEL = 4; -const AGRP_PROPLABEL_INFO_REPAIR = 5; -const AGRP_PROPLABEL_INFO_BUYHOUSE = 6; -const AGRP_PROPLABEL_INFO_RENTHOUSE = 7; -const AGRP_PROPLABEL_INFO_BUYBIZ = 8; +const V_PROPLABEL_INFO_NONE = 0; +const V_PROPLABEL_INFO_BUY = 1; +const V_PROPLABEL_INFO_ENTER = 2; +const V_PROPLABEL_INFO_ENTERVEHICLE = 3; +const V_PROPLABEL_INFO_REFUEL = 4; +const V_PROPLABEL_INFO_REPAIR = 5; +const V_PROPLABEL_INFO_BUYHOUSE = 6; +const V_PROPLABEL_INFO_RENTHOUSE = 7; +const V_PROPLABEL_INFO_BUYBIZ = 8; // Animation Types -const AGRP_ANIMTYPE_NONE = 0; -const AGRP_ANIMTYPE_NORMAL = 1; -const AGRP_ANIMTYPE_BLEND = 2; -const AGRP_ANIMTYPE_SHARED = 3; // Forces this animation to play in sync with another ped's mirrored anim (handshake, kiss, gang signs, etc) -const AGRP_ANIMTYPE_SPECIALACTION = 4; // This animtype uses a special action (only in SA) -const AGRP_ANIMTYPE_SURRENDER = 5; // This animtype is used to surrender (like handsup or cower) -const AGRP_ANIMTYPE_FORCED = 6; // This animtype is forced (can't use stopanim to get out of it) -const AGRP_ANIMTYPE_FREEZE = 7; // This animtype is forced (can't use stopanim to get out of it) +const V_ANIMTYPE_NONE = 0; +const V_ANIMTYPE_NORMAL = 1; +const V_ANIMTYPE_BLEND = 2; +const V_ANIMTYPE_SHARED = 3; // Forces this animation to play in sync with another ped's mirrored anim (handshake, kiss, gang signs, etc) +const V_ANIMTYPE_SPECIALACTION = 4; // This animtype uses a special action (only in SA) +const V_ANIMTYPE_SURRENDER = 5; // This animtype is used to surrender (like handsup or cower) +const V_ANIMTYPE_FORCED = 6; // This animtype is forced (can't use stopanim to get out of it) +const V_ANIMTYPE_FREEZE = 7; // This animtype is forced (can't use stopanim to get out of it) // Animation Move Types -const AGRP_ANIMMOVE_NONE = 0; -const AGRP_ANIMMOVE_FORWARD = 1; -const AGRP_ANIMMOVE_BACK = 2; -const AGRP_ANIMMOVE_LEFT = 3; -const AGRP_ANIMMOVE_RIGHT = 4; +const V_ANIMMOVE_NONE = 0; +const V_ANIMMOVE_FORWARD = 1; +const V_ANIMMOVE_BACK = 2; +const V_ANIMMOVE_LEFT = 3; +const V_ANIMMOVE_RIGHT = 4; // Multiplayer Modifications -const AGRP_MPMOD_NONE = 0; -const AGRP_MPMOD_GTAC = 1; -const AGRP_MPMOD_MAFIAC = 2; -const AGRP_MPMOD_OAKWOOD = 3; -const AGRP_MPMOD_RAGEMP = 4; +const V_MPMOD_NONE = 0; +const V_MPMOD_GTAC = 1; +const V_MPMOD_MAFIAC = 2; +const V_MPMOD_OAKWOOD = 3; +const V_MPMOD_RAGEMP = 4; // Business/House Game Script States -//const AGRP_GAMESCRIPT_NONE = 0; -//const AGRP_GAMESCRIPT_DENY = 1; -//const AGRP_GAMESCRIPT_ALLOW = 2; -//const AGRP_GAMESCRIPT_FORCE = 3; +//const V_GAMESCRIPT_NONE = 0; +//const V_GAMESCRIPT_DENY = 1; +//const V_GAMESCRIPT_ALLOW = 2; +//const V_GAMESCRIPT_FORCE = 3; // Vehicle Purchase States -const AGRP_VEHBUYSTATE_NONE = 0; -const AGRP_VEHBUYSTATE_TESTDRIVE = 1; -const AGRP_VEHBUYSTATE_EXITVEH = 2; -const AGRP_VEHBUYSTATE_FARENOUGH = 3; -const AGRP_VEHBUYSTATE_WRONGVEH = 4; +const V_VEHBUYSTATE_NONE = 0; +const V_VEHBUYSTATE_TESTDRIVE = 1; +const V_VEHBUYSTATE_EXITVEH = 2; +const V_VEHBUYSTATE_FARENOUGH = 3; +const V_VEHBUYSTATE_WRONGVEH = 4; // Islands -const AGRP_ISLAND_NONE = 0; // None -const AGRP_ISLAND_PORTLAND = 0; // Portland Island -const AGRP_ISLAND_STAUNTON = 1; // Staunton Island -const AGRP_ISLAND_SHORESIDEVALE = 2; // Shoreside Vale -const AGRP_ISLAND_VICEWEST = 0; // Western Island of VC -const AGRP_ISLAND_VICEEAST = 1; // Eastern Island of VC -const AGRP_ISLAND_LOSSANTOS = 0; // Los Santos -const AGRP_ISLAND_LASVENTURAS = 1; // Las Venturas -const AGRP_ISLAND_SANFIERRO = 2; // San Fierro -const AGRP_ISLAND_REDCOUNTYNORTH = 4; // Red County North (spans all the way from Palamino/shore on the east east to border of Flint County on the west) -const AGRP_ISLAND_BONECOUNTYNORTH = 5; // Bone County North (usually called Tierra Robada) -const AGRP_ISLAND_BONECOUNTYSOUTH = 6; // Bone County South +const V_ISLAND_NONE = 0; // None +const V_ISLAND_PORTLAND = 0; // Portland Island +const V_ISLAND_STAUNTON = 1; // Staunton Island +const V_ISLAND_SHORESIDEVALE = 2; // Shoreside Vale +const V_ISLAND_VICEWEST = 0; // Western Island of VC +const V_ISLAND_VICEEAST = 1; // Eastern Island of VC +const V_ISLAND_LOSSANTOS = 0; // Los Santos +const V_ISLAND_LASVENTURAS = 1; // Las Venturas +const V_ISLAND_SANFIERRO = 2; // San Fierro +const V_ISLAND_REDCOUNTYNORTH = 4; // Red County North (spans all the way from Palamino/shore on the east east to border of Flint County on the west) +const V_ISLAND_BONECOUNTYNORTH = 5; // Bone County North (usually called Tierra Robada) +const V_ISLAND_BONECOUNTYSOUTH = 6; // Bone County South // Body Parts for Skin Select (IV for now, but might do other games when I can add accessory objects) -const AGRP_SKINSELECT_NONE = 0; -const AGRP_SKINSELECT_SKIN = 1; -const AGRP_SKINSELECT_HAT = 2; -const AGRP_SKINSELECT_HAIR = 3; -const AGRP_SKINSELECT_EYES = 5; -const AGRP_SKINSELECT_UPPER = 6; -const AGRP_SKINSELECT_LOWER = 7; -const AGRP_SKINSELECT_SHOES = 8; -const AGRP_SKINSELECT_LEFTWRIST = 9; -const AGRP_SKINSELECT_RIGHTWRIST = 10; -const AGRP_SKINSELECT_LEFTHAND = 11; -const AGRP_SKINSELECT_RIGHTHAND = 12; -const AGRP_SKINSELECT_HEAD = 13; +const V_SKINSELECT_NONE = 0; +const V_SKINSELECT_SKIN = 1; +const V_SKINSELECT_HAT = 2; +const V_SKINSELECT_HAIR = 3; +const V_SKINSELECT_EYES = 5; +const V_SKINSELECT_UPPER = 6; +const V_SKINSELECT_LOWER = 7; +const V_SKINSELECT_SHOES = 8; +const V_SKINSELECT_LEFTWRIST = 9; +const V_SKINSELECT_RIGHTWRIST = 10; +const V_SKINSELECT_LEFTHAND = 11; +const V_SKINSELECT_RIGHTHAND = 12; +const V_SKINSELECT_HEAD = 13; // Action States for NPCs -const AGRP_NPC_ACTION_NONE = 0; -const AGRP_NPC_ACTION_ANIM = 1; -const AGRP_NPC_ACTION_WALKTO = 2; -const AGRP_NPC_ACTION_RUNTO = 3; -const AGRP_NPC_ACTION_SPRINTTO = 4; -const AGRP_NPC_ACTION_FOLLOW = 5; -const AGRP_NPC_ACTION_DEFEND = 6; -const AGRP_NPC_ACTION_GUARD_AREA = 7; +const V_NPC_ACTION_NONE = 0; +const V_NPC_ACTION_ANIM = 1; +const V_NPC_ACTION_WALKTO = 2; +const V_NPC_ACTION_RUNTO = 3; +const V_NPC_ACTION_SPRINTTO = 4; +const V_NPC_ACTION_FOLLOW = 5; +const V_NPC_ACTION_DEFEND = 6; +const V_NPC_ACTION_GUARD_AREA = 7; // Vehicle Seats -const AGRP_VEHSEAT_DRIVER = 0; -const AGRP_VEHSEAT_FRONTPASSENGER = 1; -const AGRP_VEHSEAT_REARLEFTPASSENGER = 2; -const AGRP_VEHSEAT_REARRIGHTPASSENGER = 3; \ No newline at end of file +const V_VEHSEAT_DRIVER = 0; +const V_VEHSEAT_FRONTPASSENGER = 1; +const V_VEHSEAT_REARLEFTPASSENGER = 2; +const V_VEHSEAT_REARRIGHTPASSENGER = 3; \ No newline at end of file diff --git a/scripts/shared/gamedata.js b/scripts/shared/gamedata.js index 87f48ca0..01433a42 100644 --- a/scripts/shared/gamedata.js +++ b/scripts/shared/gamedata.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: gamedata.js // DESC: Provides arrays of game data @@ -13,9 +12,9 @@ class AnimationData { this.name = name; this.groupId = (typeof data.groupId != "undefined") ? data.groupId : 0; this.animId = (typeof data.animId != "undefined") ? data.animId : 0; - this.animType = (typeof data.animType != "undefined") ? data.animType : AGRP_ANIMTYPE_NORMAL; + this.animType = (typeof data.animType != "undefined") ? data.animType : V_ANIMTYPE_NORMAL; this.animSpeed = (typeof data.animSpeed != "undefined") ? data.animSpeed : 0.0; - this.moveType = (typeof data.moveType != "undefined") ? data.moveType : AGRP_ANIMMOVE_NONE; + this.moveType = (typeof data.moveType != "undefined") ? data.moveType : V_ANIMMOVE_NONE; this.loop = (typeof data.moveType != "undefined") ? data.moveType : false; this.duration = (typeof data.duration != "undefined") ? data.duration : -1; @@ -42,286 +41,286 @@ class WeatherData { let supportedFeatures = { // Invalid, GTAIII, GTAVC, GTASA, Invalid, GTAIV, Invalid, Invalid, Invalid, M1, M2, M3, M1DE time: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, weather: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, serverElements: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: true, - [AGRP_GAME_MAFIA_THREE]: true + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: true, + [V_GAME_MAFIA_THREE]: true }, snow: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, customCamera: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, fadeCamera: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, pickup: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, sphere: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: false, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: false, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, worldLabel: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, blip: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, attachedBlip: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, fightStyle: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, walkStyle: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, marker: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, vehicleColour: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, object: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, interior: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, interiorScene: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: false, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false, + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: false, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false, }, pedScale: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: false, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: false, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, objectScale: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: false, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: false, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, pedArmour: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false }, rendering2D: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: true, - [AGRP_GAME_MAFIA_THREE]: true + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: true, + [V_GAME_MAFIA_THREE]: true }, customNametag: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, // World pos to screen native crashes game - [AGRP_GAME_GTA_IV_EFLC]: false, // World pos to screen native crashes game - [AGRP_GAME_MAFIA_ONE]: false, // Needs world pos to screen implemented - [AGRP_GAME_MAFIA_TWO]: false, // Needs world pos to screen implemented - [AGRP_GAME_MAFIA_THREE]: false, // Needs world pos to screen implemented + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, // World pos to screen native crashes game + [V_GAME_GTA_IV_EFLC]: false, // World pos to screen native crashes game + [V_GAME_MAFIA_ONE]: false, // Needs world pos to screen implemented + [V_GAME_MAFIA_TWO]: false, // Needs world pos to screen implemented + [V_GAME_MAFIA_THREE]: false, // Needs world pos to screen implemented }, dimension: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: true, - [AGRP_GAME_MAFIA_THREE]: true, + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: true, + [V_GAME_MAFIA_THREE]: true, }, dummyElement: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: false, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: true, - [AGRP_GAME_MAFIA_TWO]: true, - [AGRP_GAME_MAFIA_THREE]: true, + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: false, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: true, + [V_GAME_MAFIA_TWO]: true, + [V_GAME_MAFIA_THREE]: true, }, mouseCursor: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false, + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false, }, toggleCollision: { - [AGRP_GAME_GTA_III]: true, - [AGRP_GAME_GTA_VC]: true, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: false, - [AGRP_GAME_GTA_IV_EFLC]: false, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false, + [V_GAME_GTA_III]: true, + [V_GAME_GTA_VC]: true, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: false, + [V_GAME_GTA_IV_EFLC]: false, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false, }, vehicleUpgrades: { - [AGRP_GAME_GTA_III]: false, - [AGRP_GAME_GTA_VC]: false, - [AGRP_GAME_GTA_SA]: true, - [AGRP_GAME_GTA_IV]: true, - [AGRP_GAME_GTA_IV_EFLC]: true, - [AGRP_GAME_MAFIA_ONE]: false, - [AGRP_GAME_MAFIA_TWO]: false, - [AGRP_GAME_MAFIA_THREE]: false, + [V_GAME_GTA_III]: false, + [V_GAME_GTA_VC]: false, + [V_GAME_GTA_SA]: true, + [V_GAME_GTA_IV]: true, + [V_GAME_GTA_IV_EFLC]: true, + [V_GAME_MAFIA_ONE]: false, + [V_GAME_MAFIA_TWO]: false, + [V_GAME_MAFIA_THREE]: false, } }; @@ -329,16 +328,16 @@ let supportedFeatures = { // Connected MP mods only let extraContentResource = { - [AGRP_GAME_GTA_III]: "agrp-gta3", - [AGRP_GAME_GTA_VC]: "agrp-gtavc", - [AGRP_GAME_GTA_SA]: "agrp-gtasa", - [AGRP_GAME_GTA_IV]: "agrp-gtaiv", - [AGRP_GAME_GTA_IV_EFLC]: "agrp-gtaiv", - [AGRP_GAME_MAFIA_ONE]: "agrp-mafia1", - [AGRP_GAME_MAFIA_TWO]: "agrp-mafia2", - [AGRP_GAME_MAFIA_TWO]: "agrp-mafia3", - [AGRP_GAME_MAFIA_ONE_DE]: "agrp-mafia1de", - [AGRP_GAME_GTA_V]: "agrp-gtav", + [V_GAME_GTA_III]: "agrp-gta3", + [V_GAME_GTA_VC]: "agrp-gtavc", + [V_GAME_GTA_SA]: "agrp-gtasa", + [V_GAME_GTA_IV]: "agrp-gtaiv", + [V_GAME_GTA_IV_EFLC]: "agrp-gtaiv", + [V_GAME_MAFIA_ONE]: "agrp-mafia1", + [V_GAME_MAFIA_TWO]: "agrp-mafia2", + [V_GAME_MAFIA_TWO]: "agrp-mafia3", + [V_GAME_MAFIA_ONE_DE]: "agrp-mafia1de", + [V_GAME_GTA_V]: "agrp-gtav", }; // =========================================================================== @@ -348,7 +347,7 @@ let extraContentResource = { */ let gameData = { weaponNames: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III "Fist", "Bat", "Pistol", @@ -362,7 +361,7 @@ let gameData = { "Molotov", "Grenade" ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC "Fist", "Brass Knuckles", "Screwdriver", @@ -398,7 +397,7 @@ let gameData = { "M60", "Minigun" ], - [AGRP_GAME_GTA_SA]: [ // GTA San Andreas + [V_GAME_GTA_SA]: [ // GTA San Andreas "Fist", "Brass Knuckles", "Golf Club", @@ -450,7 +449,7 @@ let gameData = { "Jetpack", "Skateboard" ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV "Fist", "Bat", "Pool Cue", @@ -498,7 +497,7 @@ let gameData = { "EFLC Weapon 24", "Camera", ], - [AGRP_GAME_GTA_IV_EFLC]: [ // GTA IV (EFLC) + [V_GAME_GTA_IV_EFLC]: [ // GTA IV (EFLC) "Fist", "Bat", "Pool Cue", @@ -546,7 +545,7 @@ let gameData = { "EFLC Weapon 24", "Camera", ], - [AGRP_GAME_MAFIA_ONE]: { // Mafia 1 + [V_GAME_MAFIA_ONE]: { // Mafia 1 2: "Knuckle Duster", 3: "Knife", 4: "Baseball Bat", @@ -569,12 +568,12 @@ let gameData = { 31: "Sword", 32: "Dogs Head", }, - [AGRP_GAME_GTA_V]: { // GTA V + [V_GAME_GTA_V]: { // GTA V } }, weather: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III new WeatherData(0, "Clear", true), new WeatherData(1, "Overcast", false), new WeatherData(2, "Thunderstorm", false), @@ -586,7 +585,7 @@ let gameData = { new WeatherData(8, "Overcast/Cloudy", true), new WeatherData(9, "Grey/Cloudy", false), ], - [AGRP_GAME_GTA_VC]: [ // GTA Vice City + [V_GAME_GTA_VC]: [ // GTA Vice City new WeatherData(0, "Clear", true), new WeatherData(1, "Overcast", false), new WeatherData(2, "Thunderstorm", false), @@ -598,7 +597,7 @@ let gameData = { new WeatherData(8, "Overcast/Cloudy", true), new WeatherData(9, "Grey/Cloudy", false), ], - [AGRP_GAME_GTA_SA]: [ // GTA San Andreas + [V_GAME_GTA_SA]: [ // GTA San Andreas new WeatherData(0, "Blue Skies", false), new WeatherData(1, "Blue Skies", false), new WeatherData(2, "Blue Skies", false), @@ -621,7 +620,7 @@ let gameData = { new WeatherData(19, "Sandstorm", false), new WeatherData(20, "Greenish/Foggy", false), ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV new WeatherData(1, "Blue Skies", false), new WeatherData(2, "Extra Sunny", false), new WeatherData(3, "Sunny", false), @@ -634,7 +633,7 @@ let gameData = { new WeatherData(10, "Extra Sunny", false), new WeatherData(11, "Sunny/Windy", false), ], - [AGRP_GAME_GTA_IV_EFLC]: [ // GTA IV EFLC + [V_GAME_GTA_IV_EFLC]: [ // GTA IV EFLC new WeatherData(1, "Blue Skies", false), new WeatherData(2, "Extra Sunny", false), new WeatherData(3, "Sunny", false), @@ -647,21 +646,21 @@ let gameData = { new WeatherData(10, "Extra Sunny", false), new WeatherData(11, "Sunny/Windy", false), ], - [AGRP_GAME_GTA_V]: [ + [V_GAME_GTA_V]: [ ], }, gameNames: { - [AGRP_GAME_GTA_III]: "GTA III", - [AGRP_GAME_GTA_VC]: "GTA Vice City", - [AGRP_GAME_GTA_SA]: "GTA San Andreas", - [AGRP_GAME_GTA_IV]: "GTA IV", - [AGRP_GAME_GTA_IV_EFLC]: "GTA IV: Episodes from Liberty City", - [AGRP_GAME_MAFIA_ONE]: "Mafia: The City of Lost Heaven", - [AGRP_GAME_MAFIA_TWO]: "Mafia II", - [AGRP_GAME_MAFIA_THREE]: "Mafia III", - [AGRP_GAME_MAFIA_ONE_DE]: "Mafia Definitive Edition", - [AGRP_GAME_GTA_V]: "GTA V", + [V_GAME_GTA_III]: "GTA III", + [V_GAME_GTA_VC]: "GTA Vice City", + [V_GAME_GTA_SA]: "GTA San Andreas", + [V_GAME_GTA_IV]: "GTA IV", + [V_GAME_GTA_IV_EFLC]: "GTA IV: Episodes from Liberty City", + [V_GAME_MAFIA_ONE]: "Mafia: The City of Lost Heaven", + [V_GAME_MAFIA_TWO]: "Mafia II", + [V_GAME_MAFIA_THREE]: "Mafia III", + [V_GAME_MAFIA_ONE_DE]: "Mafia Definitive Edition", + [V_GAME_GTA_V]: "GTA V", }, vehicleWheelStateNames: [ "normal", @@ -687,7 +686,7 @@ let gameData = { "rear right" ], vehicleRadioStationNames: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III "Head Radio", "Double Cleff FM", "Jah Radio", @@ -697,7 +696,7 @@ let gameData = { "Chatterbox 109", "MP3 Player" ], - [AGRP_GAME_GTA_VC]: [ // GTA Vice City + [V_GAME_GTA_VC]: [ // GTA Vice City "Wildstyle", "Flash FM", "K CHAT", @@ -709,7 +708,7 @@ let gameData = { "Wave 103", "MP3 Player" ], - [AGRP_GAME_GTA_SA]: [ // GTA San Andreas + [V_GAME_GTA_SA]: [ // GTA San Andreas "K-ROSE", "K-DST", "Bounce FM", @@ -722,7 +721,7 @@ let gameData = { "WCTR", "User Track Player" ], - [AGRP_GAME_GTA_V]: [ // GTA San Andreas + [V_GAME_GTA_V]: [ // GTA San Andreas "K-ROSE", "K-DST", "Bounce FM", @@ -737,7 +736,7 @@ let gameData = { ], }, skins: { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ [0, "Claude", false], [1, "Police Officer", false], [2, "SWAT Officer", false], @@ -861,7 +860,7 @@ let gameData = { [125, "Busker 3", false], [125, "Busker 4", false], ], - [AGRP_GAME_GTA_VC]: [ + [V_GAME_GTA_VC]: [ [0, "Tommy Vercetti", false], [1, "Police Officer", false], [2, "SWAT Officer", false], @@ -1050,7 +1049,7 @@ let gameData = { [186, "Kent Paul", true], [187, "Big Head Taxi Driver", false], ], - [AGRP_GAME_GTA_SA]: [ + [V_GAME_GTA_SA]: [ [0, "Carl 'CJ' Johnson", false], [1, "The Truth", true], [2, "Maccer", true], @@ -1352,7 +1351,7 @@ let gameData = { [312, "Army Guy", true], [313, "Barry Big Bear Thorne (Fat)", true], ], - [AGRP_GAME_GTA_IV]: [ + [V_GAME_GTA_IV]: [ [-2020305438, "Male Multiplayer", false], [-641875910, "Female Multiplayer", false], [-1370810922, "MODEL_SUPERLOD", false], @@ -1699,7 +1698,7 @@ let gameData = { [-1139941790, "Tough Guy", true], [809067472, "Male Tourist", true] ], - [AGRP_GAME_MAFIA_ONE]: [ + [V_GAME_MAFIA_ONE]: [ ["Tommy.i3d", "Tommy Angelo", true], ["TommyBOXER.i3d", "Tommy Angelo", true], ["TommyCOAT.i3d", "Tommy Angelo", false], @@ -1997,7 +1996,7 @@ let gameData = { ["Sarah2LOW.i3d", "Sarah", true], ["Serv01.i3d", "Maid", true], ], - [AGRP_GAME_GTA_V]: [ + [V_GAME_GTA_V]: [ ["a_f_m_beach_01", 0x303638A7, true], ["a_f_m_bevhills_01", 0xBE086EFD, true], ["a_f_m_bevhills_02", 0xA039335F, true], @@ -2740,7 +2739,7 @@ let gameData = { ] }, vehicles: { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ [90, "Landstalker"], [91, "Idaho"], [92, "Stinger"], @@ -2803,7 +2802,7 @@ let gameData = { [149, "Toyz Van"], [150, "Ghost"], ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC [130, "Landstalker"], [131, "Idaho"], [132, "Stinger"], @@ -2912,7 +2911,7 @@ let gameData = { [235, "Bloodring Banger 2"], [236, "VCPD Cheetah"], ], - [AGRP_GAME_GTA_SA]: [ // GTA San Andreas + [V_GAME_GTA_SA]: [ // GTA San Andreas [400, "Landstalker"], [401, "Bravura"], [402, "Buffalo"], @@ -3126,7 +3125,7 @@ let gameData = { [610, "Farm Plow"], [611, "Utility Trailer"], ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV [1264341792, "Admiral"], [1560980623, "Airtug"], [1171614426, "Ambulance"], @@ -3255,7 +3254,7 @@ let gameData = { [800869680, "Subway"], [-1953988645, "El Train"], ], - [AGRP_GAME_MAFIA_ONE]: [ // Mafia 1 + [V_GAME_MAFIA_ONE]: [ // Mafia 1 ["fordtTud00.i3d", "Blue Bolt Ace Tudor"], ["fordtTud01.i3d", "Dark Blue Bolt Ace Tudor"], ["fordtTud02.i3d", "Brown Bolt Ace Tudor"], @@ -3408,7 +3407,7 @@ let gameData = { ["TruckBxx00.i3d", "Bolt Truck(Atlantic Import)"], ["truckBx00.i3d", "Bolt Truck"], ], - [AGRP_GAME_GTA_V]: [ + [V_GAME_GTA_V]: [ ["adder", 3078201489], ["airbus", 1283517198], ["airtug", 1560980623], @@ -4152,7 +4151,7 @@ let gameData = { ] }, objects: { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ [172, "BaseballBat"], [173, "Colt45"], [178, "Uzi"], @@ -4181,7 +4180,7 @@ let gameData = { [1349, "StraightRoadBarrier"] [1337, "YellowBarrel"], ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC [259, "BrassKnuckles"], [260, "Screwdriver"], [261, "GolfClub"], @@ -4229,7 +4228,7 @@ let gameData = { [597, "SodaBottle"], [502, "GenericPackage2"] ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA [331, "BrassKnuckles"], [333, "GolfClub"], [334, "Nitestick"], @@ -4286,27 +4285,27 @@ let gameData = { [1544, "BottleSoda"], [2601, "CanSoda"], ], - [AGRP_GAME_GTA_IV]: [ + [V_GAME_GTA_IV]: [ [0, "GenericPackage"], ], - [AGRP_GAME_GTA_V]: [ + [V_GAME_GTA_V]: [ [0, "GenericPackage"], ], - [AGRP_GAME_MAFIA_ONE]: [ + [V_GAME_MAFIA_ONE]: [ [0, "GenericPackage"], ], - [AGRP_GAME_MAFIA_TWO]: [ + [V_GAME_MAFIA_TWO]: [ [0, "GenericPackage"], ], - [AGRP_GAME_MAFIA_THREE]: [ + [V_GAME_MAFIA_THREE]: [ [0, "GenericPackage"], ], - [AGRP_GAME_MAFIA_ONE_DE]: [ + [V_GAME_MAFIA_ONE_DE]: [ [0, "GenericPackage"], ], }, weaponModels: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III 0, // Fist 172, // Baseball Bat 173, // Colt 45 @@ -4320,7 +4319,7 @@ let gameData = { 174, // Molotov Cocktail 170 // Grenade ], - [AGRP_GAME_GTA_VC]: [ // GTA Vice City + [V_GAME_GTA_VC]: [ // GTA Vice City 0, 259, 260, @@ -4359,12 +4358,12 @@ let gameData = { -1, 292 ], - [AGRP_GAME_GTA_V]: [ + [V_GAME_GTA_V]: [ ] }, locations: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III // Police Stations ["Portland Police Station", [1143.875, -675.1875, 14.97], 0.0, [1127.95, -666.06, 14.413]], ["Staunton Island Police Station", [340.25, -1123.375, 25.98], 0.0, null], @@ -4425,7 +4424,7 @@ let gameData = { ["Francis International Airport Terminal", [-765.94, -548.07, 11.33], 0.0, null], ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC // Police Stations ["Washington Beach Police Station", [399.77, -468.90, 11.73], 0.0, null], ["Vice Point Police Station", [508.96, 512.07, 12.10], 0.0, null], @@ -4477,7 +4476,7 @@ let gameData = { ["Ocean Beach Pay-n-spray", [-18.51, -1256.76, 10.463], -1.556, null], ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA // Police Stations ["Los Santos Police Department", [1545.53, -1675.64, 13.561], -1.575, null], ["San Fierro Police Department", [-1605.16, 720.79, 11.90], 0.0, null], @@ -4536,7 +4535,7 @@ let gameData = { ["Market Station", [814.26, -1345.38, 13.532], -1.624, null], ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV // Police Stations ["Broker Police Station", [894.99, -357.39, 18.185], 2.923, null], ["South Bohan Police Station", [435.40, 1592.29, 17.353], 3.087, null], @@ -4648,7 +4647,7 @@ let gameData = { // More will be added soon! ], - [AGRP_GAME_MAFIA_ONE]: [ + [V_GAME_MAFIA_ONE]: [ // Police Stations ["Central Island Police Headquarters", [-1257.78, -6.48, -753.12], 0.0, null], @@ -4679,7 +4678,7 @@ let gameData = { ], }, weaponSlots: { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ 0, 1, 2, @@ -4693,7 +4692,7 @@ let gameData = { 10, 11 ], - [AGRP_GAME_GTA_VC]: [ + [V_GAME_GTA_VC]: [ 0, 0, 1, @@ -4732,7 +4731,7 @@ let gameData = { -1, 9, ], - [AGRP_GAME_GTA_SA]: [ + [V_GAME_GTA_SA]: [ 0, 1, 1, @@ -4786,7 +4785,7 @@ let gameData = { ] }, fightStyles: { - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA ["Default", [4, 6]], ["Boxing", [5, 6]], ["Kung Fu", [6, 6]], @@ -4795,7 +4794,7 @@ let gameData = { ], }, walkStyles: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III "Man", "Ped", "Player", @@ -4826,7 +4825,7 @@ let gameData = { }, animations: { // [name, groupId, animId, animType, deltaTime, null, null, null, null, moveType], - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III new AnimationData("talk", { groupId: 0, animId: 11 }), new AnimationData("chat", { groupId: 0, animId: 11 }), @@ -4841,14 +4840,14 @@ let gameData = { new AnimationData("aimdown", { groupId: 0, animId: 160 }), new AnimationData("aimcrouch", { groupId: 0, animId: 165 }), new AnimationData("throw", { groupId: 0, animId: 166 }), - new AnimationData("handsup", { groupId: 0, animId: 167, animType: AGRP_ANIMTYPE_SURRENDER }), + new AnimationData("handsup", { groupId: 0, animId: 167, animType: V_ANIMTYPE_SURRENDER }), new AnimationData("sit", { groupId: 0, animId: 111 }), - new AnimationData("sitleft", { groupId: 0, animId: 111, moveType: AGRP_ANIMMOVE_LEFT }), - new AnimationData("sitback", { groupId: 0, animId: 111, moveType: AGRP_ANIMMOVE_BACK }), - new AnimationData("sitright", { groupId: 0, animId: 111, moveType: AGRP_ANIMMOVE_RIGHT }), - new AnimationData("sitforward", { groupId: 0, animId: 111, moveType: AGRP_ANIMMOVE_FORWARD }), - new AnimationData("sitarmright", { groupId: 0, animId: 120, moveType: AGRP_ANIMMOVE_BACK }), - new AnimationData("tazed", { groupId: 0, animId: 13, animType: AGRP_ANIMTYPE_FORCED }), + new AnimationData("sitleft", { groupId: 0, animId: 111, moveType: V_ANIMMOVE_LEFT }), + new AnimationData("sitback", { groupId: 0, animId: 111, moveType: V_ANIMMOVE_BACK }), + new AnimationData("sitright", { groupId: 0, animId: 111, moveType: V_ANIMMOVE_RIGHT }), + new AnimationData("sitforward", { groupId: 0, animId: 111, moveType: V_ANIMMOVE_FORWARD }), + new AnimationData("sitarmright", { groupId: 0, animId: 120, moveType: V_ANIMMOVE_BACK }), + new AnimationData("tazed", { groupId: 0, animId: 13, animType: V_ANIMTYPE_FORCED }), new AnimationData("walk", { groupId: 0, animId: 0 }), new AnimationData("jog", { groupId: 0, animId: 1 }), new AnimationData("tired", { groupId: 0, animId: 9 }), @@ -4864,13 +4863,13 @@ let gameData = { new AnimationData("roundhouse", { groupId: 0, animId: 75 }), new AnimationData("highkick", { groupId: 0, animId: 71 }), new AnimationData("phonetalk", { groupId: 0, animId: 172 }), - new AnimationData("handcuffed", { groupId: 0, animId: 8, animType: AGRP_ANIMTYPE_FORCED }), + new AnimationData("handcuffed", { groupId: 0, animId: 8, animType: V_ANIMTYPE_FORCED }), ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC new AnimationData("talk", { groupId: 0, animId: 11 }), new AnimationData("chat", { groupId: 0, animId: 11 }), new AnimationData("hailtaxi", { groupId: 0, animId: 12 }), - new AnimationData("handsup", { groupId: 0, animId: 161, animType: AGRP_ANIMTYPE_SURRENDER }), + new AnimationData("handsup", { groupId: 0, animId: 161, animType: V_ANIMTYPE_SURRENDER }), new AnimationData("flipoff", { groupId: 0, animId: 163 }), new AnimationData("phoneout", { groupId: 0, animId: 164 }), new AnimationData("phonein", { groupId: 0, animId: 165 }), @@ -4890,11 +4889,11 @@ let gameData = { new AnimationData("dance6", { groupId: 28, animId: 231, duration: 5000, loop: true }), new AnimationData("dance7", { groupId: 28, animId: 232, duration: 5000, loop: true }), new AnimationData("pressbutton", { groupId: 0, animId: 62 }), - new AnimationData("sitright", { groupId: 0, animId: 169, moveType: AGRP_ANIMMOVE_RIGHT }), - new AnimationData("sitleft", { groupId: 0, animId: 169, moveType: AGRP_ANIMMOVE_LEFT }), - new AnimationData("sitforward", { groupId: 0, animId: 169, moveType: AGRP_ANIMMOVE_FORWARD }), - new AnimationData("sitback", { groupId: 0, animId: 169, moveType: AGRP_ANIMMOVE_BACK }), - new AnimationData("tazed", { groupId: 0, animId: 13, animType: AGRP_ANIMTYPE_FORCED }), + new AnimationData("sitright", { groupId: 0, animId: 169, moveType: V_ANIMMOVE_RIGHT }), + new AnimationData("sitleft", { groupId: 0, animId: 169, moveType: V_ANIMMOVE_LEFT }), + new AnimationData("sitforward", { groupId: 0, animId: 169, moveType: V_ANIMMOVE_FORWARD }), + new AnimationData("sitback", { groupId: 0, animId: 169, moveType: V_ANIMMOVE_BACK }), + new AnimationData("tazed", { groupId: 0, animId: 13, animType: V_ANIMTYPE_FORCED }), new AnimationData("fightidle1", { groupId: 0, animId: 45 }), new AnimationData("highkick1", { groupId: 0, animId: 50 }), new AnimationData("kneekick", { groupId: 0, animId: 51 }), @@ -4917,13 +4916,13 @@ let gameData = { new AnimationData("pose", { groupId: 0, animId: 172 }), new AnimationData("holdrifle", { groupId: 0, animId: 10 }), new AnimationData("tired", { groupId: 0, animId: 9 }), - new AnimationData("handcuffed", { groupId: 0, animId: 9, animType: AGRP_ANIMTYPE_FORCED }), + new AnimationData("handcuffed", { groupId: 0, animId: 9, animType: V_ANIMTYPE_FORCED }), new AnimationData("walk", { groupId: 0, animId: 0 }), new AnimationData("jog", { groupId: 0, animId: 1 }), new AnimationData("headscratch", { groupId: 0, animId: 152 }), new AnimationData("lookaround", { groupId: 0, animId: 153 }), ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA new AnimationData("knockback", { groupId: 0, animId: 105 }), new AnimationData("idle1", { groupId: 0, animId: 135 }), new AnimationData("cower", { groupId: 0, animId: 141 }), @@ -4940,51 +4939,51 @@ let gameData = { new AnimationData("gestureyes", { groupId: 0, animId: 167 }), new AnimationData("wave2", { groupId: 0, animId: 168 }), new AnimationData("snort", { groupId: 0, animId: 169 }), - new AnimationData("sitright", { groupId: 0, animId: 150, moveType: AGRP_ANIMMOVE_RIGHT }), - new AnimationData("sitleft", { groupId: 0, animId: 150, moveType: AGRP_ANIMMOVE_LEFT }), - new AnimationData("sitforward", { groupId: 0, animId: 150, moveType: AGRP_ANIMMOVE_FORWARD }), - new AnimationData("sitback", { groupId: 0, animId: 150, moveType: AGRP_ANIMMOVE_BACK }), - new AnimationData("tazed", { groupId: 0, animId: 15, moveType: AGRP_ANIMTYPE_FORCED }), + new AnimationData("sitright", { groupId: 0, animId: 150, moveType: V_ANIMMOVE_RIGHT }), + new AnimationData("sitleft", { groupId: 0, animId: 150, moveType: V_ANIMMOVE_LEFT }), + new AnimationData("sitforward", { groupId: 0, animId: 150, moveType: V_ANIMMOVE_FORWARD }), + new AnimationData("sitback", { groupId: 0, animId: 150, moveType: V_ANIMMOVE_BACK }), + new AnimationData("tazed", { groupId: 0, animId: 15, moveType: V_ANIMTYPE_FORCED }), /* - ["talk", "PED", "IDLE_CHAT", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["fucku", "PED", "FUCKU", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["taichi", "PARK", "Tai_Chi_Loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["slapass", "SWEET", "sweet_ass_slap", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["wave", "ON_LOOKERS", "wave_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["vomit", "EAT_Vomit_P", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["cower", "ped", "cower", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["laugh", "RAPPING", "Laugh_01", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["plant", "BOMBER", "BOM_Plant", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["smoke1", "SMOKING","M_smklean_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["smoke2", "SMOKING","F_smklean_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["smoke3", "SMOKING","M_smkstnd_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["sit1", "ped","SEAT_idle", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["sit2", "BEACH", "ParkSit_M_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["sit3", "BEACH", "ParkSit_W_loop", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["sit4", "BEACH", "SitnWait_loop_W", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["scratch", "MISC","Scratchballs_01", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - ["standup", "ped", "SEAT_up", AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null], - //["faceshocked", 0, 150, AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null, AGRP_ANIMMOVE_NONE], - //["facesurprised", 0, 150, AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null, AGRP_ANIMMOVE_NONE], - //["faceconfused", 0, 150, AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null, AGRP_ANIMMOVE_NONE], - //["faceangry", 0, 159, AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null, AGRP_ANIMMOVE_NONE], - //["facetalk1", 0, 160, AGRP_ANIMTYPE_NORMAL, 0.0, null, null, null, null, AGRP_ANIMMOVE_NONE], + ["talk", "PED", "IDLE_CHAT", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["fucku", "PED", "FUCKU", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["taichi", "PARK", "Tai_Chi_Loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["slapass", "SWEET", "sweet_ass_slap", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["wave", "ON_LOOKERS", "wave_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["vomit", "EAT_Vomit_P", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["cower", "ped", "cower", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["laugh", "RAPPING", "Laugh_01", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["plant", "BOMBER", "BOM_Plant", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["smoke1", "SMOKING","M_smklean_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["smoke2", "SMOKING","F_smklean_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["smoke3", "SMOKING","M_smkstnd_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["sit1", "ped","SEAT_idle", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["sit2", "BEACH", "ParkSit_M_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["sit3", "BEACH", "ParkSit_W_loop", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["sit4", "BEACH", "SitnWait_loop_W", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["scratch", "MISC","Scratchballs_01", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + ["standup", "ped", "SEAT_up", V_ANIMTYPE_NORMAL, 0.0, null, null, null, null], + //["faceshocked", 0, 150, V_ANIMTYPE_NORMAL, 0.0, null, null, null, null, V_ANIMMOVE_NONE], + //["facesurprised", 0, 150, V_ANIMTYPE_NORMAL, 0.0, null, null, null, null, V_ANIMMOVE_NONE], + //["faceconfused", 0, 150, V_ANIMTYPE_NORMAL, 0.0, null, null, null, null, V_ANIMMOVE_NONE], + //["faceangry", 0, 159, V_ANIMTYPE_NORMAL, 0.0, null, null, null, null, V_ANIMMOVE_NONE], + //["facetalk1", 0, 160, V_ANIMTYPE_NORMAL, 0.0, null, null, null, null, V_ANIMMOVE_NONE], */ ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV new AnimationData("dance1", { groupId: "DAN_LOOP_A", animId: "DANCING", animSpeed: 16.0, infiniteLoop: true, infiniteLoopNoMovement: false, dontReturnToStartCoords: true, freezeLastFrame: false }), ], }, meleeWeapons: { - [AGRP_GAME_GTA_III]: [1], - [AGRP_GAME_GTA_VC]: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], - [AGRP_GAME_GTA_SA]: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], - [AGRP_GAME_GTA_IV]: [1, 2, 3], - [AGRP_GAME_GTA_IV_EFLC]: [1, 2, 3], + [V_GAME_GTA_III]: [1], + [V_GAME_GTA_VC]: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + [V_GAME_GTA_SA]: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], + [V_GAME_GTA_IV]: [1, 2, 3], + [V_GAME_GTA_IV_EFLC]: [1, 2, 3], }, blipSprites: { - [AGRP_GAME_GTA_III]: { // GTA III + [V_GAME_GTA_III]: { // GTA III PoliceStation: 8, FireStation: 9, Hospital: 12, @@ -5013,7 +5012,7 @@ let gameData = { Tony: 19, Job: 0, }, - [AGRP_GAME_GTA_VC]: { // GTA VC + [V_GAME_GTA_VC]: { // GTA VC PoliceStation: 0, FireStation: 0, Hospital: 0, @@ -5033,7 +5032,7 @@ let gameData = { Bar: 11, Job: 0, }, - [AGRP_GAME_GTA_SA]: { // GTA SA + [V_GAME_GTA_SA]: { // GTA SA PoliceStation: 30, FireStation: 20, Hospital: 22, @@ -5063,7 +5062,7 @@ let gameData = { Race: 53, Job: 56, }, - [AGRP_GAME_GTA_IV]: { // GTA IV + [V_GAME_GTA_IV]: { // GTA IV PoliceStation: 60, FireStation: 61, Hospital: 62, @@ -5103,7 +5102,7 @@ let gameData = { }, }, pickupModels: { - [AGRP_GAME_GTA_III]: { // GTA 3 + [V_GAME_GTA_III]: { // GTA 3 PoliceStation: 1361, FireStation: 1361, Hospital: 1361, @@ -5121,7 +5120,7 @@ let gameData = { Exit: 1361, Job: 1361, }, - [AGRP_GAME_GTA_VC]: { // GTA Vice City + [V_GAME_GTA_VC]: { // GTA Vice City PoliceStation: 375, FireStation: 406, Hospital: 366, @@ -5143,7 +5142,7 @@ let gameData = { KillFrenzy: 383, Pill: 367, }, - [AGRP_GAME_GTA_SA]: { // GTA San Andreas + [V_GAME_GTA_SA]: { // GTA San Andreas PoliceStation: 1247, FireStation: 1318, Hospital: 1240, @@ -5167,7 +5166,7 @@ let gameData = { RampageSkull: 1254, TwoPlayerRampage: 1313, }, - [AGRP_GAME_GTA_IV]: { // GTA IV + [V_GAME_GTA_IV]: { // GTA IV PoliceStation: -1, FireStation: -1, Hospital: -1, @@ -5187,7 +5186,7 @@ let gameData = { } }, pickupTypes: { - [AGRP_GAME_GTA_III]: { // GTA 3 + [V_GAME_GTA_III]: { // GTA 3 business: 255, house: 255, bank: 255, @@ -5195,7 +5194,7 @@ let gameData = { info: 255, job: 255, }, - [AGRP_GAME_GTA_VC]: { // GTA Vice City + [V_GAME_GTA_VC]: { // GTA Vice City business: 255, house: 255, bank: 255, @@ -5203,7 +5202,7 @@ let gameData = { info: 255, job: 255, }, - [AGRP_GAME_GTA_SA]: { // GTA San Andreas + [V_GAME_GTA_SA]: { // GTA San Andreas business: 1, house: 1, bank: 1, @@ -5211,7 +5210,7 @@ let gameData = { info: 1, job: 1, }, - [AGRP_GAME_GTA_IV]: { // GTA IV + [V_GAME_GTA_IV]: { // GTA IV business: -1, house: -1, bank: -1, @@ -5223,17 +5222,17 @@ let gameData = { // THIS IS SCREEN HEIGHT, NOT ACTUAL DOOR POSITION IN THE WORLD propertyLabelHeight: { - [AGRP_GAME_GTA_III]: 85, - [AGRP_GAME_GTA_VC]: 85, - [AGRP_GAME_GTA_SA]: 85, - [AGRP_GAME_GTA_IV]: 85, - [AGRP_GAME_GTA_IV_EFLC]: 85, - [AGRP_GAME_MAFIA_ONE]: 85, - [AGRP_GAME_MAFIA_TWO]: 85, - [AGRP_GAME_MAFIA_THREE]: 85, + [V_GAME_GTA_III]: 85, + [V_GAME_GTA_VC]: 85, + [V_GAME_GTA_SA]: 85, + [V_GAME_GTA_IV]: 85, + [V_GAME_GTA_IV_EFLC]: 85, + [V_GAME_MAFIA_ONE]: 85, + [V_GAME_MAFIA_TWO]: 85, + [V_GAME_MAFIA_THREE]: 85, }, defaultBusinessItems: { - [AGRP_GAME_GTA_III]: { // GTA III + [V_GAME_GTA_III]: { // GTA III ClothingStore: [ ["Outfit", 500, 2] ], @@ -5363,7 +5362,7 @@ let gameData = { ["Vehicle Secondary Colour Kit", 500, 2], ], }, - [AGRP_GAME_GTA_VC]: { // GTA VC + [V_GAME_GTA_VC]: { // GTA VC ClothingStore: [ ["Outfit", 500, 2] ], @@ -5505,7 +5504,7 @@ let gameData = { ["Vehicle Secondary Colour Kit", 500, 2], ], }, - [AGRP_GAME_GTA_SA]: { // GTA SA + [V_GAME_GTA_SA]: { // GTA SA ClothingStore: [ ["Outfit", 500, 2] ], @@ -5673,7 +5672,7 @@ let gameData = { ["Hydraulics", 500, 2], ], }, - [AGRP_GAME_GTA_IV]: { // GTA IV + [V_GAME_GTA_IV]: { // GTA IV ClothingStore: [ ["Outfit", 500, 2] ], @@ -5811,7 +5810,7 @@ let gameData = { ["Vehicle Secondary Colour Kit", 500, 2], ], }, - [AGRP_GAME_MAFIA_ONE]: { // Mafia 1 + [V_GAME_MAFIA_ONE]: { // Mafia 1 ClothingStore: [ ["Outfit", 500, 2] ], @@ -5948,7 +5947,7 @@ let gameData = { } }, interiors: { - [AGRP_GAME_GTA_III]: { + [V_GAME_GTA_III]: { Apartment1: [toVector3(891.87, -308.28, 8.72), 0, false, ""], JailCell: [toVector3(328.40, -1093.31, 25.98), 0, false, ""], Church: [toVector3(13.87, -1122.43, 26.12), 0, false, ""], @@ -5958,7 +5957,7 @@ let gameData = { Warehouse1: [toVector3(1497.46, -680.18, 12.14), 0, false, ""], Warehouse2: [toVector3(1131.44, -1113.07, 11.86), 0, false, ""], }, - [AGRP_GAME_GTA_VC]: { // GTA VC + [V_GAME_GTA_VC]: { // GTA VC Mall: [toVector3(379.62, 1007.00, 19.22), 4, false, ""], MalibuClub: [toVector3(489.83, -76.49, 11.48), 17, false, ""], PoliceStation: [toVector3(396.38, -472.96, 12.34), 12, false, ""], @@ -5981,7 +5980,7 @@ let gameData = { BusinessOfficeLobby: [toVector3(-573.64, 794.53, 22.88), 0, false, ""], }, - [AGRP_GAME_GTA_SA]: { // GTA SA + [V_GAME_GTA_SA]: { // GTA SA LSPD: [toVector3(247.113, 62.929, 1003.64), 2, false, ""], LVPD: [toVector3(288.82, 167.39, 1007.17), 3, false, ""], SFPD: [toVector3(246.40, 110.84, 1003.22), 10, false, ""], @@ -6081,7 +6080,7 @@ let gameData = { Courthouse: [toVector3(1219.51, -1792.69, 2431.34), 0, true, -1], }, - [AGRP_GAME_GTA_IV]: { // GTA IV + [V_GAME_GTA_IV]: { // GTA IV Office2: [toVector3(-1153.30, 417.37, 5.578), 0, false, ""], House1: [toVector3(-426.16, 1466.52, 38.971), 0, false, ""], House2: [toVector3(-969.77, 883.27, 18.817), 0, false, ""], @@ -6111,23 +6110,23 @@ let gameData = { Prison: [toVector3(-1082.69, -364.05, 7.404), 0, false, ""], Ship: [toVector3(-336.53, -1494.56, 9.945), 0, false, ""], }, - [AGRP_GAME_GTA_IV_EFLC]: { // GTA IV EFLC + [V_GAME_GTA_IV_EFLC]: { // GTA IV EFLC }, - [AGRP_GAME_MAFIA_ONE]: { // Mafia 1 + [V_GAME_MAFIA_ONE]: { // Mafia 1 SalieriBar: [toVector3(-336.53, -1494.56, 9.945), 0, false, "MISE02-SALIERY"], }, - [AGRP_GAME_MAFIA_TWO]: { // Mafia 2 + [V_GAME_MAFIA_TWO]: { // Mafia 2 }, - [AGRP_GAME_MAFIA_THREE]: { // Mafia 3 + [V_GAME_MAFIA_THREE]: { // Mafia 3 }, - [AGRP_GAME_MAFIA_ONE_DE]: { // Mafia 1 Definitive Edition + [V_GAME_MAFIA_ONE_DE]: { // Mafia 1 Definitive Edition }, }, skinChangePosition: { - [AGRP_GAME_GTA_SA]: [toVector3(258.14, -41.76, 1002.023), 1.322, 14], + [V_GAME_GTA_SA]: [toVector3(258.14, -41.76, 1002.023), 1.322, 14], }, policeStations: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(1143.875, -675.1875, 14.97), heading: 1.5, @@ -6147,7 +6146,7 @@ let gameData = { name: "Shoreside Vale", }, ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC { position: toVector3(399.77, -468.90, 11.73), heading: 0.0, @@ -6173,7 +6172,7 @@ let gameData = { name: "Little Havana", }, ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA { position: toVector3(1545.53, -1675.64, 13.561), heading: -1.575, @@ -6205,7 +6204,7 @@ let gameData = { name: "Dillimore", }, ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV { position: toVector3(894.99, -357.39, 18.185), @@ -6276,7 +6275,7 @@ let gameData = { ], }, fireStations: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(1103.70, -52.45, 7.49), heading: 1.5, @@ -6296,16 +6295,16 @@ let gameData = { name: "Shoreside Vale", }, ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA ], - AGRP_GAME_GTA_UG: [ // GTA UG + V_GAME_GTA_UG: [ // GTA UG ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV { position: toVector3(953.13, 95.90, 35.004), heading: 1.595, @@ -6339,7 +6338,7 @@ let gameData = { ], }, hospitals: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(1144.25, -596.875, 14.97), heading: 1.5, @@ -6359,7 +6358,7 @@ let gameData = { name: "Shoreside Vale", }, ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC { position: toVector3(-883.56, -469.39, 13.11), heading: -1.5, @@ -6385,7 +6384,7 @@ let gameData = { name: "Vice Point Hospital", }, ], - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA { position: toVector3(1172.96, -1323.42, 15.40), heading: 1.5, @@ -6417,7 +6416,7 @@ let gameData = { name: "Fort Carson Medical Center", }, ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV { position: toVector3(1199.59, 196.78, 33.554), heading: 1.633, @@ -6443,7 +6442,7 @@ let gameData = { name: "Acter Medical Center", }, ], - [AGRP_GAME_MAFIA_ONE]: [ + [V_GAME_MAFIA_ONE]: [ // Mafia 1 { position: toVector3(-763.32, 13.25, 761.18), @@ -6454,7 +6453,7 @@ let gameData = { ], }, payAndSprays: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(925.4, -360.3, 10.83), blip: false, @@ -6473,7 +6472,7 @@ let gameData = { ], }, ammunations: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(1068.3, -400.9, 15.24), blip: false, @@ -6487,7 +6486,7 @@ let gameData = { ], }, fuelStations: { - [AGRP_GAME_GTA_III]: [ // GTA 3 + [V_GAME_GTA_III]: [ // GTA 3 { position: toVector3(1161.9, -76.73, 7.27), blip: false, @@ -6496,28 +6495,28 @@ let gameData = { ], }, taxiModels: { - [AGRP_GAME_GTA_III]: [ // GTA III + [V_GAME_GTA_III]: [ // GTA III 110, 128, 148 ], - [AGRP_GAME_GTA_VC]: [ // GTA VC + [V_GAME_GTA_VC]: [ // GTA VC 150, 160, 216 ], - [AGRP_GAME_GTA_SA]: [// GTA SA + [V_GAME_GTA_SA]: [// GTA SA 420, 438 ], - [AGRP_GAME_GTA_IV]: [ // GTA IV + [V_GAME_GTA_IV]: [ // GTA IV -1932515764, -956048545, 1208856469 ], }, vehicleComponents: { - [AGRP_GAME_GTA_SA]: [ // GTA SA + [V_GAME_GTA_SA]: [ // GTA SA [1000, "Pro Spoiler"], [1001, "Win Spoiler"], [1002, "Drag Spoiler"], @@ -6713,7 +6712,7 @@ let gameData = { ] }, fishingLocations: { - [AGRP_GAME_GTA_SA]: [ // GTA San Andreas + [V_GAME_GTA_SA]: [ // GTA San Andreas toVector3(403.8266, -2088.7598, 7.8359), toVector3(398.7553, -2088.7490, 7.8359), toVector3(396.2197, -2088.6692, 7.8359), @@ -6727,40 +6726,40 @@ let gameData = { ], }, mainWorldDimension: { - [AGRP_GAME_GTA_III]: 0, // GTA 3 - [AGRP_GAME_GTA_VC]: 0, // GTA VC - [AGRP_GAME_GTA_SA]: 0, // GTA SA - [AGRP_GAME_GTA_IV]: 0, // GTA IV - [AGRP_GAME_GTA_IV_EFLC]: 0, // GTA IV EFLC - [AGRP_GAME_MAFIA_ONE]: 0, // Mafia 1 - [AGRP_GAME_MAFIA_TWO]: 0, // Mafia 2 - [AGRP_GAME_MAFIA_THREE]: 0, // Mafia 3 - [AGRP_GAME_MAFIA_ONE_DE]: 0, // Mafia Definitive Edition + [V_GAME_GTA_III]: 0, // GTA 3 + [V_GAME_GTA_VC]: 0, // GTA VC + [V_GAME_GTA_SA]: 0, // GTA SA + [V_GAME_GTA_IV]: 0, // GTA IV + [V_GAME_GTA_IV_EFLC]: 0, // GTA IV EFLC + [V_GAME_MAFIA_ONE]: 0, // Mafia 1 + [V_GAME_MAFIA_TWO]: 0, // Mafia 2 + [V_GAME_MAFIA_THREE]: 0, // Mafia 3 + [V_GAME_MAFIA_ONE_DE]: 0, // Mafia Definitive Edition }, mainWorldInterior: { - [AGRP_GAME_GTA_III]: 0, // GTA 3 - [AGRP_GAME_GTA_VC]: 0, // GTA VC - [AGRP_GAME_GTA_SA]: 0, // GTA SA - [AGRP_GAME_GTA_IV]: 0, // GTA IV - [AGRP_GAME_GTA_IV_EFLC]: 0, // GTA IV EFLC - [AGRP_GAME_MAFIA_ONE]: 0, // Mafia 1 - [AGRP_GAME_MAFIA_TWO]: 0, // Mafia 2 - [AGRP_GAME_MAFIA_THREE]: 0, // Mafia 3 - [AGRP_GAME_MAFIA_ONE_DE]: 0, // Mafia Definitive Edition + [V_GAME_GTA_III]: 0, // GTA 3 + [V_GAME_GTA_VC]: 0, // GTA VC + [V_GAME_GTA_SA]: 0, // GTA SA + [V_GAME_GTA_IV]: 0, // GTA IV + [V_GAME_GTA_IV_EFLC]: 0, // GTA IV EFLC + [V_GAME_MAFIA_ONE]: 0, // Mafia 1 + [V_GAME_MAFIA_TWO]: 0, // Mafia 2 + [V_GAME_MAFIA_THREE]: 0, // Mafia 3 + [V_GAME_MAFIA_ONE_DE]: 0, // Mafia Definitive Edition }, mainWorldScene: { - [AGRP_GAME_GTA_III]: "", // GTA 3 - [AGRP_GAME_GTA_VC]: "", // GTA VC - [AGRP_GAME_GTA_SA]: "", // GTA SA - [AGRP_GAME_GTA_IV]: "", // GTA IV - [AGRP_GAME_GTA_IV_EFLC]: "", // GTA IV EFLC - [AGRP_GAME_MAFIA_ONE]: "FREERIDE", // Mafia 1 - [AGRP_GAME_MAFIA_TWO]: "", // Mafia 2 - [AGRP_GAME_MAFIA_THREE]: "", // Mafia 3 - [AGRP_GAME_MAFIA_ONE_DE]: "", // Mafia Definitive Edition + [V_GAME_GTA_III]: "", // GTA 3 + [V_GAME_GTA_VC]: "", // GTA VC + [V_GAME_GTA_SA]: "", // GTA SA + [V_GAME_GTA_IV]: "", // GTA IV + [V_GAME_GTA_IV_EFLC]: "", // GTA IV EFLC + [V_GAME_MAFIA_ONE]: "FREERIDE", // Mafia 1 + [V_GAME_MAFIA_TWO]: "", // Mafia 2 + [V_GAME_MAFIA_THREE]: "", // Mafia 3 + [V_GAME_MAFIA_ONE_DE]: "", // Mafia Definitive Edition }, properties: { - [AGRP_GAME_GTA_VC]: { + [V_GAME_GTA_VC]: { ApartmentBuilding1: { businesses: [ ["Manager's Office", 0, 0, toVector3(217.12, -1271.71, 12.09), toVector3(115.48, -823.76, 10.463), 6, null], @@ -6793,7 +6792,7 @@ let gameData = { } }, particleEffects: { - [AGRP_GAME_GTA_III]: { + [V_GAME_GTA_III]: { RisingSteamSmall: 0, RisingSmokeSmall: 4, TallSprayingWater: 5, @@ -6816,7 +6815,7 @@ let gameData = { } }, areas: { - [AGRP_GAME_GTA_III]: [ + [V_GAME_GTA_III]: [ ["Callahan Bridge", 1, [[617.442, -958.347, 6.26083], [1065.44, -908.347, 206.261]], 1], ["Callahan Point", 0, [[751.68, -1178.22, -13.8723], [1065.68, -958.725, 136.128]], 1], ["Fish Factory", 2, [[944.208, -1149.81, -9.72576], [1016.14, -1076.01, 40.2742]], 1], @@ -6861,7 +6860,7 @@ let gameData = { ] }, seats: { - [AGRP_GAME_GTA_VC]: [ + [V_GAME_GTA_VC]: [ //new SeatData(new Vec3(480.47, -53.20, 11.48), -1.76, "sit1", 17), //new SeatData(new Vec3(480.84, -53.44, 11.48), -1.22, "sit1", 17), //new SeatData(new Vec3(480.94, -49.96, 11.48), -1.38, "sit1", 17), diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index 2d079229..a3426f77 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -1,7 +1,6 @@ // =========================================================================== -// Asshat Gaming Roleplay -// https://github.com/VortrexFTW/agrp_main -// (c) 2022 Asshat Gaming +// Vortrex's Roleplay Resource +// https://github.com/VortrexFTW/v-roleplay // =========================================================================== // FILE: utilities.js // DESC: Provides shared utilities @@ -1670,7 +1669,7 @@ function getPercentage(num, per) { // =========================================================================== function getMultiplayerMod() { - return (getGame() >= 10) ? AGRP_MPMOD_MAFIAC : AGRP_MPMOD_GTAC; + return (getGame() >= 10) ? V_MPMOD_MAFIAC : V_MPMOD_GTAC; } // =========================================================================== @@ -1682,7 +1681,7 @@ function isSnowSupported(gameId) { // =========================================================================== function isGTAIV() { - return (getGame() == AGRP_GAME_GTA_IV); + return (getGame() == V_GAME_GTA_IV); } // =========================================================================== @@ -2038,7 +2037,7 @@ function getPosInFrontOfPos(pos, angle, distance) { let y = pos.y; let z = pos.z; - if (getGame() != AGRP_GAME_MAFIA_ONE) { + if (getGame() != V_GAME_MAFIA_ONE) { x = (pos.x + ((Math.cos(angle + (Math.PI / 2))) * distance)); y = (pos.y + ((Math.sin(angle + (Math.PI / 2))) * distance)); } else { @@ -2062,7 +2061,7 @@ function getPosBehindPos(pos, angle, distance) { let y = pos.y; let z = pos.z; - if (getGame() < AGRP_GAME_MAFIA_ONE) { + if (getGame() < V_GAME_MAFIA_ONE) { y = (pos.y + ((Math.sin(angle - (Math.PI / 2))) * distance)); } else { angle = radToDeg(angle); @@ -2077,7 +2076,7 @@ function getPosBehindPos(pos, angle, distance) { // =========================================================================== function getPosAbovePos(pos, distance) { - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { return toVector3(pos.x, pos.y + distance, pos.z); } return toVector3(pos.x, pos.y, pos.z + distance); @@ -2086,7 +2085,7 @@ function getPosAbovePos(pos, distance) { // =========================================================================== function getPosBelowPos(pos, distance) { - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { return toVector3(pos.x, pos.y - distance, pos.z); } return toVector3(pos.x, pos.y, pos.z - distance); @@ -2579,7 +2578,7 @@ function ArrayBufferToString(buffer) { // =========================================================================== function getElementTypeName(typeId) { - if (getGame() == AGRP_GAME_MAFIA_ONE) { + if (getGame() == V_GAME_MAFIA_ONE) { switch (typeId) { case ELEMENT_VEHICLE: return "Vehicle"; @@ -3192,7 +3191,7 @@ function fillLeadingZeros(number, length) { // =========================================================================== function isMainWorldScene(sceneName) { - return (sceneName == "agrp.mainWorldScene"); + return (sceneName == "v.rp.mainWorldScene"); } // =========================================================================== diff --git a/third-party/mexui/mexui.js b/third-party/mexui/mexui.js index 0c4e7f95..56402a53 100644 --- a/third-party/mexui/mexui.js +++ b/third-party/mexui/mexui.js @@ -65,7 +65,7 @@ mexui.bindEvents = function () { }); { - var eventName = (game.game == AGRP_GAME_GTA_SA || game.game == AGRP_GAME_MAFIA_ONE) ? 'onDrawnHUD' : 'onBeforeDrawHUD'; + var eventName = (game.game == V_GAME_GTA_SA || game.game == V_GAME_MAFIA_ONE) ? 'onDrawnHUD' : 'onBeforeDrawHUD'; addEventHandler(eventName, function (event) { mexui.render(); });