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