Change copyright, consts, and net events prefix

This commit is contained in:
Vortrex
2022-12-19 10:11:10 -06:00
parent df0bf2fdd7
commit bd29a9f7d5
127 changed files with 2745 additions and 2871 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}
// ===========================================================================

View File

@@ -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 {

View File

@@ -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");
}
}

View File

@@ -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]);
}
// ===========================================================================

View File

@@ -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);
}
*/

View File

@@ -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]);
}
// ===========================================================================

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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());
}
// ===========================================================================

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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],
);

View File

@@ -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]);
}
// ===========================================================================

View File

@@ -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]);
}
// ===========================================================================

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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);
}
// ===========================================================================

View File

@@ -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));
}

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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) {
}
}

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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);
// }
//}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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"),
];
// ===========================================================================

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);
}
// ===========================================================================

View File

@@ -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));

View File

@@ -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);

View File

@@ -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);
}
// ===========================================================================

View File

@@ -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)
// ===========================================================================

View File

@@ -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;
}

View File

@@ -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");

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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
// ===========================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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;
}

Some files were not shown because too many files have changed in this diff Show More