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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: afk.js // FILE: afk.js
// DESC: Provides AFK detection // DESC: Provides AFK detection

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: animation.js // FILE: animation.js
// DESC: Provides animation functions and usage // DESC: Provides animation functions and usage
@@ -27,7 +26,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
let freezePlayer = false; let freezePlayer = false;
switch (animationData.moveType) { switch (animationData.moveType) {
case AGRP_ANIMMOVE_FORWARD: { case V_ANIMMOVE_FORWARD: {
setElementCollisionsEnabled(ped, false); setElementCollisionsEnabled(ped, false);
if (ped.isSyncer) { if (ped.isSyncer) {
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -36,7 +35,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case AGRP_ANIMMOVE_BACK: { case V_ANIMMOVE_BACK: {
setElementCollisionsEnabled(pedId, false); setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) { if (ped.isSyncer) {
setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -45,7 +44,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case AGRP_ANIMMOVE_LEFT: { case V_ANIMMOVE_LEFT: {
setElementCollisionsEnabled(pedId, false); setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) { if (ped.isSyncer) {
setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -54,7 +53,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case AGRP_ANIMMOVE_RIGHT: { case V_ANIMMOVE_RIGHT: {
setElementCollisionsEnabled(pedId, false); setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) { if (ped.isSyncer) {
setElementPosition(pedId, getPosToRightOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset)); 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 (getGame() < V_GAME_GTA_IV) {
if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) { if (animationData.animType == V_ANIMTYPE_NORMAL || animationData.animType == V_ANIMTYPE_SURRENDER) {
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_VC || getGame() == V_GAME_GTA_SA) {
ped.clearAnimations(); ped.clearAnimations();
} else { } else {
ped.clearObjective(); ped.clearObjective();
@@ -82,7 +81,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
setLocalPlayerControlState(false, false); setLocalPlayerControlState(false, false);
localPlayer.collisionsEnabled = false; localPlayer.collisionsEnabled = false;
} }
} else if (animationData.animType == AGRP_ANIMTYPE_BLEND) { } else if (animationData.animType == V_ANIMTYPE_BLEND) {
ped.position = ped.position; ped.position = ped.position;
ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed); ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
} }
@@ -103,7 +102,7 @@ function forcePedAnimation(pedId, animSlot) {
let animationData = getAnimationData(animSlot); let animationData = getAnimationData(animSlot);
if (getGame() < AGRP_GAME_GTA_IV) { if (getGame() < V_GAME_GTA_IV) {
ped.position = ped.position; ped.position = ped.position;
ped.addAnimation(animationData.groupId, animationData.animId); ped.addAnimation(animationData.groupId, animationData.animId);
@@ -127,8 +126,8 @@ function makePedStopAnimation(pedId) {
return false; return false;
} }
if (getGame() != AGRP_GAME_GTA_IV) { if (getGame() != V_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_VC || getGame() == V_GAME_GTA_SA) {
ped.clearAnimations(); ped.clearAnimations();
} else { } else {
ped.clearObjective(); ped.clearObjective();
@@ -136,7 +135,7 @@ function makePedStopAnimation(pedId) {
} }
if (ped == localPlayer) { if (ped == localPlayer) {
if (getGame() != AGRP_GAME_GTA_IV) { if (getGame() != V_GAME_GTA_IV) {
localPlayer.collisionsEnabled = true; localPlayer.collisionsEnabled = true;
} }
setLocalPlayerControlState(true, false); setLocalPlayerControlState(true, false);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: business.js // FILE: business.js
// DESC: Provides business functions and usage // 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) { function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems, entranceFee) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`); 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) { if (getBusinessData(businessId) != false) {
let businessData = getBusinessData(businessId); let businessData = getBusinessData(businessId);
businessData.name = name; businessData.name = name;
@@ -54,12 +53,12 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
businessData.entranceFee = entranceFee; businessData.entranceFee = entranceFee;
if (hasInterior && !hasItems) { if (hasInterior && !hasItems) {
businessData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER; businessData.labelInfoType = V_PROPLABEL_INFO_ENTER;
} else if (!hasInterior && hasItems) { } else if (!hasInterior && hasItems) {
businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUY; businessData.labelInfoType = V_PROPLABEL_INFO_BUY;
} else { } else {
if (businessData.buyPrice > 0) { 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 (blipModel == -1) {
if (businessData.blipId != -1) { if (businessData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been removed by the server`); 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); natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -81,7 +80,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
} else { } else {
if (businessData.blipId != -1) { if (businessData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been changed by the server`); 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.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
natives.changeBlipSprite(businessData.blipId, businessData.blipModel); natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
natives.setBlipMarkerLongDistance(businessData.blipId, false); natives.setBlipMarkerLongDistance(businessData.blipId, false);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: camera.js // FILE: camera.js
// DESC: Provides camera functions and usage // DESC: Provides camera functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: chatbox.js // FILE: chatbox.js
// DESC: Provides extra chatbox features // DESC: Provides extra chatbox features

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: content.js // FILE: content.js
// DESC: Provides connection to extra content resources // DESC: Provides connection to extra content resources

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: main.js // FILE: main.js
// DESC: Main client script (will be reorganized into individual files later) // DESC: Main client script (will be reorganized into individual files later)
@@ -65,7 +64,7 @@ let mouseCursorEnabled = false;
let currentPickup = false; let currentPickup = false;
let vehiclePurchaseState = AGRP_VEHBUYSTATE_NONE; let vehiclePurchaseState = V_VEHBUYSTATE_NONE;
let vehiclePurchasing = null; let vehiclePurchasing = null;
let vehiclePurchasePosition = null; let vehiclePurchasePosition = null;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: cursor.js // FILE: cursor.js
// DESC: Provides cursor functions and usage // DESC: Provides cursor functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: economy.js // FILE: economy.js
// DESC: Provides economy functions // DESC: Provides economy functions

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: event.js // FILE: event.js
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events // 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); addEventHandler("OnMapLoaded", onMapLoaded);
} }
} }
@@ -166,7 +165,7 @@ function onElementStreamIn(event, element) {
function onPedExitedVehicle(event, ped, vehicle, seat) { function onPedExitedVehicle(event, ped, vehicle, seat) {
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`); //logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
//sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); //sendNetworkEventToServer("v.rp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
cruiseControlEnabled = false; cruiseControlEnabled = false;
cruiseControlSpeed = 0.0; cruiseControlSpeed = 0.0;
@@ -190,7 +189,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
function onPedExitingVehicle(event, ped, vehicle, seat) { function onPedExitingVehicle(event, ped, vehicle, seat) {
//logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`); //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 (localPlayer != null) {
if (ped == localPlayer) { if (ped == localPlayer) {
@@ -204,7 +203,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
function onPedEnteredVehicle(event, ped, vehicle, seat) { function onPedEnteredVehicle(event, ped, vehicle, seat) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`); logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`);
//sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); //sendNetworkEventToServer("v.rp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
cruiseControlEnabled = false; cruiseControlEnabled = false;
cruiseControlSpeed = 0.0; cruiseControlSpeed = 0.0;
@@ -215,9 +214,9 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
if (inVehicleSeat == 0) { if (inVehicleSeat == 0) {
//parkedVehiclePosition = inVehicle.position; //parkedVehiclePosition = inVehicle.position;
//parkedVehicleHeading = inVehicle.heading; //parkedVehicleHeading = inVehicle.heading;
if (doesEntityDataExist(vehicle, "agrp.server") == true) { if (doesEntityDataExist(vehicle, "v.rp.server") == true) {
//setVehicleEngine(vehicle.id, false); //setVehicleEngine(vehicle.id, false);
setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine")); setVehicleEngine(vehicle.id, getEntityData(vehicle, "v.rp.engine"));
//setLocalPlayerControlState(false, false); //setLocalPlayerControlState(false, false);
} }
} }
@@ -238,7 +237,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
if (!weaponDamageEnabled[damagerEntity.name]) { if (!weaponDamageEnabled[damagerEntity.name]) {
preventDefaultEventAction(event); 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) { function onMapLoaded(mapName) {
sendNetworkEventToServer("agrp.mapLoaded", mapName); sendNetworkEventToServer("v.rp.mapLoaded", mapName);
} }
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: gps.js // FILE: gps.js
// DESC: Provides GPS functions and usage // DESC: Provides GPS functions and usage
@@ -18,8 +17,8 @@ let gpsBlipBlinkTimer = null;
function showGPSLocation(position, colour) { function showGPSLocation(position, colour) {
logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`); logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`);
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason. // Server-side spheres don't show in GTA SA for some reason.
gpsSphere = game.createPickup(1318, position, 1); gpsSphere = game.createPickup(1318, position, 1);
} else { } else {

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: gui.js // FILE: gui.js
// DESC: Provides GUI functionality and styles (using MexUI) // DESC: Provides GUI functionality and styles (using MexUI)
@@ -76,7 +75,7 @@ function initGUI() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] All GUI created successfully!`); 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) { function processToggleGUIKeyPress(keyCode) {
if (keyCode == disableGUIKey) { if (keyCode == disableGUIKey) {
sendNetworkEventToServer("agrp.toggleGUI"); sendNetworkEventToServer("v.rp.toggleGUI");
} }
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: 2fa.js // FILE: 2fa.js
// DESC: Provides two factor authentication GUI // DESC: Provides two factor authentication GUI
@@ -130,7 +129,7 @@ function twoFactorAuthSuccess() {
function checkTwoFactorAuth() { function checkTwoFactorAuth() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking two-factor authentication with server ...`); 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: bizmgr.js // FILE: bizmgr.js
// DESC: Provides business manager GUI // DESC: Provides business manager GUI
@@ -78,7 +77,7 @@ function receiveBusinessManagerData(businessIndex, name, locked, entranceFee, bu
// =========================================================================== // ===========================================================================
function saveBusinessData() { function saveBusinessData() {
sendNetworkEventToServer("agrp.businessManagerSave", businessManager.data.businessIndex); sendNetworkEventToServer("v.rp.businessManagerSave", businessManager.data.businessIndex);
} }
*/ */

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: changepass.js // FILE: changepass.js
// DESC: Provides change password GUI // DESC: Provides change password GUI
@@ -129,7 +128,7 @@ function passwordChangeFailed(errorMessage) {
function checkChangePassword() { function checkChangePassword() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password change with server ...`); 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: charselect.js // FILE: charselect.js
// DESC: Provides character select GUI // DESC: Provides character select GUI
@@ -187,21 +186,21 @@ function showNewCharacter() {
function selectNextCharacter() { function selectNextCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`); logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`);
sendNetworkEventToServer("agrp.nextCharacter"); sendNetworkEventToServer("v.rp.nextCharacter");
} }
// =========================================================================== // ===========================================================================
function selectPreviousCharacter() { function selectPreviousCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`); logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`);
sendNetworkEventToServer("agrp.previousCharacter"); sendNetworkEventToServer("v.rp.previousCharacter");
} }
// =========================================================================== // ===========================================================================
function selectThisCharacter() { function selectThisCharacter() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Tell server the current shown character was selected in character select window`); 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) { if (characterSelect.skinImage != null) {
characterSelect.skinImage.remove(); 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; characterSelect.window.shown = true;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: clanmgr.js // FILE: clanmgr.js
// DESC: Provides clan manager GUI // DESC: Provides clan manager GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: error.js // FILE: error.js
// DESC: Provides error box GUI // DESC: Provides error box GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: 5cardpoker.js // FILE: 5cardpoker.js
// DESC: Provides 5-card poker games GUI // DESC: Provides 5-card poker games GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: betting.js // FILE: betting.js
// DESC: Provides betting GUI (used for multiple casino games) // DESC: Provides betting GUI (used for multiple casino games)

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: blackjack.js // FILE: blackjack.js
// DESC: Provides blackjack game GUI // DESC: Provides blackjack game GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: housemgr.js // FILE: housemgr.js
// DESC: Provides house manager GUI // DESC: Provides house manager GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: info.js // FILE: info.js
// DESC: Provides info dialog box GUI // DESC: Provides info dialog box GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: inventory.js // FILE: inventory.js
// DESC: Provides inventory dialog box GUI // DESC: Provides inventory dialog box GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: inventorybulk.js // FILE: inventorybulk.js
// DESC: Provides bulk inventory box GUI // DESC: Provides bulk inventory box GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: list.js // FILE: list.js
// DESC: Provides simple list GUI // DESC: Provides simple list GUI
@@ -96,7 +95,7 @@ function checkListDialogSelection() {
return false; 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]; 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]; 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: localechooser.js // FILE: localechooser.js
// DESC: Provides locale chooser GUI // DESC: Provides locale chooser GUI

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: login.js // FILE: login.js
// DESC: Provides login GUI // DESC: Provides login GUI
@@ -166,7 +165,7 @@ function showLoginGUI() {
function checkLogin() { function checkLogin() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking login with server ...`); 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(); //closeAllWindows();
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset dialog window`); //logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing password reset dialog window`);
//showResetPasswordGUI(); //showResetPasswordGUI();
sendNetworkEventToServer("agrp.checkResetPassword", ""); sendNetworkEventToServer("v.rp.checkResetPassword", "");
return false; return false;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: newchar.js // FILE: newchar.js
// DESC: Provides new character creation GUI // DESC: Provides new character creation GUI
@@ -144,7 +143,7 @@ function checkNewCharacter() {
return false; return false;
} }
sendNetworkEventToServer("agrp.checkNewCharacter", sendNetworkEventToServer("v.rp.checkNewCharacter",
newCharacter.firstNameInput.lines[0], newCharacter.firstNameInput.lines[0],
newCharacter.lastNameInput.lines[0], newCharacter.lastNameInput.lines[0],
); );

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: register.js // FILE: register.js
// DESC: Provides account registration GUI // DESC: Provides account registration GUI
@@ -149,7 +148,7 @@ function registrationFailed(errorMessage) {
function checkRegistration() { function checkRegistration() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking registration with server ...`); 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: resetpass.js // FILE: resetpass.js
// DESC: Provides password reset GUI // DESC: Provides password reset GUI
@@ -143,7 +142,7 @@ function showResetPasswordGUI() {
function checkResetPassword() { function checkResetPassword() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`); 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: yesno.js // FILE: yesno.js
// DESC: Provides yes/no prompt dialog GUI // DESC: Provides yes/no prompt dialog GUI
@@ -101,7 +100,7 @@ function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonT
function yesNoDialogAnswerNo() { function yesNoDialogAnswerNo() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer NO to server prompt`); logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer NO to server prompt`);
sendNetworkEventToServer("agrp.promptAnswerNo"); sendNetworkEventToServer("v.rp.promptAnswerNo");
closeAllWindows(); closeAllWindows();
} }
@@ -109,7 +108,7 @@ function yesNoDialogAnswerNo() {
function yesNoDialogAnswerYes() { function yesNoDialogAnswerYes() {
logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer YES to server prompt`); logToConsole(LOG_DEBUG, `[AGRP.GUI] Responding with answer YES to server prompt`);
sendNetworkEventToServer("agrp.promptAnswerYes"); sendNetworkEventToServer("v.rp.promptAnswerYes");
closeAllWindows(); closeAllWindows();
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: house.js // FILE: house.js
// DESC: Provides house functions and usage // DESC: Provides house functions and usage
@@ -29,7 +28,7 @@ class HouseData {
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) {
logToConsole(LOG_DEBUG, `[AGRP.House] Received house ${houseId} (${name}) from server`); 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) { if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
houseData.description = description; houseData.description = description;
@@ -42,12 +41,12 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
houseData.locked = locked; houseData.locked = locked;
if (houseData.buyPrice > 0) { if (houseData.buyPrice > 0) {
houseData.labelInfoType = AGRP_PROPLABEL_INFO_BUYHOUSE; houseData.labelInfoType = V_PROPLABEL_INFO_BUYHOUSE;
} else { } else {
if (houseData.rentPrice > 0) { if (houseData.rentPrice > 0) {
houseData.labelInfoType = AGRP_PROPLABEL_INFO_RENTHOUSE; houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE;
} else { } 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 (blipModel == -1) {
if (houseData.blipId != -1) { if (houseData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been removed by the server`); 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); natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -67,7 +66,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
} else { } else {
if (houseData.blipId != -1) { if (houseData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.House] House ${houseId}'s blip has been changed by the server`); 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.setBlipCoordinates(houseData.blipId, houseData.entrancePosition);
natives.changeBlipSprite(houseData.blipId, houseData.blipModel); natives.changeBlipSprite(houseData.blipId, houseData.blipModel);
natives.setBlipMarkerLongDistance(houseData.blipId, false); natives.setBlipMarkerLongDistance(houseData.blipId, false);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: item.js // FILE: item.js
// DESC: Provides item action and hotbar functions // DESC: Provides item action and hotbar functions

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: job.js // FILE: job.js
// DESC: Provides job functions and usage // DESC: Provides job functions and usage
@@ -59,8 +58,8 @@ function setLocalPlayerWorkingState(tempWorking) {
function showJobRouteLocation(position, colour) { function showJobRouteLocation(position, colour) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`); logToConsole(LOG_DEBUG, `[AGRP.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
hideJobRouteLocation(); hideJobRouteLocation();
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason. // Server-side spheres don't show in GTA SA for some reason.
jobRouteLocationSphere = game.createPickup(1318, position, 1); jobRouteLocationSphere = game.createPickup(1318, position, 1);
} else { } else {
@@ -140,7 +139,7 @@ function hideJobRouteLocation() {
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) { function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Received job ${jobId} (${name}) from server`); 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) { if (getJobData(jobId) != false) {
let jobData = getJobData(jobId); let jobData = getJobData(jobId);
jobData.jobLocationId = jobLocationId; jobData.jobLocationId = jobLocationId;
@@ -153,7 +152,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
if (blipModel == -1) { if (blipModel == -1) {
if (jobData.blipId != -1) { if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been removed by the server`); 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); natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -165,7 +164,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
} else { } else {
if (jobData.blipId != -1) { if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[AGRP.Job] Job ${jobId}'s blip has been changed by the server`); 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.setBlipCoordinates(jobData.blipId, jobData.position);
natives.changeBlipSprite(jobData.blipId, jobData.blipModel); natives.changeBlipSprite(jobData.blipId, jobData.blipModel);
natives.setBlipMarkerLongDistance(jobData.blipId, false); natives.setBlipMarkerLongDistance(jobData.blipId, false);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: keybind.js // FILE: keybind.js
// DESC: Provides keybind features // DESC: Provides keybind features

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: labels.js // FILE: labels.js
// DESC: Provides functionality for world labels (3D labels) // DESC: Provides functionality for world labels (3D labels)
@@ -14,7 +13,7 @@ let jobLabels = [];
let propertyLabelNameFont = null; let propertyLabelNameFont = null;
let propertyLabelLockedFont = 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 propertyPickupRenderDistance = 75.0;
let propertyLabelRenderDistance = 5.0; let propertyLabelRenderDistance = 5.0;
let propertyLabelLockedOffset = 16; let propertyLabelLockedOffset = 16;
@@ -78,7 +77,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
return false; return false;
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) { if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
return false; return false;
@@ -92,7 +91,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
position = getPosAbovePos(position, propertyLabelHeight); position = getPosAbovePos(position, propertyLabelHeight);
let screenPosition = new Vec3(0.0, 0.0, 0.0); 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()); screenPosition = natives.getViewportPositionOfCoord(position, natives.getGameViewportId());
} else { } else {
screenPosition = getScreenFromWorldPosition(position); screenPosition = getScreenFromWorldPosition(position);
@@ -137,10 +136,10 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked")); text = (locked) ? toUpperCase(getLocaleString("Locked")) : toUpperCase(getLocaleString("Unlocked"));
} }
if (!locked && labelInfoType != AGRP_PROPLABEL_INFO_NONE) { if (!locked && labelInfoType != V_PROPLABEL_INFO_NONE) {
let infoText = ""; let infoText = "";
switch (labelInfoType) { switch (labelInfoType) {
case AGRP_PROPLABEL_INFO_ENTER: { case V_PROPLABEL_INFO_ENTER: {
if (enterPropertyKey) { if (enterPropertyKey) {
infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey))); infoText = getLocaleString("PropertyEnterKeyPressLabel", toUpperCase(getKeyNameFromId(enterPropertyKey)));
} else { } else {
@@ -149,27 +148,27 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price,
break; break;
} }
case AGRP_PROPLABEL_INFO_BUY: { case V_PROPLABEL_INFO_BUY: {
infoText = getLocaleString("BusinessBuyItemsLabel", "/buy"); infoText = getLocaleString("BusinessBuyItemsLabel", "/buy");
break; break;
} }
case AGRP_PROPLABEL_INFO_BUYBIZ: { case V_PROPLABEL_INFO_BUYBIZ: {
infoText = getLocaleString("BuyBusinessLabel", "/bizbuy"); infoText = getLocaleString("BuyBusinessLabel", "/bizbuy");
break; break;
} }
case AGRP_PROPLABEL_INFO_BUYHOUSE: { case V_PROPLABEL_INFO_BUYHOUSE: {
infoText = getLocaleString("BuyHouseLabel", "/housebuy"); infoText = getLocaleString("BuyHouseLabel", "/housebuy");
break; break;
} }
case AGRP_PROPLABEL_INFO_RENTHOUSE: { case V_PROPLABEL_INFO_RENTHOUSE: {
infoText = getLocaleString("RentHouseLabel", "/houserent"); infoText = getLocaleString("RentHouseLabel", "/houserent");
break; break;
} }
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { case V_PROPLABEL_INFO_ENTERVEHICLE: {
infoText = getLocaleString("VehicleDealershipLabel"); infoText = getLocaleString("VehicleDealershipLabel");
break; break;
} }
@@ -219,7 +218,7 @@ function renderPropertyExitLabel(position) {
return false; return false;
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) { if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
return false; return false;
@@ -234,7 +233,7 @@ function renderPropertyExitLabel(position) {
let tempPosition = position; let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight; tempPosition.z = tempPosition.z + propertyLabelHeight;
let screenPosition = new Vec3(0.0, 0.0, 0.0); 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()); screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
} else { } else {
screenPosition = getScreenFromWorldPosition(tempPosition); screenPosition = getScreenFromWorldPosition(tempPosition);
@@ -264,7 +263,7 @@ function renderJobLabel(name, position, jobType) {
return false; return false;
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (!natives.doesViewportExist(natives.getGameViewportId())) { if (!natives.doesViewportExist(natives.getGameViewportId())) {
logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!"); logToConsole(LOG_INFO, "[AGRP.Label]: Game viewport does not exist!");
return false; return false;
@@ -279,7 +278,7 @@ function renderJobLabel(name, position, jobType) {
let tempPosition = position; let tempPosition = position;
tempPosition.z = tempPosition.z + propertyLabelHeight; tempPosition.z = tempPosition.z + propertyLabelHeight;
let screenPosition = new Vec3(0.0, 0.0, 0.0); 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()); screenPosition = natives.getViewportPositionOfCoord(tempPosition, natives.getGameViewportId());
} else { } else {
screenPosition = getScreenFromWorldPosition(tempPosition); screenPosition = getScreenFromWorldPosition(tempPosition);
@@ -318,11 +317,11 @@ function renderJobLabel(name, position, jobType) {
function processLabelRendering() { function processLabelRendering() {
if (renderLabels) { if (renderLabels) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) { if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE) {
if (localPlayer != null) { if (localPlayer != null) {
getServerData().businesses.forEach((business) => { getServerData().businesses.forEach((business) => {
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyPickupRenderDistance) { 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); 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) => { getServerData().houses.forEach((house) => {
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyPickupRenderDistance) { 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); 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) => { getServerData().jobs.forEach((job) => {
if (getDistance(localPlayer.position, job.position) <= propertyPickupRenderDistance) { 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); natives.drawColouredCylinder(getPosBelowPos(job.position, 1.0), 0.0, 0.0, 255, 255, 0, 255);
} }
} }
@@ -362,47 +361,47 @@ function processLabelRendering() {
if (localPlayer != null) { if (localPlayer != null) {
let pickups = getElementsByType(ELEMENT_PICKUP); let pickups = getElementsByType(ELEMENT_PICKUP);
for (let i in pickups) { 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 (getDistance(localPlayer.position, pickups[i].position) <= propertyLabelRenderDistance) {
if (!pickups[i].isOnScreen) { if (!pickups[i].isOnScreen) {
let price = "0"; let price = "0";
let rentPrice = "0"; let rentPrice = "0";
let fee = "0"; let fee = "0";
let labelInfoType = AGRP_PROPLABEL_INFO_NONE; let labelInfoType = V_PROPLABEL_INFO_NONE;
if (pickups[i].getData("agrp.label.price") != null) { if (pickups[i].getData("v.rp.label.price") != null) {
price = pickups[i].getData("agrp.label.price"); price = pickups[i].getData("v.rp.label.price");
} }
if (pickups[i].getData("agrp.label.rentprice") != null) { if (pickups[i].getData("v.rp.label.rentprice") != null) {
rentPrice = pickups[i].getData("agrp.label.rentprice"); rentPrice = pickups[i].getData("v.rp.label.rentprice");
} }
if (pickups[i].getData("agrp.label.help") != null) { if (pickups[i].getData("v.rp.label.help") != null) {
labelInfoType = pickups[i].getData("agrp.label.help"); labelInfoType = pickups[i].getData("v.rp.label.help");
} }
if (pickups[i].getData("agrp.label.fee") != null) { if (pickups[i].getData("v.rp.label.fee") != null) {
fee = pickups[i].getData("agrp.label.fee"); fee = pickups[i].getData("v.rp.label.fee");
} }
switch (pickups[i].getData("agrp.label.type")) { switch (pickups[i].getData("v.rp.label.type")) {
case AGRP_LABEL_BUSINESS: { case V_LABEL_BUSINESS: {
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType, fee); renderPropertyEntranceLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.locked"), true, price, rentPrice, labelInfoType, fee);
break; break;
} }
case AGRP_LABEL_HOUSE: { case V_LABEL_HOUSE: {
renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), false, price, rentPrice, labelInfoType); renderPropertyEntranceLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.locked"), false, price, rentPrice, labelInfoType);
break; break;
} }
case AGRP_LABEL_JOB: { case V_LABEL_JOB: {
renderJobLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.jobType")); renderJobLabel(pickups[i].getData("v.rp.label.name"), pickups[i].position, pickups[i].getData("v.rp.label.jobType"));
break; break;
} }
case AGRP_LABEL_EXIT: { case V_LABEL_EXIT: {
renderPropertyExitLabel(pickups[i].position); renderPropertyExitLabel(pickups[i].position);
break; break;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: locale.js // FILE: locale.js
// DESC: Provides locale functions and usage // DESC: Provides locale functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: logo.js // FILE: logo.js
// DESC: Provides logo rendering functions // DESC: Provides logo rendering functions
@@ -23,7 +22,7 @@ function initLogoScript() {
// =========================================================================== // ===========================================================================
function loadLogoImage() { function loadLogoImage() {
//if (getGame() == AGRP_GAME_MAFIA_ONE) { //if (getGame() == V_GAME_MAFIA_ONE) {
// return false; // return false;
//} //}
@@ -40,7 +39,7 @@ function loadLogoImage() {
// =========================================================================== // ===========================================================================
function processLogoRendering() { function processLogoRendering() {
if (getGame() == AGRP_GAME_MAFIA_ONE) { if (getGame() == V_GAME_MAFIA_ONE) {
return false; return false;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: messaging.js // FILE: messaging.js
// DESC: Provides messaging/textdraw functions and usage // DESC: Provides messaging/textdraw functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: nametags.js // FILE: nametags.js
// DESC: Provides nametag rendering // DESC: Provides nametag rendering
@@ -53,7 +52,7 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
playerPaused[clientName] = paused; playerPaused[clientName] = paused;
playerPing[clientName] = ping; playerPing[clientName] = ping;
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
let client = getPlayerFromParams(clientName); let client = getPlayerFromParams(clientName);
if (client != false) { if (client != false) {
if (getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
@@ -85,8 +84,8 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// ------------------------------------------- // -------------------------------------------
// Health Bar // Health Bar
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_III) { if (getGame() == V_GAME_GTA_III) {
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit // Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
if (skin == 109) { if (skin == 109) {
y -= 20; y -= 20;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: connected.js // FILE: connected.js
// DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods // DESC: Provides wrapped natives for GTA Connected and Mafia Connected mods
@@ -38,7 +37,7 @@ function getPlayerPosition() {
// =========================================================================== // ===========================================================================
function setPlayerPosition(position) { function setPlayerPosition(position) {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
natives.setCharCoordinates(localPlayer, position); natives.setCharCoordinates(localPlayer, position);
} else { } else {
localPlayer.position = position; localPlayer.position = position;
@@ -188,7 +187,7 @@ function getVehiclesInRange(position, range) {
// =========================================================================== // ===========================================================================
function createGameBlip(blipModel, position, name = "") { function createGameBlip(blipModel, position, name = "") {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
let blipId = natives.addBlipForCoord(position); let blipId = natives.addBlipForCoord(position);
if (blipId) { if (blipId) {
natives.changeBlipSprite(blipId, blipModel); natives.changeBlipSprite(blipId, blipModel);
@@ -232,50 +231,50 @@ function repairVehicle(syncId) {
// =========================================================================== // ===========================================================================
function syncVehicleProperties(vehicle) { function syncVehicleProperties(vehicle) {
if (doesEntityDataExist(vehicle, "agrp.lights")) { if (doesEntityDataExist(vehicle, "v.rp.lights")) {
let lightStatus = getEntityData(vehicle, "agrp.lights"); let lightStatus = getEntityData(vehicle, "v.rp.lights");
vehicle.lights = lightStatus; vehicle.lights = lightStatus;
} }
if (doesEntityDataExist(vehicle, "agrp.invincible")) { if (doesEntityDataExist(vehicle, "v.rp.invincible")) {
let invincible = getEntityData(vehicle, "agrp.invincible"); let invincible = getEntityData(vehicle, "v.rp.invincible");
element.setProofs(invincible, invincible, invincible, invincible, invincible); element.setProofs(invincible, invincible, invincible, invincible, invincible);
} }
if (doesEntityDataExist(vehicle, "agrp.panelStatus")) { if (doesEntityDataExist(vehicle, "v.rp.panelStatus")) {
let panelsStatus = getEntityData(vehicle, "agrp.panelStatus"); let panelsStatus = getEntityData(vehicle, "v.rp.panelStatus");
for (let i in panelsStatus) { for (let i in panelsStatus) {
vehicle.setPanelStatus(i, panelsStatus[i]); vehicle.setPanelStatus(i, panelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) { if (doesEntityDataExist(vehicle, "v.rp.wheelStatus")) {
let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus"); let wheelsStatus = getEntityData(vehicle, "v.rp.wheelStatus");
for (let i in wheelsStatus) { for (let i in wheelsStatus) {
vehicle.setWheelStatus(i, wheelsStatus[i]); vehicle.setWheelStatus(i, wheelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.lightStatus")) { if (doesEntityDataExist(vehicle, "v.rp.lightStatus")) {
let lightStatus = getEntityData(vehicle, "agrp.lightStatus"); let lightStatus = getEntityData(vehicle, "v.rp.lightStatus");
for (let i in lightStatus) { for (let i in lightStatus) {
vehicle.setLightStatus(i, lightStatus[i]); vehicle.setLightStatus(i, lightStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) { if (doesEntityDataExist(vehicle, "v.rp.suspensionHeight")) {
let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight"); let suspensionHeight = getEntityData(vehicle, "v.rp.suspensionHeight");
vehicle.setSuspensionHeight(suspensionHeight); vehicle.setSuspensionHeight(suspensionHeight);
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
let allUpgrades = getGameConfig().vehicleUpgrades[getGame()]; let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
for (let i in allUpgrades) { for (let i in allUpgrades) {
vehicle.removeUpgrade(i); vehicle.removeUpgrade(i);
} }
if (doesEntityDataExist(vehicle, "agrp.upgrades")) { if (doesEntityDataExist(vehicle, "v.rp.upgrades")) {
let upgrades = getEntityData(vehicle, "agrp.upgrades"); let upgrades = getEntityData(vehicle, "v.rp.upgrades");
for (let i in upgrades) { for (let i in upgrades) {
if (upgrades[i] != 0) { if (upgrades[i] != 0) {
vehicle.addUpgrade(upgrades[i]); vehicle.addUpgrade(upgrades[i]);
@@ -284,12 +283,12 @@ function syncVehicleProperties(vehicle) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_SA || getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(vehicle, "agrp.livery")) { if (doesEntityDataExist(vehicle, "v.rp.livery")) {
let livery = getEntityData(vehicle, "agrp.livery"); let livery = getEntityData(vehicle, "v.rp.livery");
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
vehicle.setPaintJob(livery); vehicle.setPaintJob(livery);
} else if (getGame() == AGRP_GAME_GTA_IV) { } else if (getGame() == V_GAME_GTA_IV) {
vehicle.livery = livery; vehicle.livery = livery;
} }
} }
@@ -317,9 +316,9 @@ function doesEntityDataExist(entity, dataName) {
// =========================================================================== // ===========================================================================
function syncCivilianProperties(civilian) { function syncCivilianProperties(civilian) {
if (getGame() == AGRP_GAME_GTA_III) { if (getGame() == V_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.scale")) { if (doesEntityDataExist(civilian, "v.rp.scale")) {
let scaleFactor = getEntityData(civilian, "agrp.scale"); let scaleFactor = getEntityData(civilian, "v.rp.scale");
let tempMatrix = civilian.matrix; let tempMatrix = civilian.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = civilian.position; let tempPosition = civilian.position;
@@ -329,79 +328,79 @@ function syncCivilianProperties(civilian) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.fightStyle")) { if (doesEntityDataExist(civilian, "v.rp.fightStyle")) {
let fightStyle = getEntityData(civilian, "agrp.fightStyle"); let fightStyle = getEntityData(civilian, "v.rp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]); civilian.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
if (getGame() == AGRP_GAME_GTA_III) { if (getGame() == V_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "agrp.walkStyle")) { if (doesEntityDataExist(civilian, "v.rp.walkStyle")) {
let walkStyle = getEntityData(civilian, "agrp.walkStyle"); let walkStyle = getEntityData(civilian, "v.rp.walkStyle");
civilian.walkStyle = walkStyle; civilian.walkStyle = walkStyle;
} }
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair"); let bodyPropHair = getEntityData(civilian, "v.rp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHead")) {
let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead"); let bodyPropHead = getEntityData(civilian, "v.rp.bodyPropHead");
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes"); let bodyPropEyes = getEntityData(civilian, "v.rp.bodyPropEyes");
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(civilian, "v.rp.bodyPropLeftHand");
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand"); let bodyPropRightHand = getEntityData(civilian, "v.rp.bodyPropRightHand");
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(civilian, "v.rp.bodyPropLeftWrist");
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHip")) {
let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip"); let bodyPropHip = getEntityData(civilian, "v.rp.bodyPropHip");
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(civilian, "v.rp.bodyPropLeftFoot");
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(civilian, "v.rp.bodyPropRightFoot");
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
if (doesEntityDataExist(civilian, "agrp.anim")) { if (doesEntityDataExist(civilian, "v.rp.anim")) {
let animData = getEntityData(vehicle, "agrp.anim"); let animData = getEntityData(vehicle, "v.rp.anim");
civilian.addAnimation(animData[0], animData[1]); civilian.addAnimation(animData[0], animData[1]);
} }
} }
@@ -415,9 +414,9 @@ function preventDefaultEventAction(event) {
// =========================================================================== // ===========================================================================
function syncPlayerProperties(player) { function syncPlayerProperties(player) {
if (getGame() == AGRP_GAME_GTA_III) { if (getGame() == V_GAME_GTA_III) {
if (doesEntityDataExist(player, "agrp.scale")) { if (doesEntityDataExist(player, "v.rp.scale")) {
let scaleFactor = getEntityData(player, "agrp.scale"); let scaleFactor = getEntityData(player, "v.rp.scale");
let tempMatrix = player.matrix; let tempMatrix = player.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = player.position; let tempPosition = player.position;
@@ -427,95 +426,95 @@ function syncPlayerProperties(player) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
if (doesEntityDataExist(player, "agrp.fightStyle")) { if (doesEntityDataExist(player, "v.rp.fightStyle")) {
let fightStyle = getEntityData(player, "agrp.fightStyle"); let fightStyle = getEntityData(player, "v.rp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]); player.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
//if(getGame() == AGRP_GAME_GTA_SA) { //if(getGame() == V_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "agrp.walkStyle")) { // if(doesEntityDataExist(player, "v.rp.walkStyle")) {
// let walkStyle = getEntityData(player, "agrp.walkStyle"); // let walkStyle = getEntityData(player, "v.rp.walkStyle");
// player.walkStyle = walkStyle; // player.walkStyle = walkStyle;
// } // }
//} //}
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPartHair")) { if (doesEntityDataExist(player, "v.rp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair"); let bodyPartHead = getEntityData(player, "v.rp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartHead")) { if (doesEntityDataExist(player, "v.rp.bodyPartHead")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHead"); let bodyPartHead = getEntityData(player, "v.rp.bodyPartHead");
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartUpper")) { if (doesEntityDataExist(player, "v.rp.bodyPartUpper")) {
let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper"); let bodyPartUpper = getEntityData(player, "v.rp.bodyPartUpper");
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartLower")) { if (doesEntityDataExist(player, "v.rp.bodyPartLower")) {
let bodyPartLower = getEntityData(player, "agrp.bodyPartLower"); let bodyPartLower = getEntityData(player, "v.rp.bodyPartLower");
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
} }
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPropHair")) { if (doesEntityDataExist(player, "v.rp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair"); let bodyPropHair = getEntityData(player, "v.rp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropHead")) { if (doesEntityDataExist(player, "v.rp.bodyPropHead")) {
let bodyPropHead = getEntityData(player, "agrp.bodyPropHead"); let bodyPropHead = getEntityData(player, "v.rp.bodyPropHead");
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropEyes")) { if (doesEntityDataExist(player, "v.rp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes"); let bodyPropEyes = getEntityData(player, "v.rp.bodyPropEyes");
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(player, "v.rp.bodyPropLeftHand");
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand"); let bodyPropRightHand = getEntityData(player, "v.rp.bodyPropRightHand");
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(player, "v.rp.bodyPropLeftWrist");
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropHip")) { if (doesEntityDataExist(player, "v.rp.bodyPropHip")) {
let bodyPropHip = getEntityData(player, "agrp.bodyPropHip"); let bodyPropHip = getEntityData(player, "v.rp.bodyPropHip");
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(player, "v.rp.bodyPropLeftFoot");
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(player, "v.rp.bodyPropRightFoot");
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
@@ -524,9 +523,9 @@ function syncPlayerProperties(player) {
// =========================================================================== // ===========================================================================
function syncObjectProperties(object) { function syncObjectProperties(object) {
if (getGame() == AGRP_GAME_GTA_III || getGame() == AGRP_GAME_GTA_VC) { if (getGame() == V_GAME_GTA_III || getGame() == V_GAME_GTA_VC) {
if (doesEntityDataExist(object, "agrp.scale")) { if (doesEntityDataExist(object, "v.rp.scale")) {
let scaleFactor = getEntityData(object, "agrp.scale"); let scaleFactor = getEntityData(object, "v.rp.scale");
let tempMatrix = object.matrix; let tempMatrix = object.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = object.position; let tempPosition = object.position;
@@ -576,9 +575,9 @@ function getPlayerId(client) {
// =========================================================================== // ===========================================================================
function syncElementProperties(element) { function syncElementProperties(element) {
if (doesEntityDataExist(element, "agrp.interior")) { if (doesEntityDataExist(element, "v.rp.interior")) {
if (typeof element.interior != "undefined") { 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() { function openAllGarages() {
switch (getGame()) { switch (getGame()) {
case AGRP_GAME_GTA_III: case V_GAME_GTA_III:
for (let i = 0; i <= 26; i++) { for (let i = 0; i <= 26; i++) {
openGarage(i); openGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
} }
break; break;
case AGRP_GAME_GTA_VC: case V_GAME_GTA_VC:
for (let i = 0; i <= 32; i++) { for (let i = 0; i <= 32; i++) {
openGarage(i); openGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
} }
break; break;
case AGRP_GAME_GTA_SA: case V_GAME_GTA_SA:
for (let i = 0; i <= 44; i++) { for (let i = 0; i <= 44; i++) {
openGarage(i); openGarage(i);
} }
@@ -657,21 +656,21 @@ function openAllGarages() {
function closeAllGarages() { function closeAllGarages() {
switch (getGame()) { switch (getGame()) {
case AGRP_GAME_GTA_III: case V_GAME_GTA_III:
for (let i = 0; i <= 26; i++) { for (let i = 0; i <= 26; i++) {
closeGarage(i); closeGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
} }
break; break;
case AGRP_GAME_GTA_VC: case V_GAME_GTA_VC:
for (let i = 0; i <= 32; i++) { for (let i = 0; i <= 32; i++) {
closeGarage(i); closeGarage(i);
game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i); game.NO_SPECIAL_CAMERA_FOR_THIS_GARAGE(i);
} }
break; break;
case AGRP_GAME_GTA_SA: case V_GAME_GTA_SA:
for (let i = 0; i <= 44; i++) { for (let i = 0; i <= 44; i++) {
closeGarage(i); closeGarage(i);
} }
@@ -691,7 +690,7 @@ function setPedInvincible(ped, state) {
// =========================================================================== // ===========================================================================
function setPedLookAt(ped, position) { function setPedLookAt(ped, position) {
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
ped.lookAt(position, 10000); ped.lookAt(position, 10000);
return true; return true;
} else { } else {

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: netevents.js // FILE: netevents.js
// DESC: Provides server communication and cross-endpoint network events // DESC: Provides server communication and cross-endpoint network events
@@ -20,169 +19,169 @@ function addAllNetworkHandlers() {
// Chat Box // Chat Box
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines); addNetworkEventHandler("v.rp.chatScrollLines", setChatScrollLines);
addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay); addNetworkEventHandler("v.rp.chatAutoHideDelay", setChatAutoHideDelay);
addNetworkEventHandler("agrp.chatTimeStamps", setChatTimeStampsState); addNetworkEventHandler("v.rp.chatTimeStamps", setChatTimeStampsState);
addNetworkEventHandler("agrp.chatEmoji", setChatEmojiState); addNetworkEventHandler("v.rp.chatEmoji", setChatEmojiState);
// Messaging (like textdraws and stuff) // Messaging (like textdraws and stuff)
addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage); addNetworkEventHandler("v.rp.smallGameMessage", showSmallGameMessage);
// Job // Job
addNetworkEventHandler("agrp.job", receiveJobFromServer); addNetworkEventHandler("v.rp.job", receiveJobFromServer);
addNetworkEventHandler("agrp.working", setLocalPlayerWorkingState); addNetworkEventHandler("v.rp.working", setLocalPlayerWorkingState);
addNetworkEventHandler("agrp.jobType", setLocalPlayerJobType); addNetworkEventHandler("v.rp.jobType", setLocalPlayerJobType);
addNetworkEventHandler("agrp.showJobRouteLocation", showJobRouteLocation); addNetworkEventHandler("v.rp.showJobRouteLocation", showJobRouteLocation);
addNetworkEventHandler("agrp.hideJobRouteLocation", hideJobRouteLocation); addNetworkEventHandler("v.rp.hideJobRouteLocation", hideJobRouteLocation);
// Local player states and values // Local player states and values
addNetworkEventHandler("agrp.restoreCamera", restoreLocalCamera); addNetworkEventHandler("v.rp.restoreCamera", restoreLocalCamera);
addNetworkEventHandler("agrp.cameraLookAt", setLocalCameraLookAt); addNetworkEventHandler("v.rp.cameraLookAt", setLocalCameraLookAt);
addNetworkEventHandler("agrp.freeze", setLocalPlayerFrozenState); addNetworkEventHandler("v.rp.freeze", setLocalPlayerFrozenState);
addNetworkEventHandler("agrp.control", setLocalPlayerControlState); addNetworkEventHandler("v.rp.control", setLocalPlayerControlState);
addNetworkEventHandler("agrp.fadeCamera", fadeLocalCamera); addNetworkEventHandler("v.rp.fadeCamera", fadeLocalCamera);
addNetworkEventHandler("agrp.removeFromVehicle", removeLocalPlayerFromVehicle); addNetworkEventHandler("v.rp.removeFromVehicle", removeLocalPlayerFromVehicle);
addNetworkEventHandler("agrp.clearWeapons", clearLocalPlayerWeapons); addNetworkEventHandler("v.rp.clearWeapons", clearLocalPlayerWeapons);
addNetworkEventHandler("agrp.giveWeapon", giveLocalPlayerWeapon); addNetworkEventHandler("v.rp.giveWeapon", giveLocalPlayerWeapon);
addNetworkEventHandler("agrp.position", setLocalPlayerPosition); addNetworkEventHandler("v.rp.position", setLocalPlayerPosition);
addNetworkEventHandler("agrp.heading", setLocalPlayerHeading); addNetworkEventHandler("v.rp.heading", setLocalPlayerHeading);
addNetworkEventHandler("agrp.interior", setLocalPlayerInterior); addNetworkEventHandler("v.rp.interior", setLocalPlayerInterior);
addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer); addNetworkEventHandler("v.rp.spawned", onServerSpawnedLocalPlayer);
addNetworkEventHandler("agrp.money", setLocalPlayerMoney); addNetworkEventHandler("v.rp.money", setLocalPlayerMoney);
addNetworkEventHandler("agrp.armour", setLocalPlayerArmour); addNetworkEventHandler("v.rp.armour", setLocalPlayerArmour);
addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin); addNetworkEventHandler("v.rp.localPlayerSkin", setLocalPlayerSkin);
addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak); addNetworkEventHandler("v.rp.pedSpeak", makeLocalPlayerPedSpeak);
addNetworkEventHandler("agrp.infiniteRun", setLocalPlayerInfiniteRun); addNetworkEventHandler("v.rp.infiniteRun", setLocalPlayerInfiniteRun);
addNetworkEventHandler("agrp.playerCop", setLocalPlayerAsCopState); addNetworkEventHandler("v.rp.playerCop", setLocalPlayerAsCopState);
addNetworkEventHandler("agrp.health", setLocalPlayerHealth); addNetworkEventHandler("v.rp.health", setLocalPlayerHealth);
addNetworkEventHandler("agrp.wantedLevel", setLocalPlayerWantedLevel); addNetworkEventHandler("v.rp.wantedLevel", setLocalPlayerWantedLevel);
addNetworkEventHandler("agrp.playerPedId", sendLocalPlayerNetworkIdToServer); addNetworkEventHandler("v.rp.playerPedId", sendLocalPlayerNetworkIdToServer);
addNetworkEventHandler("agrp.ped", setLocalPlayerPedPartsAndProps); addNetworkEventHandler("v.rp.ped", setLocalPlayerPedPartsAndProps);
addNetworkEventHandler("agrp.spawn", serverRequestedLocalPlayerSpawn); addNetworkEventHandler("v.rp.spawn", serverRequestedLocalPlayerSpawn);
addNetworkEventHandler("agrp.clearPedState", clearLocalPedState); addNetworkEventHandler("v.rp.clearPedState", clearLocalPedState);
addNetworkEventHandler("agrp.drunkEffect", setLocalPlayerDrunkEffect); addNetworkEventHandler("v.rp.drunkEffect", setLocalPlayerDrunkEffect);
addNetworkEventHandler("agrp.deleteLocalPlayerPed", deleteLocalPlayerPed); addNetworkEventHandler("v.rp.deleteLocalPlayerPed", deleteLocalPlayerPed);
// Vehicle // Vehicle
addNetworkEventHandler("agrp.vehicle", receiveVehicleFromServer); addNetworkEventHandler("v.rp.vehicle", receiveVehicleFromServer);
addNetworkEventHandler("agrp.veh.lights", setVehicleLights); addNetworkEventHandler("v.rp.veh.lights", setVehicleLights);
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine); addNetworkEventHandler("v.rp.veh.engine", setVehicleEngine);
addNetworkEventHandler("agrp.veh.repair", repairVehicle); addNetworkEventHandler("v.rp.veh.repair", repairVehicle);
addNetworkEventHandler("agrp.cruiseControl", toggleLocalVehicleCruiseControl); addNetworkEventHandler("v.rp.cruiseControl", toggleLocalVehicleCruiseControl);
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger); addNetworkEventHandler("v.rp.passenger", enterVehicleAsPassenger);
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState); addNetworkEventHandler("v.rp.vehBuyState", setVehiclePurchaseState);
// Radio // Radio
addNetworkEventHandler("agrp.radioStream", playStreamingRadio); addNetworkEventHandler("v.rp.radioStream", playStreamingRadio);
addNetworkEventHandler("agrp.audioFileStream", playAudioFile); addNetworkEventHandler("v.rp.audioFileStream", playAudioFile);
addNetworkEventHandler("agrp.stopRadioStream", stopStreamingRadio); addNetworkEventHandler("v.rp.stopRadioStream", stopStreamingRadio);
addNetworkEventHandler("agrp.radioVolume", setStreamingRadioVolume); addNetworkEventHandler("v.rp.radioVolume", setStreamingRadioVolume);
// Key Bindings // Key Bindings
addNetworkEventHandler("agrp.delKeyBind", unBindAccountKey); addNetworkEventHandler("v.rp.delKeyBind", unBindAccountKey);
addNetworkEventHandler("agrp.addKeyBind", bindAccountKey); addNetworkEventHandler("v.rp.addKeyBind", bindAccountKey);
addNetworkEventHandler("agrp.clearKeyBinds", clearKeyBinds); addNetworkEventHandler("v.rp.clearKeyBinds", clearKeyBinds);
// Weapon Damage // Weapon Damage
addNetworkEventHandler("agrp.weaponDamageEnabled", setPlayerWeaponDamageEnabled); addNetworkEventHandler("v.rp.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
addNetworkEventHandler("agrp.weaponDamageEvent", setPlayerWeaponDamageEvent); addNetworkEventHandler("v.rp.weaponDamageEvent", setPlayerWeaponDamageEvent);
// GUI // GUI
addNetworkEventHandler("agrp.showRegistration", showRegistrationGUI); addNetworkEventHandler("v.rp.showRegistration", showRegistrationGUI);
addNetworkEventHandler("agrp.showNewCharacter", showNewCharacterGUI); addNetworkEventHandler("v.rp.showNewCharacter", showNewCharacterGUI);
addNetworkEventHandler("agrp.showLogin", showLoginGUI); addNetworkEventHandler("v.rp.showLogin", showLoginGUI);
addNetworkEventHandler("agrp.2fa", showTwoFactorAuthGUI); addNetworkEventHandler("v.rp.2fa", showTwoFactorAuthGUI);
addNetworkEventHandler("agrp.showResetPasswordCodeInput", resetPasswordCodeInputGUI); addNetworkEventHandler("v.rp.showResetPasswordCodeInput", resetPasswordCodeInputGUI);
addNetworkEventHandler("agrp.showResetPasswordEmailInput", resetPasswordEmailInputGUI); addNetworkEventHandler("v.rp.showResetPasswordEmailInput", resetPasswordEmailInputGUI);
addNetworkEventHandler("agrp.showChangePassword", showChangePasswordGUI); addNetworkEventHandler("v.rp.showChangePassword", showChangePasswordGUI);
addNetworkEventHandler("agrp.showCharacterSelect", showCharacterSelectGUI); addNetworkEventHandler("v.rp.showCharacterSelect", showCharacterSelectGUI);
addNetworkEventHandler("agrp.switchCharacterSelect", switchCharacterSelectGUI); addNetworkEventHandler("v.rp.switchCharacterSelect", switchCharacterSelectGUI);
addNetworkEventHandler("agrp.showError", showErrorGUI); addNetworkEventHandler("v.rp.showError", showErrorGUI);
addNetworkEventHandler("agrp.showInfo", showInfoGUI); addNetworkEventHandler("v.rp.showInfo", showInfoGUI);
addNetworkEventHandler("agrp.showPrompt", showYesNoPromptGUI); addNetworkEventHandler("v.rp.showPrompt", showYesNoPromptGUI);
addNetworkEventHandler("agrp.loginSuccess", loginSuccess); addNetworkEventHandler("v.rp.loginSuccess", loginSuccess);
addNetworkEventHandler("agrp.characterSelectSuccess", characterSelectSuccess); addNetworkEventHandler("v.rp.characterSelectSuccess", characterSelectSuccess);
addNetworkEventHandler("agrp.loginFailed", loginFailed); addNetworkEventHandler("v.rp.loginFailed", loginFailed);
addNetworkEventHandler("agrp.registrationSuccess", registrationSuccess); addNetworkEventHandler("v.rp.registrationSuccess", registrationSuccess);
addNetworkEventHandler("agrp.registrationFailed", registrationFailed); addNetworkEventHandler("v.rp.registrationFailed", registrationFailed);
addNetworkEventHandler("agrp.newCharacterFailed", newCharacterFailed); addNetworkEventHandler("v.rp.newCharacterFailed", newCharacterFailed);
addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI); addNetworkEventHandler("v.rp.changePassword", showChangePasswordGUI);
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI); addNetworkEventHandler("v.rp.showLocaleChooser", showLocaleChooserGUI);
addNetworkEventHandler("agrp.guiColour", setGUIColours); addNetworkEventHandler("v.rp.guiColour", setGUIColours);
addNetworkEventHandler("agrp.mapChangeWarning", setMapChangeWarningState); addNetworkEventHandler("v.rp.mapChangeWarning", setMapChangeWarningState);
// 2D Rendering // 2D Rendering
addNetworkEventHandler("agrp.set2DRendering", set2DRendering); addNetworkEventHandler("v.rp.set2DRendering", set2DRendering);
addNetworkEventHandler("agrp.logo", setServerLogoRenderState); addNetworkEventHandler("v.rp.logo", setServerLogoRenderState);
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay); addNetworkEventHandler("v.rp.showItemActionDelay", showItemActionDelay);
// Business // Business
addNetworkEventHandler("agrp.business", receiveBusinessFromServer); addNetworkEventHandler("v.rp.business", receiveBusinessFromServer);
// House // House
addNetworkEventHandler("agrp.house", receiveHouseFromServer); addNetworkEventHandler("v.rp.house", receiveHouseFromServer);
// GPS // GPS
addNetworkEventHandler("agrp.showGPSBlip", showGPSLocation); addNetworkEventHandler("v.rp.showGPSBlip", showGPSLocation);
// Locale // Locale
addNetworkEventHandler("agrp.locale", setLocale); addNetworkEventHandler("v.rp.locale", setLocale);
addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI); addNetworkEventHandler("v.rp.localeChooser", toggleLocaleChooserGUI);
// Animation // Animation
addNetworkEventHandler("agrp.anim", makePedPlayAnimation); addNetworkEventHandler("v.rp.anim", makePedPlayAnimation);
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation); addNetworkEventHandler("v.rp.stopAnim", makePedStopAnimation);
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation); addNetworkEventHandler("v.rp.forceAnim", forcePedAnimation);
// Nametags // Nametags
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag); addNetworkEventHandler("v.rp.nametag", updatePlayerNameTag);
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance); addNetworkEventHandler("v.rp.nametagDistance", setNameTagDistance);
// Misc // Misc
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor); addNetworkEventHandler("v.rp.mouseCursor", toggleMouseCursor);
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera); addNetworkEventHandler("v.rp.mouseCamera", toggleMouseCamera);
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState); addNetworkEventHandler("v.rp.mouseCameraForce", setMouseCameraState);
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds); addNetworkEventHandler("v.rp.clearPeds", clearLocalPlayerOwnedPeds);
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups); addNetworkEventHandler("v.rp.clearPickups", clearLocalPlayerOwnedPickups);
addNetworkEventHandler("agrp.ambience", setCityAmbienceState); addNetworkEventHandler("v.rp.ambience", setCityAmbienceState);
addNetworkEventHandler("agrp.runCode", runClientCode); addNetworkEventHandler("v.rp.runCode", runClientCode);
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration); addNetworkEventHandler("v.rp.minuteDuration", setMinuteDuration);
addNetworkEventHandler("agrp.snow", setSnowState); addNetworkEventHandler("v.rp.snow", setSnowState);
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey); addNetworkEventHandler("v.rp.enterPropertyKey", setEnterPropertyKey);
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect); addNetworkEventHandler("v.rp.skinSelect", toggleSkinSelect);
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar); addNetworkEventHandler("v.rp.hotbar", updatePlayerHotBar);
addNetworkEventHandler("agrp.logLevel", setLogLevel); addNetworkEventHandler("v.rp.logLevel", setLogLevel);
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI); addNetworkEventHandler("v.rp.hideAllGUI", hideAllGUI);
addNetworkEventHandler("agrp.ping", updatePlayerPing); addNetworkEventHandler("v.rp.ping", updatePlayerPing);
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("v.rp.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState); addNetworkEventHandler("v.rp.interiorLights", updateInteriorLightsState);
addNetworkEventHandler("agrp.scene", changeScene); addNetworkEventHandler("v.rp.scene", changeScene);
addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties); addNetworkEventHandler("v.rp.syncElement", forceSyncElementProperties);
addNetworkEventHandler("agrp.elementPosition", setElementPosition); addNetworkEventHandler("v.rp.elementPosition", setElementPosition);
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled); addNetworkEventHandler("v.rp.elementCollisions", setElementCollisionsEnabled);
addNetworkEventHandler("agrp.holdObject", makePedHoldObject); addNetworkEventHandler("v.rp.holdObject", makePedHoldObject);
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState); addNetworkEventHandler("v.rp.profanityFilter", setProfanityFilterState);
addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer); addNetworkEventHandler("v.rp.currencyString", receiveCurrencyStringFromServer);
addNetworkEventHandler("agrp.token", serverRequestedToken); addNetworkEventHandler("v.rp.token", serverRequestedToken);
} }
// =========================================================================== // ===========================================================================
function sendResourceReadySignalToServer() { function sendResourceReadySignalToServer() {
sendNetworkEventToServer("agrp.clientReady"); sendNetworkEventToServer("v.rp.clientReady");
} }
// =========================================================================== // ===========================================================================
function sendResourceStartedSignalToServer() { function sendResourceStartedSignalToServer() {
sendNetworkEventToServer("agrp.clientStarted"); sendNetworkEventToServer("v.rp.clientStarted");
} }
// =========================================================================== // ===========================================================================
function sendResourceStoppedSignalToServer() { function sendResourceStoppedSignalToServer() {
if (isConnected) { 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})`); 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; renderHUD = hudState;
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
natives.displayCash(hudState); natives.displayCash(hudState);
natives.displayAmmo(hudState); natives.displayAmmo(hudState);
natives.displayHud(hudState); natives.displayHud(hudState);
@@ -239,19 +238,19 @@ function onServerSpawnedLocalPlayer(state) {
// =========================================================================== // ===========================================================================
function tellServerPlayerUsedKeyBind(key) { function tellServerPlayerUsedKeyBind(key) {
sendNetworkEventToServer("agrp.useKeyBind", key); sendNetworkEventToServer("v.rp.useKeyBind", key);
} }
// =========================================================================== // ===========================================================================
function tellServerPlayerArrivedAtJobRouteLocation() { function tellServerPlayerArrivedAtJobRouteLocation() {
sendNetworkEventToServer("agrp.arrivedAtJobRouteLocation"); sendNetworkEventToServer("v.rp.arrivedAtJobRouteLocation");
} }
// =========================================================================== // ===========================================================================
function tellServerItemActionDelayComplete() { function tellServerItemActionDelayComplete() {
sendNetworkEventToServer("agrp.itemActionDelayComplete"); sendNetworkEventToServer("v.rp.itemActionDelayComplete");
} }
// =========================================================================== // ===========================================================================
@@ -261,13 +260,13 @@ function sendServerClientInfo() {
if (typeof CLIENT_VERSION_MAJOR != "undefined") { if (typeof CLIENT_VERSION_MAJOR != "undefined") {
clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`; 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) { function sendServerNewAFKStatus(state) {
sendNetworkEventToServer("agrp.afk", state); sendNetworkEventToServer("v.rp.afk", state);
} }
// =========================================================================== // ===========================================================================
@@ -328,7 +327,7 @@ function setLogLevel(level) {
function setLocalPlayerInfiniteRun(state) { function setLocalPlayerInfiniteRun(state) {
if (localPlayer != null) { 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)); game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), boolToInt(state));
} }
} }
@@ -338,7 +337,7 @@ function setLocalPlayerInfiniteRun(state) {
function setLocalPlayerSkin(skinId) { function setLocalPlayerSkin(skinId) {
logToConsole(LOG_INFO, `[AGRP.Server] Setting locale player skin to ${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)) { if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId); natives.requestModel(skinId);
natives.loadAllObjectsNow(); natives.loadAllObjectsNow();
@@ -354,7 +353,7 @@ function setLocalPlayerSkin(skinId) {
// =========================================================================== // ===========================================================================
function makePedHoldObject(pedId, modelIndex) { 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]) natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
} }
} }
@@ -362,15 +361,15 @@ function makePedHoldObject(pedId, modelIndex) {
// =========================================================================== // ===========================================================================
function sendLocalPlayerNetworkIdToServer() { function sendLocalPlayerNetworkIdToServer() {
if (getGame() == AGRP_GAME_GTA_IV || getGame() == AGRP_GAME_GTA_IV_EFLC) { if (getGame() == V_GAME_GTA_IV || getGame() == V_GAME_GTA_IV_EFLC) {
sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer)); sendNetworkEventToServer("v.rp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
} }
} }
// =========================================================================== // ===========================================================================
function changeScene(sceneName) { function changeScene(sceneName) {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (cutsceneName == "") { if (cutsceneName == "") {
natives.clearCutscene(); natives.clearCutscene();
} else { } else {
@@ -379,7 +378,7 @@ function changeScene(sceneName) {
} }
natives.initCutscene(cutsceneName); natives.initCutscene(cutsceneName);
} }
} else if (getGame() == AGRP_GAME_MAFIA_ONE) { } else if (getGame() == V_GAME_MAFIA_ONE) {
game.changeMap(sceneName); game.changeMap(sceneName);
} }
} }
@@ -387,7 +386,7 @@ function changeScene(sceneName) {
// =========================================================================== // ===========================================================================
function makeLocalPlayerPedSpeak(speechName) { 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) // 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 // Only speeches with _MEGAPHONE will have the bullhorn effect
// Afaik it only works on police voices anyway // Afaik it only works on police voices anyway
@@ -396,7 +395,7 @@ function makeLocalPlayerPedSpeak(speechName) {
} else { } else {
natives.sayAmbientSpeech(localPlayer, speechName, true, false, 1); 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 // 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); //game.SET_CHAR_SAY(game.GET_PLAYER_ID(), int);
} }
@@ -405,7 +404,7 @@ function makeLocalPlayerPedSpeak(speechName) {
// =========================================================================== // ===========================================================================
function setLocalPlayerAsCopState(state) { function setLocalPlayerAsCopState(state) {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
natives.setPlayerAsCop(natives.getPlayerId(), state); natives.setPlayerAsCop(natives.getPlayerId(), state);
natives.setPoliceIgnorePlayer(natives.getPlayerId(), state); natives.setPoliceIgnorePlayer(natives.getPlayerId(), state);
} }
@@ -414,7 +413,7 @@ function setLocalPlayerAsCopState(state) {
// =========================================================================== // ===========================================================================
function serverRequestedLocalPlayerSpawn(skinId, position) { function serverRequestedLocalPlayerSpawn(skinId, position) {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
natives.createPlayer(skinId, position); natives.createPlayer(skinId, position);
//if(isCustomCameraSupported()) { //if(isCustomCameraSupported()) {
// game.restoreCamera(true); // game.restoreCamera(true);
@@ -425,7 +424,7 @@ function serverRequestedLocalPlayerSpawn(skinId, position) {
// =========================================================================== // ===========================================================================
function sendLocaleSelectToServer(localeId) { function sendLocaleSelectToServer(localeId) {
sendNetworkEventToServer("agrp.localeSelect", localeId); sendNetworkEventToServer("v.rp.localeSelect", localeId);
} }
// =========================================================================== // ===========================================================================
@@ -465,7 +464,7 @@ function receiveClientVariablesFromServer(clientVariablesString) {
function serverRequestedToken() { function serverRequestedToken() {
let token = loadToken(); let token = loadToken();
sendNetworkEventToServer("agrp.token", token); sendNetworkEventToServer("v.rp.token", token);
} }
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: npc.js // FILE: npc.js
// DESC: Provides NPC functions and processing // DESC: Provides NPC functions and processing
@@ -10,7 +9,7 @@
function processNPCMovement(npc) { function processNPCMovement(npc) {
//if(npc.isSyncer == true) { //if(npc.isSyncer == true) {
if (getEntityData(npc, "agrp.lookAtClosestPlayer") == true) { if (getEntityData(npc, "v.rp.lookAtClosestPlayer") == true) {
let closestPlayer = getClosestPlayer(getElementPosition(npc.id)); let closestPlayer = getClosestPlayer(getElementPosition(npc.id));
setPedLookAt(npc, getElementPosition(closestPlayer.id)); setPedLookAt(npc, getElementPosition(closestPlayer.id));
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: object.js // FILE: object.js
// DESC: Provides object functions and processing // DESC: Provides object functions and processing
@@ -20,7 +19,7 @@ function startMovingObject(object) {
function stopMovingObject(object, save = true) { function stopMovingObject(object, save = true) {
if (save) { 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: radio.js // FILE: radio.js
// DESC: Provides internet streaming radio functions and usage // DESC: Provides internet streaming radio functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: scoreboard.js // FILE: scoreboard.js
// DESC: Provides scoreboard features and rendering // DESC: Provides scoreboard features and rendering

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: skin-select.js // FILE: skin-select.js
// DESC: Provides skin-selector functions and usage // DESC: Provides skin-selector functions and usage
@@ -65,16 +64,16 @@ function processSkinSelectKeyPress(keyCode) {
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]); setLocalPlayerSkin(allowedSkins[skinSelectorIndex][0]);
} else if (keyCode == getKeyIdFromParams("enter")) { } else if (keyCode == getKeyIdFromParams("enter")) {
sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex); sendNetworkEventToServer("v.rp.skinSelected", skinSelectorIndex);
toggleSkinSelect(false); toggleSkinSelect(false);
return true; return true;
} else if (keyCode == getKeyIdFromParams("backspace")) { } else if (keyCode == getKeyIdFromParams("backspace")) {
sendNetworkEventToServer("agrp.skinSelected", -1); sendNetworkEventToServer("v.rp.skinSelected", -1);
toggleSkinSelect(false); toggleSkinSelect(false);
return true; return true;
} }
if (getGame() <= AGRP_GAME_GTA_SA) { if (getGame() <= V_GAME_GTA_SA) {
localPlayer.heading = skinSelectHeading; localPlayer.heading = skinSelectHeading;
} }
} }
@@ -109,7 +108,7 @@ function toggleSkinSelect(state) {
if (isCustomCameraSupported()) { if (isCustomCameraSupported()) {
let cameraPosition = localPlayer.position; let cameraPosition = localPlayer.position;
let playerPosition = localPlayer.position; let playerPosition = localPlayer.position;
if (getGame() == AGRP_GAME_MAFIA_ONE) { if (getGame() == V_GAME_MAFIA_ONE) {
cameraPosition.y += 1.5; cameraPosition.y += 1.5;
playerPosition.y += 1.5; playerPosition.y += 1.5;
distance = 3; distance = 3;
@@ -121,7 +120,7 @@ function toggleSkinSelect(state) {
game.setCameraLookAt(frontCameraPosition, playerPosition, true); game.setCameraLookAt(frontCameraPosition, playerPosition, true);
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0]; let skinId = allowedSkins[skinSelectorIndex][0];
if (natives.isModelInCdimage(skinId)) { if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId); natives.requestModel(skinId);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: startup.js // FILE: startup.js
// DESC: Provides startup/shutdown procedures // DESC: Provides startup/shutdown procedures
@@ -29,7 +28,7 @@ function initClientScripts() {
// =========================================================================== // ===========================================================================
function setUpInitialGame() { 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 ..."); logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA III ...");
// Turn off unlimited sprint // Turn off unlimited sprint
@@ -48,7 +47,7 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js) // Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true); 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 ..."); logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA Vice City ...");
// Turn off unlimited sprint // Turn off unlimited sprint
@@ -91,7 +90,7 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js) // Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true); 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 ..."); logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA San Andreas ...");
// Turn weapon skills down a bit // Turn weapon skills down a bit
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400); game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
@@ -128,7 +127,7 @@ function setUpInitialGame() {
// Disables taxi/vigilante/etc and other start mission triggers // Disables taxi/vigilante/etc and other start mission triggers
game.onMission = true; game.onMission = true;
} else if (getGame() == AGRP_GAME_GTA_IV) { } else if (getGame() == V_GAME_GTA_IV) {
natives.allowEmergencyServices(false); natives.allowEmergencyServices(false);
natives.setCreateRandomCops(true); natives.setCreateRandomCops(true);
natives.setMaxWantedLevel(0); natives.setMaxWantedLevel(0);
@@ -190,7 +189,7 @@ function setUpInitialGame() {
// Some last steps // Some last steps
//natives.loadAllObjectsNow(); //natives.loadAllObjectsNow();
} else if (getGame() == AGRP_GAME_MAFIA_ONE) { } else if (getGame() == V_GAME_MAFIA_ONE) {
game.mapEnabled = false; game.mapEnabled = false;
game.setTrafficEnabled(false); game.setTrafficEnabled(false);
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: sync.js // FILE: sync.js
// DESC: Provides some elements and data sync // DESC: Provides some elements and data sync
@@ -11,12 +10,12 @@
function processSync(event, deltaTime) { function processSync(event, deltaTime) {
if (localPlayer != null) { if (localPlayer != null) {
if (!areServerElementsSupported()) { if (!areServerElementsSupported()) {
sendNetworkEventToServer("agrp.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); sendNetworkEventToServer("v.rp.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.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading);
//if(localPlayer.vehicle != null) { //if(localPlayer.vehicle != null) {
// sendNetworkEventToServer("agrp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); // sendNetworkEventToServer("v.rp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
// sendNetworkEventToServer("agrp.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); // 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`); logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons(); localPlayer.clearWeapons();
calledDeathEvent = true; calledDeathEvent = true;
sendNetworkEventToServer("agrp.playerDeath"); sendNetworkEventToServer("v.rp.playerDeath");
} }
} }
} }
@@ -35,7 +34,7 @@ function processSync(event, deltaTime) {
logToConsole(LOG_DEBUG, `Local player died`); logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons(); localPlayer.clearWeapons();
calledDeathEvent = true; calledDeathEvent = true;
sendNetworkEventToServer("agrp.playerDeath"); sendNetworkEventToServer("v.rp.playerDeath");
} }
} }
@@ -47,7 +46,7 @@ function processSync(event, deltaTime) {
// =========================================================================== // ===========================================================================
function setVehicleLights(vehicleId, state) { function setVehicleLights(vehicleId, state) {
//if (getGame() == AGRP_GAME_GTA_IV) { //if (getGame() == V_GAME_GTA_IV) {
// if (!state) { // if (!state) {
// natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0)); // natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
// } else { // } else {
@@ -71,44 +70,44 @@ function syncVehicleProperties(vehicle) {
return false; return false;
} }
if (doesEntityDataExist(vehicle, "agrp.lights")) { if (doesEntityDataExist(vehicle, "v.rp.lights")) {
let lightStatus = getEntityData(vehicle, "agrp.lights"); let lightStatus = getEntityData(vehicle, "v.rp.lights");
vehicle.lights = lightStatus; vehicle.lights = lightStatus;
} }
if (doesEntityDataExist(vehicle, "agrp.locked")) { if (doesEntityDataExist(vehicle, "v.rp.locked")) {
let lockStatus = getEntityData(vehicle, "agrp.locked"); let lockStatus = getEntityData(vehicle, "v.rp.locked");
vehicle.locked = lockStatus; vehicle.locked = lockStatus;
} }
if (doesEntityDataExist(vehicle, "agrp.invincible")) { if (doesEntityDataExist(vehicle, "v.rp.invincible")) {
let invincible = getEntityData(vehicle, "agrp.invincible"); let invincible = getEntityData(vehicle, "v.rp.invincible");
element.setProofs(invincible, invincible, invincible, invincible, invincible); element.setProofs(invincible, invincible, invincible, invincible, invincible);
} }
if (doesEntityDataExist(vehicle, "agrp.panelStatus")) { if (doesEntityDataExist(vehicle, "v.rp.panelStatus")) {
let panelsStatus = getEntityData(vehicle, "agrp.panelStatus"); let panelsStatus = getEntityData(vehicle, "v.rp.panelStatus");
for (let i in panelsStatus) { for (let i in panelsStatus) {
vehicle.setPanelStatus(i, panelsStatus[i]); vehicle.setPanelStatus(i, panelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) { if (doesEntityDataExist(vehicle, "v.rp.wheelStatus")) {
let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus"); let wheelsStatus = getEntityData(vehicle, "v.rp.wheelStatus");
for (let i in wheelsStatus) { for (let i in wheelsStatus) {
vehicle.setWheelStatus(i, wheelsStatus[i]); vehicle.setWheelStatus(i, wheelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.lightStatus")) { if (doesEntityDataExist(vehicle, "v.rp.lightStatus")) {
let lightStatus = getEntityData(vehicle, "agrp.lightStatus"); let lightStatus = getEntityData(vehicle, "v.rp.lightStatus");
for (let i in lightStatus) { for (let i in lightStatus) {
vehicle.setLightStatus(i, lightStatus[i]); vehicle.setLightStatus(i, lightStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) { if (doesEntityDataExist(vehicle, "v.rp.suspensionHeight")) {
let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight"); let suspensionHeight = getEntityData(vehicle, "v.rp.suspensionHeight");
vehicle.setSuspensionHeight(suspensionHeight); vehicle.setSuspensionHeight(suspensionHeight);
} }
@@ -118,8 +117,8 @@ function syncVehicleProperties(vehicle) {
// vehicle.removeUpgrade(i); // vehicle.removeUpgrade(i);
//} //}
if (doesEntityDataExist(vehicle, "agrp.upgrades")) { if (doesEntityDataExist(vehicle, "v.rp.upgrades")) {
let upgrades = getEntityData(vehicle, "agrp.upgrades"); let upgrades = getEntityData(vehicle, "v.rp.upgrades");
for (let i in upgrades) { for (let i in upgrades) {
if (upgrades[i] != 0) { if (upgrades[i] != 0) {
vehicle.addUpgrade(upgrades[i]); vehicle.addUpgrade(upgrades[i]);
@@ -128,12 +127,12 @@ function syncVehicleProperties(vehicle) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA || getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_SA || getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(vehicle, "agrp.livery")) { if (doesEntityDataExist(vehicle, "v.rp.livery")) {
let livery = getEntityData(vehicle, "agrp.livery"); let livery = getEntityData(vehicle, "v.rp.livery");
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
vehicle.setPaintJob(livery); vehicle.setPaintJob(livery);
} else if (getGame() == AGRP_GAME_GTA_IV) { } else if (getGame() == V_GAME_GTA_IV) {
vehicle.livery = livery; vehicle.livery = livery;
} }
} }
@@ -148,8 +147,8 @@ function syncCivilianProperties(civilian) {
} }
if (isGameFeatureSupported("pedScale")) { if (isGameFeatureSupported("pedScale")) {
if (doesEntityDataExist(civilian, "agrp.scale")) { if (doesEntityDataExist(civilian, "v.rp.scale")) {
let scaleFactor = getEntityData(civilian, "agrp.scale"); let scaleFactor = getEntityData(civilian, "v.rp.scale");
let tempMatrix = civilian.matrix; let tempMatrix = civilian.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = civilian.position; let tempPosition = civilian.position;
@@ -159,79 +158,79 @@ function syncCivilianProperties(civilian) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.fightStyle")) { if (doesEntityDataExist(civilian, "v.rp.fightStyle")) {
let fightStyle = getEntityData(civilian, "agrp.fightStyle"); let fightStyle = getEntityData(civilian, "v.rp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]); civilian.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "agrp.walkStyle")) { if (doesEntityDataExist(civilian, "v.rp.walkStyle")) {
let walkStyle = getEntityData(civilian, "agrp.walkStyle"); let walkStyle = getEntityData(civilian, "v.rp.walkStyle");
civilian.walkStyle = walkStyle; civilian.walkStyle = walkStyle;
} }
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair"); let bodyPropHair = getEntityData(civilian, "v.rp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHead")) {
let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead"); let bodyPropHead = getEntityData(civilian, "v.rp.bodyPropHead");
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes"); let bodyPropEyes = getEntityData(civilian, "v.rp.bodyPropEyes");
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(civilian, "v.rp.bodyPropLeftHand");
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand"); let bodyPropRightHand = getEntityData(civilian, "v.rp.bodyPropRightHand");
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(civilian, "v.rp.bodyPropLeftWrist");
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "v.rp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropHip")) {
let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip"); let bodyPropHip = getEntityData(civilian, "v.rp.bodyPropHip");
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(civilian, "v.rp.bodyPropLeftFoot");
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) { if (doesEntityDataExist(civilian, "v.rp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(civilian, "v.rp.bodyPropRightFoot");
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
if (doesEntityDataExist(civilian, "agrp.anim")) { if (doesEntityDataExist(civilian, "v.rp.anim")) {
let animationSlot = getEntityData(civilian, "agrp.anim"); let animationSlot = getEntityData(civilian, "v.rp.anim");
let animationData = getAnimationData(animationSlot); let animationData = getAnimationData(animationSlot);
civilian.addAnimation(animationData.groupId, animationData.animId); civilian.addAnimation(animationData.groupId, animationData.animId);
} }
@@ -245,8 +244,8 @@ function syncObjectProperties(object) {
} }
if (isGameFeatureSupported("objectScale")) { if (isGameFeatureSupported("objectScale")) {
if (doesEntityDataExist(object, "agrp.scale")) { if (doesEntityDataExist(object, "v.rp.scale")) {
let scaleFactor = getEntityData(object, "agrp.scale"); let scaleFactor = getEntityData(object, "v.rp.scale");
let tempMatrix = object.matrix; let tempMatrix = object.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = object.position; let tempPosition = object.position;
@@ -265,8 +264,8 @@ function syncPlayerProperties(player) {
} }
if (isGameFeatureSupported("pedScale")) { if (isGameFeatureSupported("pedScale")) {
if (doesEntityDataExist(player, "agrp.scale")) { if (doesEntityDataExist(player, "v.rp.scale")) {
let scaleFactor = getEntityData(player, "agrp.scale"); let scaleFactor = getEntityData(player, "v.rp.scale");
let tempMatrix = player.matrix; let tempMatrix = player.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = player.position; let tempPosition = player.position;
@@ -276,95 +275,95 @@ function syncPlayerProperties(player) {
} }
} }
if (getGame() == AGRP_GAME_GTA_SA) { if (getGame() == V_GAME_GTA_SA) {
if (doesEntityDataExist(player, "agrp.fightStyle")) { if (doesEntityDataExist(player, "v.rp.fightStyle")) {
let fightStyle = getEntityData(player, "agrp.fightStyle"); let fightStyle = getEntityData(player, "v.rp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]); player.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
//if(getGame() == AGRP_GAME_GTA_SA) { //if(getGame() == V_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "agrp.walkStyle")) { // if(doesEntityDataExist(player, "v.rp.walkStyle")) {
// let walkStyle = getEntityData(player, "agrp.walkStyle"); // let walkStyle = getEntityData(player, "v.rp.walkStyle");
// player.walkStyle = walkStyle; // player.walkStyle = walkStyle;
// } // }
//} //}
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPartHair")) { if (doesEntityDataExist(player, "v.rp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair"); let bodyPartHead = getEntityData(player, "v.rp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartHead")) { if (doesEntityDataExist(player, "v.rp.bodyPartHead")) {
let bodyPartHead = getEntityData(player, "agrp.bodyPartHead"); let bodyPartHead = getEntityData(player, "v.rp.bodyPartHead");
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartUpper")) { if (doesEntityDataExist(player, "v.rp.bodyPartUpper")) {
let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper"); let bodyPartUpper = getEntityData(player, "v.rp.bodyPartUpper");
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPartLower")) { if (doesEntityDataExist(player, "v.rp.bodyPartLower")) {
let bodyPartLower = getEntityData(player, "agrp.bodyPartLower"); let bodyPartLower = getEntityData(player, "v.rp.bodyPartLower");
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
} }
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
if (doesEntityDataExist(player, "agrp.bodyPropHair")) { if (doesEntityDataExist(player, "v.rp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair"); let bodyPropHair = getEntityData(player, "v.rp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropHead")) { if (doesEntityDataExist(player, "v.rp.bodyPropHead")) {
let bodyPropHead = getEntityData(player, "agrp.bodyPropHead"); let bodyPropHead = getEntityData(player, "v.rp.bodyPropHead");
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropEyes")) { if (doesEntityDataExist(player, "v.rp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes"); let bodyPropEyes = getEntityData(player, "v.rp.bodyPropEyes");
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(player, "v.rp.bodyPropLeftHand");
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand"); let bodyPropRightHand = getEntityData(player, "v.rp.bodyPropRightHand");
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(player, "v.rp.bodyPropLeftWrist");
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "v.rp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropHip")) { if (doesEntityDataExist(player, "v.rp.bodyPropHip")) {
let bodyPropHip = getEntityData(player, "agrp.bodyPropHip"); let bodyPropHip = getEntityData(player, "v.rp.bodyPropHip");
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) { if (doesEntityDataExist(player, "v.rp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(player, "v.rp.bodyPropLeftFoot");
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) { if (doesEntityDataExist(player, "v.rp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(player, "v.rp.bodyPropRightFoot");
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
@@ -378,20 +377,20 @@ function syncElementProperties(element) {
} }
if (isGameFeatureSupported("interior")) { if (isGameFeatureSupported("interior")) {
if (doesEntityDataExist(element, "agrp.interior")) { if (doesEntityDataExist(element, "v.rp.interior")) {
if (typeof element.interior != "undefined") { if (typeof element.interior != "undefined") {
element.interior = getEntityData(element, "agrp.interior"); element.interior = getEntityData(element, "v.rp.interior");
} }
} }
} }
if (isGameFeatureSupported("toggleCollision")) { if (isGameFeatureSupported("toggleCollision")) {
if (doesEntityDataExist(element, "agrp.collisions")) { if (doesEntityDataExist(element, "v.rp.collisions")) {
element.collisionsEnabled = getEntityData(element, "agrp.collisions"); element.collisionsEnabled = getEntityData(element, "v.rp.collisions");
} }
} }
if (getGame() == AGRP_GAME_MAFIA_ONE) { if (getGame() == V_GAME_MAFIA_ONE) {
switch (element.type) { switch (element.type) {
case ELEMENT_VEHICLE: case ELEMENT_VEHICLE:
syncVehicleProperties(element); syncVehicleProperties(element);
@@ -436,7 +435,7 @@ function syncElementProperties(element) {
// =========================================================================== // ===========================================================================
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { 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 // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: token.js // FILE: token.js
// DESC: Provides "remember me" auto-login token system and functions // DESC: Provides "remember me" auto-login token system and functions

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: utilities.js // FILE: utilities.js
// DESC: Provides util functions and arrays with data // 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})`); logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`);
controlsEnabled = controlState; controlsEnabled = controlState;
game.setPlayerControl(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)); 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); setElementCollisionsEnabled(localPlayer, controlState);
setPedInvincible(localPlayer, true); setPedInvincible(localPlayer, true);
} }
@@ -78,9 +77,9 @@ function setCityAmbienceState(state, clearElements = false) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`); logToConsole(LOG_DEBUG, `[AGRP.Utilities] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
game.setTrafficEnabled(state); game.setTrafficEnabled(state);
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { if (getMultiplayerMod() == V_MPMOD_GTAC) {
game.setGenerateCarsAroundCamera(state); game.setGenerateCarsAroundCamera(state);
if (getGame() != AGRP_GAME_GTA_SA) { if (getGame() != V_GAME_GTA_SA) {
game.setCiviliansEnabled(state); game.setCiviliansEnabled(state);
} }
@@ -98,7 +97,7 @@ function runClientCode(code, returnTo) {
try { try {
returnValue = eval("(" + code + ")"); returnValue = eval("(" + code + ")");
} catch (error) { } catch (error) {
sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString()); sendNetworkEventToServer("v.rp.runCodeFail", returnTo, error.toString());
return false; return false;
} }
let returnValueString = returnValue; let returnValueString = returnValue;
@@ -107,7 +106,7 @@ function runClientCode(code, returnTo) {
} else { } else {
returnValueString = "null/undefined"; returnValueString = "null/undefined";
} }
sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString); sendNetworkEventToServer("v.rp.runCodeSuccess", returnTo, returnValueString);
} }
// =========================================================================== // ===========================================================================
@@ -115,7 +114,7 @@ function runClientCode(code, returnTo) {
function enterVehicleAsPassenger() { function enterVehicleAsPassenger() {
if (localPlayer.vehicle == null) { if (localPlayer.vehicle == null) {
let tempVehicle = getClosestVehicle(localPlayer.position); let tempVehicle = getClosestVehicle(localPlayer.position);
if (getGame() != AGRP_GAME_GTA_IV) { if (getGame() != V_GAME_GTA_IV) {
if (tempVehicle != null) { if (tempVehicle != null) {
localPlayer.enterVehicle(tempVehicle, false); localPlayer.enterVehicle(tempVehicle, false);
} }
@@ -137,13 +136,13 @@ function enterVehicleAsPassenger() {
function giveLocalPlayerWeapon(weaponId, ammo, active) { function giveLocalPlayerWeapon(weaponId, ammo, active) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`); logToConsole(LOG_DEBUG, `[AGRP.Utilities] Giving weapon ${weaponId} with ${ammo} ammo`);
forceWeapon = weaponId; forceWeapon = weaponId;
if (getGame() == AGRP_GAME_MAFIA_ONE) { if (getGame() == V_GAME_MAFIA_ONE) {
localPlayer.giveWeapon(weaponId, 0, ammo); localPlayer.giveWeapon(weaponId, 0, ammo);
forceWeaponAmmo = 0; forceWeaponAmmo = 0;
forceWeaponClipAmmo = ammo; forceWeaponClipAmmo = ammo;
} else { } else {
localPlayer.giveWeapon(weaponId, ammo, active); localPlayer.giveWeapon(weaponId, ammo, active);
if (getGame() < AGRP_GAME_GTA_IV) { if (getGame() < V_GAME_GTA_IV) {
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId)); forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(weaponId));
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId)); forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(weaponId));
} else { } else {
@@ -197,7 +196,7 @@ function setLocalPlayerHeading(heading) {
function setLocalPlayerInterior(interior) { function setLocalPlayerInterior(interior) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting interior to ${interior}`); logToConsole(LOG_DEBUG, `[AGRP.Utilities] Setting interior to ${interior}`);
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) { if (getMultiplayerMod() == V_MPMOD_GTAC) {
if (!isGTAIV()) { if (!isGTAIV()) {
localPlayer.interior = interior; localPlayer.interior = interior;
game.cameraInterior = interior; game.cameraInterior = interior;
@@ -215,8 +214,8 @@ function setLocalPlayerInterior(interior) {
if (areServerElementsSupported() && isGameFeatureSupported("interior")) { if (areServerElementsSupported() && isGameFeatureSupported("interior")) {
let vehicles = getElementsByType(ELEMENT_VEHICLE); let vehicles = getElementsByType(ELEMENT_VEHICLE);
for (let i in vehicles) { for (let i in vehicles) {
if (getEntityData(vehicles[i], "agrp.interior")) { if (getEntityData(vehicles[i], "v.rp.interior")) {
vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior"); vehicles[i].interior = getEntityData(vehicles[i], "v.rp.interior");
} }
} }
} }
@@ -246,7 +245,7 @@ function setLocalPlayerHealth(health) {
function playPedSpeech(pedName, speechId) { function playPedSpeech(pedName, speechId) {
logToConsole(LOG_DEBUG, `[AGRP.Utilities] Making ${pedName}'s ped talk (${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); game.SET_CHAR_SAY(int, int);
} }
} }
@@ -267,7 +266,7 @@ function getWeaponSlot(weaponId) {
// =========================================================================== // ===========================================================================
function setLocalPlayerDrunkEffect(amount, duration) { 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`); logToConsole(LOG_DEBUG, `[AGRP.Utilities] Drunk effect set to ${amount} for ${duration} ms`);
drunkEffectAmount = 0; drunkEffectAmount = 0;
drunkEffectDurationTimer = setInterval(function () { drunkEffectDurationTimer = setInterval(function () {
@@ -400,8 +399,8 @@ function processWantedLevelReset() {
function processLocalPlayerVehicleControlState() { function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
if (localPlayer.vehicle != null) { if (localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) { if (doesEntityDataExist(localPlayer.vehicle, "v.rp.engine")) {
if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) { if (getEntityData(localPlayer.vehicle, "v.rp.engine") == false) {
localPlayer.vehicle.engine = false; localPlayer.vehicle.engine = false;
//localPlayer.vehicle.netFlags.sendSync = false; //localPlayer.vehicle.netFlags.sendSync = false;
if (!localPlayer.vehicle.engine) { if (!localPlayer.vehicle.engine) {
@@ -430,12 +429,12 @@ function forceLocalPlayerEquippedWeaponItem() {
if (forceWeapon != 0) { if (forceWeapon != 0) {
if (localPlayer.weapon != forceWeapon) { if (localPlayer.weapon != forceWeapon) {
localPlayer.weapon = forceWeapon; localPlayer.weapon = forceWeapon;
if (getGame() < AGRP_GAME_GTA_IV) { if (getGame() < V_GAME_GTA_IV) {
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo); localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo); localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
} }
} else { } else {
//if(getGame() < AGRP_GAME_GTA_IV) { //if(getGame() < V_GAME_GTA_IV) {
// forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); // forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
// forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); // forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
//} //}
@@ -462,7 +461,7 @@ function getLocalPlayerPosition() {
// =========================================================================== // ===========================================================================
function getVehicleForNetworkEvent(vehicle) { function getVehicleForNetworkEvent(vehicle) {
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
return natives.getNetworkIdFromVehicle(vehicle); return natives.getNetworkIdFromVehicle(vehicle);
} }
return vehicle.id; return vehicle.id;
@@ -534,7 +533,7 @@ function processNearbyPickups() {
//if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) { //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
if (currentPickup != pickups[i]) { if (currentPickup != pickups[i]) {
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() { function processGameSpecifics() {
if (getGame() < AGRP_GAME_GTA_IV) { if (getGame() < V_GAME_GTA_IV) {
game.clearMessages(); game.clearMessages();
} }
@@ -604,7 +603,7 @@ function updateLocalPlayerMoney() {
localPlayer.money = toInteger(localPlayerMoney); localPlayer.money = toInteger(localPlayerMoney);
} }
if (getGame() == AGRP_GAME_GTA_IV) { if (getGame() == V_GAME_GTA_IV) {
natives.setMultiplayerHudCash(localPlayerMoney); natives.setMultiplayerHudCash(localPlayerMoney);
} }
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: vehicle.js // FILE: vehicle.js
// DESC: Provides vehicle functions and arrays with data // 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 = "") { 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`); 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; return false;
} }
@@ -64,20 +63,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
// =========================================================================== // ===========================================================================
function processVehiclePurchasing() { function processVehiclePurchasing() {
if (vehiclePurchaseState == AGRP_VEHBUYSTATE_TESTDRIVE) { if (vehiclePurchaseState == V_VEHBUYSTATE_TESTDRIVE) {
if (getLocalPlayerVehicle() == false) { if (getLocalPlayerVehicle() == false) {
vehiclePurchaseState = AGRP_VEHBUYSTATE_EXITVEH; vehiclePurchaseState = V_VEHBUYSTATE_EXITVEH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_EXITVEH); sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_EXITVEH);
return false; return false;
} else { } else {
if (vehiclePurchasing == getLocalPlayerVehicle()) { if (vehiclePurchasing == getLocalPlayerVehicle()) {
if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) { if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
vehiclePurchaseState = AGRP_VEHBUYSTATE_FARENOUGH; vehiclePurchaseState = V_VEHBUYSTATE_FARENOUGH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_FARENOUGH); sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_FARENOUGH);
} }
} else { } else {
vehiclePurchaseState = AGRP_VEHBUYSTATE_WRONGVEH; vehiclePurchaseState = V_VEHBUYSTATE_WRONGVEH;
sendNetworkEventToServer("agrp.vehBuyState", AGRP_VEHBUYSTATE_WRONGVEH); sendNetworkEventToServer("v.rp.vehBuyState", V_VEHBUYSTATE_WRONGVEH);
} }
} }
} }
@@ -154,7 +153,7 @@ function getVehicleSpeed(vehicle) {
speed = getLength(vecMoveSpeed[0], vecMoveSpeed[1], vecMoveSpeed[2]); 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; speed /= 40.0;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: accent.js // FILE: accent.js
// DESC: Provides accent functions and usage // DESC: Provides accent functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: account.js // FILE: account.js
// DESC: Provides account functions and usage // DESC: Provides account functions and usage
@@ -9,35 +8,35 @@
// =========================================================================== // ===========================================================================
// Account Contact Types // Account Contact Types
const AGRP_CONTACT_NONE = 0; const V_CONTACT_NONE = 0;
const AGRP_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features const V_CONTACT_NEUTRAL = 1; // Contact is neutral. Used for general contacts with no special additional features
const AGRP_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online. const V_CONTACT_FRIEND = 2; // Contact is a friend. Shows when they're online.
const AGRP_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP const V_CONTACT_BLOCKED = 3; // Contact is blocked. Prevents all communication to/from them except for RP
// =========================================================================== // ===========================================================================
// Account Authentication Methods // Account Authentication Methods
const AGRP_ACCT_AUTHMETHOD_NONE = 0; // None const V_ACCT_AUTHMETHOD_NONE = 0; // None
const AGRP_ACCT_AUTHMETHOD_EMAIL = 1; // Email const V_ACCT_AUTHMETHOD_EMAIL = 1; // Email
const AGRP_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number const V_ACCT_AUTHMETHOD_PHONENUM = 2; // Phone number
const AGRP_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc) const V_ACCT_AUTHMETHOD_2FA = 3; // Two factor authentication app (authy, google authenticator, etc)
const AGRP_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use) const V_ACCT_AUTHMETHOD_PEBBLE = 4; // Pebble watch (this one's for Vortrex but anybody with a Pebble can use)
const AGRP_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created) const V_ACCT_AUTHMETHOD_PHONEAPP = 5; // The Android/iOS companion app (will initially be a web based thing until I can get the apps created)
// =========================================================================== // ===========================================================================
// Two-Factor Authentication States // Two-Factor Authentication States
const AGRP_2FA_STATE_NONE = 0; // None const V_2FA_STATE_NONE = 0; // None
const AGRP_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play const V_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter code to play
const AGRP_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app const V_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
const AGRP_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up const V_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
// =========================================================================== // ===========================================================================
// Reset Password States // Reset Password States
const AGRP_RESETPASS_STATE_NONE = 0; // None const V_RESETPASS_STATE_NONE = 0; // None
const AGRP_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email const V_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
const AGRP_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password const V_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
// =========================================================================== // ===========================================================================
@@ -866,7 +865,7 @@ function loginSuccess(client) {
if (getPlayerData(client).subAccounts.length == 0) { if (getPlayerData(client).subAccounts.length == 0) {
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR; getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`); logToConsole(LOG_DEBUG, `[AGRP.Account] ${getPlayerDisplayForConsole(client)} is being shown the no characters prompt GUI`);
} else { } else {
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`)); messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
@@ -1283,7 +1282,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) { if (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client)) {
showPlayerRegistrationSuccessGUI(client); showPlayerRegistrationSuccessGUI(client);
showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "NoCharactersGUIMessage"), getLocaleString(client, "NoCharactersGUIWindowTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_CREATEFIRSTCHAR; getPlayerData(client).promptType = V_PROMPT_CREATEFIRSTCHAR;
} else { } else {
messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`)); messagePlayerAlert(client, getLocaleString(client, "NoCharactersChatMessage", `{ALTCOLOUR}/newchar{MAINCOLOUR}`));
} }
@@ -1298,7 +1297,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
} }
switch (getPlayerData(client).passwordResetState) { switch (getPlayerData(client).passwordResetState) {
case AGRP_RESETPASS_STATE_EMAILCONFIRM: { case V_RESETPASS_STATE_EMAILCONFIRM: {
if (toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) { if (toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) {
logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`); logToConsole(LOG_INFO | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`);
showPlayerErrorGUI(client, getLocaleString(client, "GUIErrorResetPasswordFailedInvalidEmail"), getLocaleString(client, "GUIErrorTitle"), getLocaleString(client, "GUIOkButton")); showPlayerErrorGUI(client, getLocaleString(client, "GUIErrorResetPasswordFailedInvalidEmail"), getLocaleString(client, "GUIErrorTitle"), getLocaleString(client, "GUIOkButton"));
@@ -1306,7 +1305,7 @@ function checkAccountResetPasswordRequest(client, inputText) {
} }
let passwordResetCode = toUpperCase(generateEmailVerificationCode()); let passwordResetCode = toUpperCase(generateEmailVerificationCode());
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_CODEINPUT; getPlayerData(client).passwordResetState = V_RESETPASS_STATE_CODEINPUT;
getPlayerData(client).passwordResetCode = passwordResetCode; getPlayerData(client).passwordResetCode = passwordResetCode;
showPlayerResetPasswordCodeInputGUI(client); showPlayerResetPasswordCodeInputGUI(client);
sendPasswordResetEmail(client, passwordResetCode); sendPasswordResetEmail(client, passwordResetCode);
@@ -1314,11 +1313,11 @@ function checkAccountResetPasswordRequest(client, inputText) {
break; break;
} }
case AGRP_RESETPASS_STATE_CODEINPUT: { case V_RESETPASS_STATE_CODEINPUT: {
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} submitted code for password reset (${inputText}) ...`); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} submitted code for password reset (${inputText}) ...`);
if (inputText != "") { if (inputText != "") {
if (getPlayerData(client).passwordResetCode == toUpperCase(inputText)) { if (getPlayerData(client).passwordResetCode == toUpperCase(inputText)) {
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_SETPASS; getPlayerData(client).passwordResetState = V_RESETPASS_STATE_SETPASS;
showPlayerChangePasswordGUI(client); showPlayerChangePasswordGUI(client);
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} entered the correct reset password verification code. Awaiting new password input ...`);
} else { } else {
@@ -1335,10 +1334,10 @@ function checkAccountResetPasswordRequest(client, inputText) {
break; break;
} }
case AGRP_RESETPASS_STATE_NONE: { case V_RESETPASS_STATE_NONE: {
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} requested a password reset. Awaiting email input ...`);
showPlayerResetPasswordEmailInputGUI(client); showPlayerResetPasswordEmailInputGUI(client);
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_EMAILCONFIRM; getPlayerData(client).passwordResetState = V_RESETPASS_STATE_EMAILCONFIRM;
break; break;
} }
} }
@@ -1350,8 +1349,8 @@ function checkAccountResetPasswordRequest(client, inputText) {
function checkAccountChangePassword(client, newPassword, confirmNewPassword) { function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
if (!isPlayerLoggedIn(client)) { if (!isPlayerLoggedIn(client)) {
if (getPlayerData(client).passwordResetState != AGRP_RESETPASS_STATE_SETPASS) { if (getPlayerData(client).passwordResetState != V_RESETPASS_STATE_SETPASS) {
//getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; //getPlayerData(client).passwordResetState = V_RESETPASS_STATE_NONE;
//disconnectPlayer(client); //disconnectPlayer(client);
logToConsole(LOG_DEBUG | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to change their password (not logged in or not using reset password)`); logToConsole(LOG_DEBUG | LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to change their password (not logged in or not using reset password)`);
return false; return false;
@@ -1387,8 +1386,8 @@ function checkAccountChangePassword(client, newPassword, confirmNewPassword) {
saveAccountToDatabase(getPlayerData(client).accountData); saveAccountToDatabase(getPlayerData(client).accountData);
if (getPlayerData(client).passwordResetState == AGRP_RESETPASS_STATE_SETPASS) { if (getPlayerData(client).passwordResetState == V_RESETPASS_STATE_SETPASS) {
getPlayerData(client).passwordResetState = AGRP_RESETPASS_STATE_NONE; getPlayerData(client).passwordResetState = V_RESETPASS_STATE_NONE;
} }
messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged")); messagePlayerSuccess(client, getLocaleString(client, "PasswordChanged"));
@@ -1429,7 +1428,7 @@ function savePlayerToDatabase(client) {
//let subAccountData = getPlayerCurrentSubAccount(client); //let subAccountData = getPlayerCurrentSubAccount(client);
if (getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != AGRP_RETURNTO_TYPE_ADMINGET) { if (getPlayerData(client).returnToPosition != null && getPlayerData(client).returnToType != V_RETURNTO_TYPE_ADMINGET) {
getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition; getPlayerCurrentSubAccount(client).spawnPosition = getPlayerData(client).returnToPosition;
getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z; getPlayerCurrentSubAccount(client).spawnHeading = getPlayerData(client).returnToHeading.z;
getPlayerCurrentSubAccount(client).interior = getPlayerData(client).returnToInterior; getPlayerCurrentSubAccount(client).interior = getPlayerData(client).returnToInterior;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: animation.js // FILE: animation.js
// DESC: Provides animation functions and usage // DESC: Provides animation functions and usage
@@ -35,8 +34,8 @@ function playPlayerAnimationCommand(command, params, client) {
return false; return false;
} }
if (getAnimationData(animationSlot)[3] == AGRP_ANIMTYPE_SURRENDER) { if (getAnimationData(animationSlot)[3] == V_ANIMTYPE_SURRENDER) {
getPlayerData(client).pedState = AGRP_PEDSTATE_HANDSUP; getPlayerData(client).pedState = V_PEDSTATE_HANDSUP;
} }
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) { if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
@@ -106,9 +105,9 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
} }
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition); makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
//setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true); //setEntityData(getPlayerPed(client), "v.rp.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != AGRP_ANIMMOVE_NONE) { //if(getAnimationData(animationSlot)[9] != V_ANIMMOVE_NONE) {
// if(getGame() < AGRP_GAME_GTA_SA) { // if(getGame() < V_GAME_GTA_SA) {
// setPlayerMouseCameraState(client, true); // setPlayerMouseCameraState(client, true);
// } // }
//} //}

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: anticheat.js // FILE: anticheat.js
// DESC: Provides anticheat functions and usage // DESC: Provides anticheat functions and usage
@@ -16,10 +15,10 @@ function initAntiCheatScript() {
// =========================================================================== // ===========================================================================
function clearPlayerStateToEnterExitProperty(client) { function clearPlayerStateToEnterExitProperty(client) {
if (getPlayerData(client).pedState != AGRP_PEDSTATE_READY) { if (getPlayerData(client).pedState != V_PEDSTATE_READY) {
if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGVEHICLE) { if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGVEHICLE) {
sendPlayerClearPedState(client); sendPlayerClearPedState(client);
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
} else { } else {
return false; return false;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: bans.js // FILE: bans.js
// DESC: Provides ban functions and usage // DESC: Provides ban functions and usage
@@ -9,18 +8,18 @@
// =========================================================================== // ===========================================================================
// Ban Types // Ban Types
const AGRP_BANTYPE_NONE = 0; const V_BANTYPE_NONE = 0;
const AGRP_BANTYPE_ACCOUNT = 1; const V_BANTYPE_ACCOUNT = 1;
const AGRP_BANTYPE_SUBACCOUNT = 2; const V_BANTYPE_SUBACCOUNT = 2;
const AGRP_BANTYPE_IPADDRESS = 3; const V_BANTYPE_IPADDRESS = 3;
const AGRP_BANTYPE_SUBNET = 4; const V_BANTYPE_SUBNET = 4;
// =========================================================================== // ===========================================================================
class BanData { class BanData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0; this.databaseId = 0;
this.type = AGRP_BANTYPE_NONE; this.type = V_BANTYPE_NONE;
this.detail = ""; this.detail = "";
this.ipAddress = ""; this.ipAddress = "";
this.name = ""; this.name = "";
@@ -175,7 +174,7 @@ function banAccount(accountId, adminAccountId, reason) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason); let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -190,7 +189,7 @@ function banSubAccount(subAccountId, adminAccountId, reason) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason); let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -205,7 +204,7 @@ function banIPAddress(ipAddress, adminAccountId, reason) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason); let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -220,7 +219,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason); let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${V_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -234,7 +233,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
function unbanAccount(accountId, adminAccountId) { function unbanAccount(accountId, adminAccountId) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -248,7 +247,7 @@ function unbanAccount(accountId, adminAccountId) {
function unbanSubAccount(subAccountId, adminAccountId) { function unbanSubAccount(subAccountId, adminAccountId) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -262,7 +261,7 @@ function unbanSubAccount(subAccountId, adminAccountId) {
function unbanIPAddress(ipAddress, adminAccountId) { function unbanIPAddress(ipAddress, adminAccountId) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`); let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -276,7 +275,7 @@ function unbanIPAddress(ipAddress, adminAccountId) {
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) { function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
if (dbConnection) { if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${AGRP_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`); let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${V_BANTYPE_SUBNET} AND ban_ip_start=INET_ATON(${ipAddressStart}) AND ban_ip_end=INET_ATON(${ipAddressEnd})`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -288,7 +287,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
// =========================================================================== // ===========================================================================
function isAccountBanned(accountId) { function isAccountBanned(accountId) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_ACCOUNT && ban.detail === accountId); let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_ACCOUNT && ban.detail === accountId);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }
@@ -299,7 +298,7 @@ function isAccountBanned(accountId) {
// =========================================================================== // ===========================================================================
function isSubAccountBanned(subAccountId) { function isSubAccountBanned(subAccountId) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_SUBACCOUNT && ban.detail === subAccountId); let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }
@@ -310,7 +309,7 @@ function isSubAccountBanned(subAccountId) {
// =========================================================================== // ===========================================================================
function isIpAddressBanned(ipAddress) { function isIpAddressBanned(ipAddress) {
let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_IPADDRESS && ban.detail === ipAddress); let bans = getServerData().bans.filter(ban => ban.type === V_BANTYPE_IPADDRESS && ban.detail === ipAddress);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: bank.js // FILE: bank.js
// DESC: Provides banking functions and usage // DESC: Provides banking functions and usage
@@ -9,13 +8,13 @@
// =========================================================================== // ===========================================================================
// House Owner Types // House Owner Types
const AGRP_BANK_ACCT_OWNER_NONE = 0; // Not owned const V_BANK_ACCT_OWNER_NONE = 0; // Not owned
const AGRP_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) const V_BANK_ACCT_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const AGRP_BANK_ACCT_OWNER_JOB = 2; // Owned by a job const V_BANK_ACCT_OWNER_JOB = 2; // Owned by a job
const AGRP_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan const V_BANK_ACCT_OWNER_CLAN = 3; // Owned by a clan
const AGRP_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction const V_BANK_ACCT_OWNER_FACTION = 4; // Owned by a faction
const AGRP_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction const V_BANK_ACCT_OWNER_BIZ = 4; // Owned by a faction
const AGRP_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used. const V_BANK_ACCT_OWNER_PUBLIC = 5; // Is a public bank account. Technically not owned. This probably won't be used.
// =========================================================================== // ===========================================================================
@@ -26,7 +25,7 @@ function isPlayerAtBank(client) {
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
if (getBusinessData(client) != false) { if (getBusinessData(client) != false) {
if (getBusinessData(businessId).type == AGRP_BIZ_TYPE_BANK) { if (getBusinessData(businessId).type == V_BIZ_TYPE_BANK) {
return true; return true;
} }
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: bitflags.js // FILE: bitflags.js
// DESC: Provides bitwise operations, functions and usage // DESC: Provides bitwise operations, functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: business.js // FILE: business.js
// DESC: Provides business functions and usage // DESC: Provides business functions and usage
@@ -9,34 +8,34 @@
// =========================================================================== // ===========================================================================
// Business Types // Business Types
const AGRP_BIZ_TYPE_NONE = 0; // None (invalid) const V_BIZ_TYPE_NONE = 0; // None (invalid)
const AGRP_BIZ_TYPE_NORMAL = 1; // Normal business (sells items) const V_BIZ_TYPE_NORMAL = 1; // Normal business (sells items)
const AGRP_BIZ_TYPE_BANK = 2; // Bank const V_BIZ_TYPE_BANK = 2; // Bank
const AGRP_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc) const V_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
const AGRP_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter const V_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
const AGRP_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc) const V_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
// =========================================================================== // ===========================================================================
// Business Location Types // Business Location Types
const AGRP_BIZ_LOC_NONE = 0; // None const V_BIZ_LOC_NONE = 0; // None
const AGRP_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz const V_BIZ_LOC_GATE = 1; // Center of any moveable gate that belongs to the biz
const AGRP_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped const V_BIZ_LOC_GARAGE = 2; // Location for attached garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
const AGRP_BIZ_LOC_FUEL = 3; // Fuel pump const V_BIZ_LOC_FUEL = 3; // Fuel pump
const AGRP_BIZ_LOC_DRIVETHRU = 4; // Drivethrough const V_BIZ_LOC_DRIVETHRU = 4; // Drivethrough
const AGRP_BIZ_LOC_VENDMACHINE = 5; // Vending machine const V_BIZ_LOC_VENDMACHINE = 5; // Vending machine
const AGRP_BIZ_LOC_ATM = 6; // ATM const V_BIZ_LOC_ATM = 6; // ATM
const AGRP_BIZ_LOC_PAYPHONE = 7; // Payphone const V_BIZ_LOC_PAYPHONE = 7; // Payphone
// =========================================================================== // ===========================================================================
// Business Owner Types // Business Owner Types
const AGRP_BIZ_OWNER_NONE = 0; // Not owned const V_BIZ_OWNER_NONE = 0; // Not owned
const AGRP_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount) const V_BIZ_OWNER_PLAYER = 1; // Owned by a player (character/subaccount)
const AGRP_BIZ_OWNER_JOB = 2; // Owned by a job const V_BIZ_OWNER_JOB = 2; // Owned by a job
const AGRP_BIZ_OWNER_CLAN = 3; // Owned by a clan const V_BIZ_OWNER_CLAN = 3; // Owned by a clan
const AGRP_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment) const V_BIZ_OWNER_FACTION = 4; // Owned by a faction (not used at the moment)
const AGRP_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc const V_BIZ_OWNER_PUBLIC = 5; // Public Business. Used for goverment/official places like police, fire, city hall, DMV, etc
// =========================================================================== // ===========================================================================
@@ -50,7 +49,7 @@ class BusinessData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0; this.databaseId = 0;
this.name = ""; this.name = "";
this.ownerType = AGRP_BIZ_OWNER_NONE; this.ownerType = V_BIZ_OWNER_NONE;
this.ownerId = 0; this.ownerId = 0;
this.buyPrice = 0; this.buyPrice = 0;
this.locked = false; this.locked = false;
@@ -58,8 +57,8 @@ class BusinessData {
this.index = -1; this.index = -1;
this.needsSaved = false; this.needsSaved = false;
this.interiorLights = true; this.interiorLights = true;
this.type = AGRP_BIZ_TYPE_NONE; this.type = V_BIZ_TYPE_NONE;
this.propertyType = AGRP_PROPERTY_TYPE_BUSINESS; this.propertyType = V_PROPERTY_TYPE_BUSINESS;
this.floorItemCache = []; this.floorItemCache = [];
this.storageItemCache = []; this.storageItemCache = [];
@@ -94,7 +93,7 @@ class BusinessData {
this.paintBallPlayers = []; this.paintBallPlayers = [];
this.labelHelpType = AGRP_PROPLABEL_INFO_NONE; this.labelHelpType = V_PROPLABEL_INFO_NONE;
if (dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["biz_id"]); this.databaseId = toInteger(dbAssoc["biz_id"]);
@@ -461,7 +460,7 @@ function setBusinessNameCommand(command, params, client) {
let oldBusinessName = getBusinessData(businessId).name; let oldBusinessName = getBusinessData(businessId).name;
getBusinessData(businessId).name = newBusinessName; getBusinessData(businessId).name = newBusinessName;
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true);
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`, true);
} }
@@ -501,7 +500,7 @@ function setBusinessOwnerCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PLAYER; getBusinessData(businessId).ownerType = V_BIZ_OWNER_PLAYER;
getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId; getBusinessData(businessId).ownerId = getPlayerCurrentSubAccount(newBusinessOwner).databaseId;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
@@ -543,7 +542,7 @@ function setBusinessJobCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
@@ -576,7 +575,7 @@ function setBusinessClanCommand(command, params, client) {
return false; return false;
} }
if (getBusinessData(business).ownerType != AGRP_VEHOWNER_PLAYER) { if (getBusinessData(business).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnBusiness")); messagePlayerError(client, getLocaleString(client, "MustOwnBusiness"));
return false; return false;
} }
@@ -588,9 +587,9 @@ function setBusinessClanCommand(command, params, client) {
// Use confirm prompt // Use confirm prompt
showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "SetBusinessClanConfirmMessage"), getLocaleString(client, "SetBusinessClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_GIVEBIZTOCLAN; getPlayerData(client).promptType = V_PROMPT_GIVEBIZTOCLAN;
//getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_CLAN; //getBusinessData(businessId).ownerType = V_BIZ_OWNER_CLAN;
//getBusinessData(businessId).ownerId = getClanData(clanId).databaseId; //getBusinessData(businessId).ownerId = getClanData(clanId).databaseId;
//getBusinessData(businessId).needsSaved = true; //getBusinessData(businessId).needsSaved = true;
} }
@@ -621,7 +620,7 @@ function setBusinessRankCommand(command, params, client) {
return false; return false;
} }
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_CLAN) { if (getVehicleData(vehicle).ownerType == V_VEHOWNER_CLAN) {
let clanId = getClanIndexFromDatabaseId(getBusinessData(businessId).ownerId); let clanId = getClanIndexFromDatabaseId(getBusinessData(businessId).ownerId);
rankId = getClanRankFromParams(clanId, params); rankId = getClanRankFromParams(clanId, params);
if (!getClanRankData(clanId, rankId)) { if (!getClanRankData(clanId, rankId)) {
@@ -630,7 +629,7 @@ function setBusinessRankCommand(command, params, client) {
} }
getBusinessData(businessId).rank = getClanRankData(clanId, rankId).databaseId; getBusinessData(businessId).rank = getClanRankData(clanId, rankId).databaseId;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${getClanRankData(clanId, rankId).name} {MAINCOLOUR}of the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
} else if (getBusinessData(businessId).ownerType == AGRP_VEHOWNER_JOB) { } else if (getBusinessData(businessId).ownerType == V_VEHOWNER_JOB) {
getBusinessData(businessId).rank = rankId; getBusinessData(businessId).rank = rankId;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getBusinessData(businessId).ownerId)).name} {MAINCOLOUR}job!`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}rank to {ALTCOLOUR}${rankId} {MAINCOLOUR}of the {jobYellow}${getJobData(getJobIdFromDatabaseId(getBusinessData(businessId).ownerId)).name} {MAINCOLOUR}job!`);
} }
@@ -727,7 +726,7 @@ function setBusinessJobCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_JOB; getBusinessData(businessId).ownerType = V_BIZ_OWNER_JOB;
getBusinessData(businessId).ownerId = getJobData(jobId).databaseId; getBusinessData(businessId).ownerId = getJobData(jobId).databaseId;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
@@ -757,7 +756,7 @@ function setBusinessPublicCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_PUBLIC; getBusinessData(businessId).ownerType = V_BIZ_OWNER_PUBLIC;
getBusinessData(businessId).ownerId = 0; getBusinessData(businessId).ownerId = 0;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
@@ -787,7 +786,7 @@ function removeBusinessOwnerCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).ownerType = AGRP_BIZ_OWNER_NONE; getBusinessData(businessId).ownerType = V_BIZ_OWNER_NONE;
getBusinessData(businessId).ownerId = -1; getBusinessData(businessId).ownerId = -1;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
@@ -880,7 +879,7 @@ function setBusinessPaintBallCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).type = AGRP_BIZ_TYPE_PAINTBALL; getBusinessData(businessId).type = V_BIZ_TYPE_PAINTBALL;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall")); messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
} }
@@ -912,24 +911,24 @@ function getBusinessInfoCommand(command, params, client) {
let ownerName = "Unknown"; let ownerName = "Unknown";
switch (businessData.ownerType) { switch (businessData.ownerType) {
case AGRP_BIZ_OWNER_CLAN: case V_BIZ_OWNER_CLAN:
ownerName = getClanData(businessData.ownerId).name; ownerName = getClanData(businessData.ownerId).name;
break; break;
case AGRP_BIZ_OWNER_JOB: case V_BIZ_OWNER_JOB:
ownerName = getJobData(businessData.ownerId).name; ownerName = getJobData(businessData.ownerId).name;
break; break;
case AGRP_BIZ_OWNER_PLAYER: case V_BIZ_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(businessData.ownerId); let subAccountData = loadSubAccountFromId(businessData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
break; break;
case AGRP_BIZ_OWNER_PUBLIC: case V_BIZ_OWNER_PUBLIC:
ownerName = "Public"; ownerName = "Public";
break; break;
case AGRP_BIZ_OWNER_NONE: case V_BIZ_OWNER_NONE:
//submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`); //submitBugReport(client, `[AUTOMATED REPORT] getBusinessInfoCommand() - Invalid ownerType for business ${businessId}/${getBusinessData(businessId).databaseId}`);
ownerName = "None"; ownerName = "None";
break; break;
@@ -1295,7 +1294,7 @@ function giveDefaultItemsToBusinessCommand(command, params, client) {
let itemTypeId = getItemTypeFromParams(getGameConfig().defaultBusinessItems[getGame()][typeParam][i][0]); let itemTypeId = getItemTypeFromParams(getGameConfig().defaultBusinessItems[getGame()][typeParam][i][0]);
let itemTypeData = getItemTypeData(itemTypeId); let itemTypeData = getItemTypeData(itemTypeId);
if (itemTypeData) { if (itemTypeData) {
let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, AGRP_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]); let newItemIndex = createItem(itemTypeId, itemTypeData.orderValue, V_ITEM_OWNER_BIZFLOOR, getBusinessData(businessId).databaseId, getGameConfig().defaultBusinessItems[getGame()][typeParam][i][1]);
getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2]; getItemData(newItemIndex).buyPrice = applyServerInflationMultiplier(itemTypeData.orderPrice) * getGameConfig().defaultBusinessItems[getGame()][typeParam][i][2];
} }
} }
@@ -1324,8 +1323,8 @@ function setBusinessDealershipCommand(command, params, client) {
return false; return false;
} }
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE; getBusinessData(businessId).labelHelpType == V_PROPLABEL_INFO_ENTERVEHICLE;
getBusinessData(businessId).type = AGRP_BIZ_TYPE_DEALERSHIP; getBusinessData(businessId).type = V_BIZ_TYPE_DEALERSHIP;
updateBusinessPickupLabelData(businessId); updateBusinessPickupLabelData(businessId);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the type of business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`, true);
} }
@@ -1469,7 +1468,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
} }
getBusinessData(businessId).buyPrice = amount; getBusinessData(businessId).buyPrice = amount;
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true);
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
@@ -1569,7 +1568,7 @@ function orderItemForBusinessCommand(command, params, client) {
let orderTotalCost = pricePerItem * amount; let orderTotalCost = pricePerItem * amount;
//getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; //getPlayerData(client).promptType = V_PROMPT_BIZORDER;
getPlayerData(client).businessOrderAmount = amount; getPlayerData(client).businessOrderAmount = amount;
getPlayerData(client).businessOrderBusiness = businessId; getPlayerData(client).businessOrderBusiness = businessId;
getPlayerData(client).businessOrderItem = itemType; getPlayerData(client).businessOrderItem = itemType;
@@ -1577,7 +1576,7 @@ function orderItemForBusinessCommand(command, params, client) {
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost"); showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; getPlayerData(client).promptType = V_PROMPT_BIZORDER;
} }
// =========================================================================== // ===========================================================================
@@ -1664,7 +1663,7 @@ function buyBusinessCommand(command, params, client) {
} }
showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "BuyBusinessConfirmMessage"), getLocaleString(client, "BuyBusinessConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_BUYBIZ; getPlayerData(client).promptType = V_PROMPT_BUYBIZ;
} }
// =========================================================================== // ===========================================================================
@@ -2022,7 +2021,7 @@ function createBusinessEntrancePickup(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`); logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance pickup for business ${businessData.name}`);
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null; let entrancePickup = null;
if (isGameFeatureSupported("pickup")) { if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].Business; let pickupModelId = getGameConfig().pickupModels[getGame()].Business;
@@ -2099,7 +2098,7 @@ function createBusinessEntranceBlip(businessId) {
logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`); logToConsole(LOG_VERBOSE, `[AGRP.Job]: Creating entrance blip for business ${businessData.name} (model ${blipModelId})`);
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue")); let entranceBlip = createGameBlip(businessData.entrancePosition, blipModelId, 1, getColourByType("businessBlue"));
if (entranceBlip != null) { if (entranceBlip != null) {
if (businessData.entranceDimension != -1) { if (businessData.entranceDimension != -1) {
@@ -2350,17 +2349,17 @@ function exitBusiness(client) {
*/ */
function getBusinessOwnerTypeText(ownerType) { function getBusinessOwnerTypeText(ownerType) {
switch (ownerType) { switch (ownerType) {
case AGRP_BIZ_OWNER_CLAN: case V_BIZ_OWNER_CLAN:
return "clan"; return "clan";
case AGRP_BIZ_OWNER_JOB: case V_BIZ_OWNER_JOB:
return "job"; return "job";
case AGRP_BIZ_OWNER_PLAYER: case V_BIZ_OWNER_PLAYER:
return "player"; return "player";
case AGRP_BIZ_OWNER_NONE: case V_BIZ_OWNER_NONE:
case AGRP_BIZ_OWNER_PUBLIC: case V_BIZ_OWNER_PUBLIC:
return "not owned"; return "not owned";
default: default:
@@ -2538,7 +2537,7 @@ function setBusinessDataIndexes() {
//} //}
for (let j in getServerData().businesses[i].locations) { for (let j in getServerData().businesses[i].locations) {
if (getServerData().businesses[i].locations[j].type == AGRP_BIZ_LOC_ATM) { if (getServerData().businesses[i].locations[j].type == V_BIZ_LOC_ATM) {
getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]); getServerData().atmLocationCache.push([i, j, getServerData().businesses[i].locations[j].position]);
} }
} }
@@ -2554,7 +2553,7 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) {
tempItemData.buyPrice = buyPrice; tempItemData.buyPrice = buyPrice;
tempItemData.itemType = getItemTypeData(itemType).databaseId; tempItemData.itemType = getItemTypeData(itemType).databaseId;
tempItemData.ownerId = getBusinessData(business).databaseId; tempItemData.ownerId = getBusinessData(business).databaseId;
tempItemData.ownerType = AGRP_ITEMOWNER_BIZ; tempItemData.ownerType = V_ITEMOWNER_BIZ;
tempItemData.ownerIndex = businessId; tempItemData.ownerIndex = businessId;
tempItemData.itemTypeIndex = itemType; tempItemData.itemTypeIndex = itemType;
saveItemToDatabase(tempItemData); saveItemToDatabase(tempItemData);
@@ -2646,7 +2645,7 @@ function buyFromBusinessCommand(command, params, client) {
} }
takePlayerCash(client, totalCost); takePlayerCash(client, totalCost);
createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount); createItem(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex, getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId, amount);
cachePlayerHotBarItems(client); cachePlayerHotBarItems(client);
getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost; getBusinessData(businessId).till = getBusinessData(businessId).till + totalCost;
@@ -2656,7 +2655,7 @@ function buyFromBusinessCommand(command, params, client) {
} }
let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType; let useType = getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).useType;
if (useType == AGRP_ITEM_USE_TYPE_WEAPON || AGRP_ITEM_USE_TYPE_TAZER || useType == AGRP_ITEM_USE_TYPE_AMMO_CLIP) { if (useType == V_ITEM_USE_TYPE_WEAPON || V_ITEM_USE_TYPE_TAZER || useType == V_ITEM_USE_TYPE_AMMO_CLIP) {
if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) { if (isPlayerWeaponBanned(client) && !isPlayerExemptFromAntiCheat(client)) {
messagePlayerError(client, getLocaleString(client, "WeaponBanned")); messagePlayerError(client, getLocaleString(client, "WeaponBanned"));
return false; return false;
@@ -2759,7 +2758,7 @@ function storeItemInBusinessStorageCommand(command, params, client) {
return false; return false;
} }
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZSTORAGE; getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZSTORAGE;
getBusinessData(businessId).storageItemCache[firstSlot] = getBusinessData(businessId).floorItemCache[itemSlot - 1]; getBusinessData(businessId).storageItemCache[firstSlot] = getBusinessData(businessId).floorItemCache[itemSlot - 1];
getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1; getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1;
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`); messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} to the business storage in slot ${firstSlot}`);
@@ -2803,7 +2802,7 @@ function stockItemOnBusinessFloorCommand(command, params, client) {
return false; return false;
} }
getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = AGRP_ITEM_OWNER_BIZFLOOR; getItemData(getBusinessData(businessId).storageItemCache[itemSlot - 1]).ownerType = V_ITEM_OWNER_BIZFLOOR;
getBusinessData(businessId).floorItemCache[firstSlot] = getBusinessData(businessId).storageItemCache[itemSlot - 1]; getBusinessData(businessId).floorItemCache[firstSlot] = getBusinessData(businessId).storageItemCache[itemSlot - 1];
getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1; getBusinessData(businessId).storageItemCache[itemSlot - 1] = -1;
messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`); messagePlayerSuccess(client, `You moved the ${getItemTypeData(getItemData(getBusinessData(businessId).storageItemCache[firstSlot]).itemTypeIndex).name}s in slot ${itemSlot} of the business storage to the business floor slot ${firstSlot}`);
@@ -2843,14 +2842,14 @@ function cacheBusinessItems(businessId) {
//let businessData = getBusinessData(businessId); //let businessData = getBusinessData(businessId);
//logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`); //logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${businessData.name}) ...`);
//getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index); //getBusinessData(businessId).floorItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZFLOOR && item.ownerId == businessData.databaseId).map(i => i.index);
//getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId); //getBusinessData(businessId).storageItemCache = getServerData().items.filter(item => item.ownerType == V_ITEM_OWNER_BIZSTORAGE && item.ownerId == businessData.databaseId);
logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`); logToConsole(LOG_VERBOSE, `[AGRP.Business] Caching business items for business ${businessId} (${getBusinessData(businessId).name}) ...`);
for (let i in getServerData().items) { for (let i in getServerData().items) {
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { if (getItemData(i).ownerType == V_ITEM_OWNER_BIZFLOOR && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
getBusinessData(businessId).floorItemCache.push(i); getBusinessData(businessId).floorItemCache.push(i);
} else if (getItemData(i).ownerType == AGRP_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) { } else if (getItemData(i).ownerType == V_ITEM_OWNER_BIZSTORAGE && getItemData(i).ownerId == getBusinessData(businessId).databaseId) {
getBusinessData(businessId).storageItemCache.push(i); getBusinessData(businessId).storageItemCache.push(i);
} }
} }
@@ -2869,57 +2868,57 @@ function getBusinessIdFromDatabaseId(databaseId) {
// Updates all pickup data for a business by businessId // Updates all pickup data for a business by businessId
function updateBusinessPickupLabelData(businessId) { function updateBusinessPickupLabelData(businessId) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId)); sendBusinessToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, getBusinessEntranceBlipModelForNetworkEvent(businessId), getBusinessEntrancePickupModelForNetworkEvent(businessId), getBusinessData(businessId).buyPrice, getBusinessData(businessId).rentPrice, getBusinessData(businessId).hasInterior, getBusinessData(businessId).locked, doesBusinessHaveAnyItemsToBuy(businessId));
return false; return false;
} }
if (getBusinessData(businessId).exitPickup != null) { if (getBusinessData(businessId).exitPickup != null) {
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_EXIT, false); setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.type", V_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.id", businessId, false); setEntityData(getBusinessData(businessId).exitPickup, "v.rp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true); setEntityData(getBusinessData(businessId).exitPickup, "v.rp.label.type", V_LABEL_EXIT, true);
} }
if (getBusinessData(businessId).entrancePickup != null) { if (getBusinessData(businessId).entrancePickup != null) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", AGRP_PICKUP_BUSINESS_ENTRANCE, false); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.type", V_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.id", businessId, false); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", AGRP_LABEL_BUSINESS, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.type", V_LABEL_BUSINESS, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.locked", getBusinessData(businessId).locked, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.locked", getBusinessData(businessId).locked, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_NONE, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_NONE, true);
switch (getBusinessData(businessId).labelHelpType) { switch (getBusinessData(businessId).labelHelpType) {
case AGRP_PROPLABEL_INFO_ENTERVEHICLE: { case V_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTERVEHICLE, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTERVEHICLE, true);
break; break;
} }
case AGRP_PROPLABEL_INFO_ENTER: { case V_PROPLABEL_INFO_ENTER: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
break; break;
} }
case AGRP_PROPLABEL_INFO_REPAIR: { case V_PROPLABEL_INFO_REPAIR: {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_REPAIR, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_REPAIR, true);
break; break;
} }
default: { default: {
if (getBusinessData(businessId).hasInterior) { if (getBusinessData(businessId).hasInterior) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
} else { } else {
if (doesBusinessHaveAnyItemsToBuy(businessId)) { if (doesBusinessHaveAnyItemsToBuy(businessId)) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUY, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUY, true);
} else { } else {
removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help"); removeEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.help");
} }
} }
break; break;
} }
} }
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.price", getBusinessData(businessId).buyPrice, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.fee", getBusinessData(businessId).entranceFee, true); setEntityData(getBusinessData(businessId).entrancePickup, "v.rp.label.fee", getBusinessData(businessId).entranceFee, true);
} }
} }
@@ -2997,7 +2996,7 @@ function doesBusinessHaveAnyItemsToBuy(businessId) {
//function clearPlayerBusinessGameScripts(client, businessId) { //function clearPlayerBusinessGameScripts(client, businessId) {
// for(let i in getBusinessData(businessId).gameScripts) { // for(let i in getBusinessData(businessId).gameScripts) {
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); // sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY);
// } // }
//} //}
@@ -3019,11 +3018,11 @@ function canPlayerWithdrawFromBusinessTill(client, businessId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true; return true;
} }
@@ -3039,11 +3038,11 @@ function canPlayerSetBusinessInteriorLights(client, businessId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true; return true;
} }
@@ -3059,11 +3058,11 @@ function canPlayerLockUnlockBusiness(client, businessId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER && getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN && getBusinessData(businessId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true; return true;
} }
@@ -3081,13 +3080,13 @@ function canPlayerManageBusiness(client, businessId, exemptAdminFlag = false) {
} }
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_PLAYER) {
if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
} }
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_CLAN) { if (getBusinessData(businessId).ownerType == V_BIZ_OWNER_CLAN) {
if (getBusinessData(businessId).ownerId == getPlayerClan(client)) { if (getBusinessData(businessId).ownerId == getPlayerClan(client)) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageBusinesses"))) {
return true; return true;

View File

@@ -1,28 +1,27 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: casino.js // FILE: casino.js
// DESC: Provides casino games functions and commands // DESC: Provides casino games functions and commands
// TYPE: Server (JavaScript) // TYPE: Server (JavaScript)
// =========================================================================== // ===========================================================================
const AGRP_CASINO_GAME_NONE = 0; const V_CASINO_GAME_NONE = 0;
const AGRP_CASINO_GAME_BLACKJACK = 1; const V_CASINO_GAME_BLACKJACK = 1;
const AGRP_CASINO_GAME_POKER = 2; const V_CASINO_GAME_POKER = 2;
const AGRP_CASINO_GAME_BACCARAT = 3; const V_CASINO_GAME_BACCARAT = 3;
const AGRP_CASINO_GAME_ROULETTE = 4; const V_CASINO_GAME_ROULETTE = 4;
const AGRP_CASINO_GAME_CRAPS = 5; const V_CASINO_GAME_CRAPS = 5;
const AGRP_CASINO_GAME_HOLDEM = 6; const V_CASINO_GAME_HOLDEM = 6;
// =========================================================================== // ===========================================================================
const AGRP_CASINO_DECK_SUIT_NONE = 1; const V_CASINO_DECK_SUIT_NONE = 1;
const AGRP_CASINO_DECK_SUIT_CLUBS = 1; const V_CASINO_DECK_SUIT_CLUBS = 1;
const AGRP_CASINO_DECK_SUIT_DIAMONDS = 2; const V_CASINO_DECK_SUIT_DIAMONDS = 2;
const AGRP_CASINO_DECK_SUIT_HEARTS = 3; const V_CASINO_DECK_SUIT_HEARTS = 3;
const AGRP_CASINO_DECK_SUIT_SPADES = 4; const V_CASINO_DECK_SUIT_SPADES = 4;
// =========================================================================== // ===========================================================================
@@ -37,45 +36,45 @@ class DeckCard {
// =========================================================================== // ===========================================================================
let cardDeck = [ let cardDeck = [
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 1, "deckCardClubAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 2, "deckCardClubTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 3, "deckCardClubThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 4, "deckCardClubFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 5, "deckCardClubFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 6, "deckCardClubSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 7, "deckCardClubSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 8, "deckCardClubEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 9, "deckCardClubNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 10, "deckCardClubTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 11, "deckCardClubJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 12, "deckCardClubQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"), new DeckCard(V_CASINO_DECK_SUIT_CLUBS, 13, "deckCardClubKing"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 1, "deckCardDiamondAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 2, "deckCardDiamondTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 3, "deckCardDiamondThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 4, "deckCardDiamondFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 5, "deckCardDiamondFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 6, "deckCardDiamondSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 7, "deckCardDiamondSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 8, "deckCardDiamondEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 9, "deckCardDiamondNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 10, "deckCardDiamondTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 11, "deckCardDiamondJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 12, "deckCardDiamondQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"), new DeckCard(V_CASINO_DECK_SUIT_DIAMONDS, 13, "deckCardDiamondKing"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 1, "deckCardHeartAce"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 2, "deckCardHeartTwo"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 3, "deckCardHeartThree"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 4, "deckCardHeartFour"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 5, "deckCardHeartFive"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 6, "deckCardHeartSix"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 7, "deckCardHeartSeven"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 8, "deckCardHeartEight"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 9, "deckCardHeartNine"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 10, "deckCardHeartTen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 11, "deckCardHeartJack"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 12, "deckCardHeartQueen"),
new DeckCard(AGRP_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"), new DeckCard(V_CASINO_DECK_SUIT_HEARTS, 13, "deckCardHeartKing"),
]; ];
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: chat.js // FILE: chat.js
// DESC: Provides chat functions and usage // DESC: Provides chat functions and usage
@@ -402,7 +401,7 @@ function clanChat(client, messageText) {
// =========================================================================== // ===========================================================================
function canPlayerUseMegaphone(client) { function canPlayerUseMegaphone(client) {
if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) { if (getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (isPlayerActiveItemEnabled(client)) { if (isPlayerActiveItemEnabled(client)) {
return true; return true;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: clan.js // FILE: clan.js
// DESC: Provides clan functions and usage // DESC: Provides clan functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: client.js // FILE: client.js
// DESC: Provides client communication and cross-endpoint operations // DESC: Provides client communication and cross-endpoint operations
@@ -9,9 +8,9 @@
// =========================================================================== // ===========================================================================
// Return-To types (for when a player is teleported) // Return-To types (for when a player is teleported)
const AGRP_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid const V_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid
const AGRP_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting const V_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting
const AGRP_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select const V_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select
// =========================================================================== // ===========================================================================
@@ -37,9 +36,9 @@ class ClientData {
this.sessionId = 0; this.sessionId = 0;
// Security // Security
this.passwordResetState = AGRP_RESETPASS_STATE_NONE; this.passwordResetState = V_RESETPASS_STATE_NONE;
this.passwordResetCode = ""; this.passwordResetCode = "";
this.twoFactorAuthenticationState = AGRP_2FA_STATE_NONE; this.twoFactorAuthenticationState = V_2FA_STATE_NONE;
this.twoFactorAuthenticationCode = 0; this.twoFactorAuthenticationCode = 0;
this.loginTimeout = null; this.loginTimeout = null;
this.loginAttemptsRemaining = 3; this.loginAttemptsRemaining = 3;
@@ -65,11 +64,11 @@ class ClientData {
// Items // Items
this.tempLockerCache = new Array(9).fill(-1); this.tempLockerCache = new Array(9).fill(-1);
this.tempLockerType = AGRP_TEMP_LOCKER_TYPE_NONE; this.tempLockerType = V_TEMP_LOCKER_TYPE_NONE;
this.hotBarItems = new Array(9).fill(-1); this.hotBarItems = new Array(9).fill(-1);
this.activeHotBarSlot = -1; this.activeHotBarSlot = -1;
this.toggleUseItem = false; this.toggleUseItem = false;
this.itemActionState = AGRP_ITEM_ACTION_NONE; this.itemActionState = V_ITEM_ACTION_NONE;
this.itemActionItem = -1; this.itemActionItem = -1;
this.paintBallItemCache = []; this.paintBallItemCache = [];
@@ -104,7 +103,7 @@ class ClientData {
this.returnToDimension = null; this.returnToDimension = null;
this.returnToHouse = null; this.returnToHouse = null;
this.returnToBusiness = null; this.returnToBusiness = null;
this.returnToType = AGRP_RETURNTO_TYPE_NONE; this.returnToType = V_RETURNTO_TYPE_NONE;
// Animation // Animation
this.currentAnimation = -1; this.currentAnimation = -1;
@@ -119,7 +118,7 @@ class ClientData {
this.usingSkinSelect = false; this.usingSkinSelect = false;
this.keyBinds = []; this.keyBinds = [];
this.incomingDamageMultiplier = 1; this.incomingDamageMultiplier = 1;
this.weaponDamageEvent = AGRP_WEAPON_DAMAGE_EVENT_NORMAL; this.weaponDamageEvent = V_WEAPON_DAMAGE_EVENT_NORMAL;
this.lastJobVehicle = null; this.lastJobVehicle = null;
this.health = 100; this.health = 100;
this.locale = 0; this.locale = 0;
@@ -128,8 +127,8 @@ class ClientData {
this.scene = ""; this.scene = "";
this.playerBlip = null; this.playerBlip = null;
this.alcoholLevel = 0; this.alcoholLevel = 0;
this.pedState = AGRP_PEDSTATE_NONE; this.pedState = V_PEDSTATE_NONE;
this.promptType = AGRP_PROMPT_NONE; this.promptType = V_PROMPT_NONE;
this.privateMessageReplyTo = null; this.privateMessageReplyTo = null;
this.enteringExitingProperty = null; this.enteringExitingProperty = null;
this.inProperty = null; this.inProperty = null;
@@ -144,12 +143,12 @@ class ClientData {
this.jobRouteEditNextLocationDelay = 0; this.jobRouteEditNextLocationDelay = 0;
this.jobRouteEditNextLocationArriveMessage = ""; this.jobRouteEditNextLocationArriveMessage = "";
this.jobRouteEditNextLocationGotoMessage = ""; this.jobRouteEditNextLocationGotoMessage = "";
this.jobRouteEditNextLocationType = AGRP_JOB_ROUTE_LOC_TYPE_NONE; this.jobRouteEditNextLocationType = V_JOB_ROUTE_LOC_TYPE_NONE;
// Casino Stuff // Casino Stuff
this.casinoChips = 0; // This might become an item with a useId of a business (for chips belonging to specific casinos) this.casinoChips = 0; // This might become an item with a useId of a business (for chips belonging to specific casinos)
this.casinoCardHand = []; this.casinoCardHand = [];
this.casinoPlayingGame = AGRP_CASINO_GAME_NONE; this.casinoPlayingGame = V_CASINO_GAME_NONE;
} }
}; };
@@ -222,7 +221,7 @@ function initClient(client) {
playerInitialized[client.index] = true; playerInitialized[client.index] = true;
//setEntityData(client, "agrp.isInitialized", true, false); //setEntityData(client, "v.rp.isInitialized", true, false);
logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`); logToConsole(LOG_DEBUG, `[AGRP.Account] Initializing GUI for ${getPlayerDisplayForConsole(client)} ...`);
sendPlayerCurrencyString(client); sendPlayerCurrencyString(client);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: command.js // FILE: command.js
// DESC: Provides command data, functions and usage // DESC: Provides command data, functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: config.js // FILE: config.js
// DESC: Provides server configuration // DESC: Provides server configuration
@@ -198,18 +197,18 @@ let globalConfig = {
geoIPCityDatabaseFilePath: "modules/geoip/geoip-city.mmdb", geoIPCityDatabaseFilePath: "modules/geoip/geoip-city.mmdb",
randomTipInterval: 600000, randomTipInterval: 600000,
weaponEquippableTypes: [ weaponEquippableTypes: [
AGRP_ITEM_USE_TYPE_WEAPON, V_ITEM_USE_TYPE_WEAPON,
AGRP_ITEM_USE_TYPE_TAZER, V_ITEM_USE_TYPE_TAZER,
AGRP_ITEM_USE_TYPE_EXTINGUISHER, V_ITEM_USE_TYPE_EXTINGUISHER,
AGRP_ITEM_USE_TYPE_SPRAYPAINT, V_ITEM_USE_TYPE_SPRAYPAINT,
AGRP_ITEM_USE_TYPE_PEPPERSPRAY, V_ITEM_USE_TYPE_PEPPERSPRAY,
], ],
onFootOnlyItems: [ onFootOnlyItems: [
AGRP_ITEM_USE_TYPE_VEHREPAIR, V_ITEM_USE_TYPE_VEHREPAIR,
AGRP_ITEM_USE_TYPE_VEHCOLOUR, V_ITEM_USE_TYPE_VEHCOLOUR,
AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART, V_ITEM_USE_TYPE_VEHUPGRADE_PART,
AGRP_ITEM_USE_TYPE_VEHLIVERY, V_ITEM_USE_TYPE_VEHLIVERY,
AGRP_ITEM_USE_TYPE_VEHTIRE, V_ITEM_USE_TYPE_VEHTIRE,
], ],
vehicleInactiveRespawnDelay: 1800000, // 20 minutes vehicleInactiveRespawnDelay: 1800000, // 20 minutes
chatSectionHeaderLength: 96, chatSectionHeaderLength: 96,

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: core.js // FILE: core.js
// DESC: Provides core data structures, function, and operations // DESC: Provides core data structures, function, and operations

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: crime.js // FILE: crime.js
// DESC: Provides crime data structures, functions, and operations // DESC: Provides crime data structures, functions, and operations

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: database.js // FILE: database.js
// DESC: Provides database handling, functions and usage // DESC: Provides database handling, functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: developer.js // FILE: developer.js
// DESC: Provides developer operation, commands, functions and usage // DESC: Provides developer operation, commands, functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: discord.js // FILE: discord.js
// DESC: Provides discord bridging and connection functions and usage // DESC: Provides discord bridging and connection functions and usage
@@ -9,9 +8,9 @@
// =========================================================================== // ===========================================================================
// Discord Webhook Types // Discord Webhook Types
const AGRP_DISCORD_WEBHOOK_NONE = 0; const V_DISCORD_WEBHOOK_NONE = 0;
const AGRP_DISCORD_WEBHOOK_LOG = 1; const V_DISCORD_WEBHOOK_LOG = 1;
const AGRP_DISCORD_WEBHOOK_ADMIN = 2; const V_DISCORD_WEBHOOK_ADMIN = 2;
// =========================================================================== // ===========================================================================
@@ -111,7 +110,7 @@ function messageDiscordChatChannel(messageString) {
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
messageString = replaceProfanityInMessage(messageString); messageString = replaceProfanityInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG); triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG);
} }
// =========================================================================== // ===========================================================================
@@ -131,7 +130,7 @@ function messageDiscordEventChannel(messageString) {
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
messageString = replaceProfanityInMessage(messageString); messageString = replaceProfanityInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG); triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_LOG);
} }
// =========================================================================== // ===========================================================================
@@ -150,7 +149,7 @@ function messageDiscordAdminChannel(messageString) {
} }
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_ADMIN); triggerDiscordWebHook(messageString, getServerId(), V_DISCORD_WEBHOOK_ADMIN);
} }
// =========================================================================== // ===========================================================================
@@ -178,7 +177,7 @@ function messageDiscordClanWebhook(clanIndex, requiredFlagValue, messageString)
// =========================================================================== // ===========================================================================
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) { function triggerDiscordWebHook(messageString, serverId = getServerId(), type = V_DISCORD_WEBHOOK_LOG) {
if (!getGlobalConfig().discord.webhook.enabled) { if (!getGlobalConfig().discord.webhook.enabled) {
return false; return false;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: economy.js // FILE: economy.js
// DESC: Provides economy/financial utils, functions and usage // DESC: Provides economy/financial utils, functions and usage
@@ -188,19 +187,19 @@ function repossessFirstAsset(client) {
// =========================================================================== // ===========================================================================
function getAllVehiclesOwnedByPlayer(client) { function getAllVehiclesOwnedByPlayer(client) {
return getServerData().vehicles.filter((v) => v.ownerType == AGRP_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().vehicles.filter((v) => v.ownerType == V_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================
function getAllBusinessesOwnedByPlayer(client) { function getAllBusinessesOwnedByPlayer(client) {
return getServerData().businesses.filter((b) => b.ownerType == AGRP_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().businesses.filter((b) => b.ownerType == V_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================
function getAllHousesOwnedByPlayer(client) { function getAllHousesOwnedByPlayer(client) {
return getServerData().houses.filter((h) => h.ownerType == AGRP_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().houses.filter((h) => h.ownerType == V_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: email.js // FILE: email.js
// DESC: Provides email handling, functions and usage // DESC: Provides email handling, functions and usage
@@ -9,9 +8,9 @@
// =========================================================================== // ===========================================================================
// Email Methods // Email Methods
const AGRP_EMAIL_METHOD_NONE = 0; // None const V_EMAIL_METHOD_NONE = 0; // None
const AGRP_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module const V_EMAIL_METHOD_SMTP_MODULE = "smtp"; // Use SMTP module
const AGRP_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page) const V_EMAIL_METHOD_GET_REQUEST = "http"; // Use HTTP request (httpGet to custom PHP page)
// =========================================================================== // ===========================================================================
@@ -24,7 +23,7 @@ function initEmailScript() {
async function sendEmail(toEmail, toName, subject, body) { async function sendEmail(toEmail, toName, subject, body) {
switch (getEmailConfig().method) { switch (getEmailConfig().method) {
case AGRP_EMAIL_METHOD_SMTP_MODULE: case V_EMAIL_METHOD_SMTP_MODULE:
if (!checkForSMTPModule()) { if (!checkForSMTPModule()) {
return false; return false;
} }
@@ -46,7 +45,7 @@ async function sendEmail(toEmail, toName, subject, body) {
}); });
break; break;
case AGRP_EMAIL_METHOD_GET_REQUEST: case V_EMAIL_METHOD_GET_REQUEST:
let tempURL = getEmailConfig().http.baseURL; let tempURL = getEmailConfig().http.baseURL;
tempURL = tempURL.replace("{0}", encodeURIComponent(getEmailConfig().http.password)); tempURL = tempURL.replace("{0}", encodeURIComponent(getEmailConfig().http.password));
tempURL = tempURL.replace("{1}", encodeURIComponent(toEmail)); tempURL = tempURL.replace("{1}", encodeURIComponent(toEmail));

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: event.js // FILE: event.js
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events // DESC: Provides handlers for built in GTAC and Asshat-Gaming created events
@@ -34,7 +33,7 @@ function addAllEventHandlers() {
addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere); addEventHandler("onPedEnteredSphereEx", onPedEnteredSphere);
addEventHandler("onPedExitedSphereEx", onPedExitedSphere); addEventHandler("onPedExitedSphereEx", onPedExitedSphere);
if (getGame() == AGRP_GAME_MAFIA_ONE) { if (getGame() == V_GAME_MAFIA_ONE) {
addEventHandler("onPedFall", onPedFall); addEventHandler("onPedFall", onPedFall);
} }
} }
@@ -168,7 +167,7 @@ function onEntityProcess(event, entity) {
function onPedEnteringVehicle(event, ped, vehicle, seat) { function onPedEnteringVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
getPlayerData(client).pedState = AGRP_PEDSTATE_ENTERINGVEHICLE; getPlayerData(client).pedState = V_PEDSTATE_ENTERINGVEHICLE;
if (!getVehicleData(vehicle)) { if (!getVehicleData(vehicle)) {
return false; return false;
@@ -203,7 +202,7 @@ function onPedExitingVehicle(event, ped, vehicle) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
getPlayerData(client).pedState = AGRP_PEDSTATE_EXITINGVEHICLE; getPlayerData(client).pedState = V_PEDSTATE_EXITINGVEHICLE;
} }
} }
@@ -324,7 +323,7 @@ function onPlayerDeath(client, killer, weapon, pedPiece) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`); logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Player ${getPlayerDisplayForConsole(client)} died!`);
logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`); logToConsole(LOG_INFO, `${getPlayerDisplayForConsole(client)} died.`);
getPlayerData(client).pedState = AGRP_PEDSTATE_DEAD; getPlayerData(client).pedState = V_PEDSTATE_DEAD;
updatePlayerSpawnedState(client, false); updatePlayerSpawnedState(client, false);
setPlayerControlState(client, false); setPlayerControlState(client, false);
setTimeout(function () { setTimeout(function () {
@@ -417,7 +416,7 @@ function onPedSpawn(ped) {
logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`); logToConsole(LOG_WARN | LOG_DEBUG, `[AGRP.Event] Ped ${ped.id} spawned!`);
//if (ped.type == ELEMENT_PLAYER) { //if (ped.type == ELEMENT_PLAYER) {
// if (getGame() != AGRP_GAME_MAFIA_ONE) { // if (getGame() != V_GAME_MAFIA_ONE) {
// //setTimeout(onPlayerSpawn, 250, getClientFromPlayerElement(ped)); // //setTimeout(onPlayerSpawn, 250, getClientFromPlayerElement(ped));
// //onPlayerSpawn(getClientFromPlayerElement(ped)); // //onPlayerSpawn(getClientFromPlayerElement(ped));
// } // }
@@ -470,7 +469,7 @@ async function onPlayerSpawn(client) {
if (isGameFeatureSupported("pedScale")) { if (isGameFeatureSupported("pedScale")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`); logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true); setEntityData(getPlayerPed(client), "v.rp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
} }
//if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) { //if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
@@ -495,7 +494,7 @@ async function onPlayerSpawn(client) {
// Tried this. Doesn't work for some reason. // Tried this. Doesn't work for some reason.
// Mafia Connected needs fixed to set position on spawn. // Mafia Connected needs fixed to set position on spawn.
//if (getGame() == AGRP_GAME_MAFIA_ONE) { //if (getGame() == V_GAME_MAFIA_ONE) {
// setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition); // setPlayerPosition(client, getPlayerCurrentSubAccount(client).spawnPosition);
// setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading); // setPlayerHeading(client, getPlayerCurrentSubAccount(client).spawnHeading);
// setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension); // setPlayerDimension(client, getPlayerCurrentSubAccount(client).dimension);
@@ -536,7 +535,7 @@ async function onPlayerSpawn(client) {
if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) { if (areServerElementsSupported() && isGameFeatureSupported("walkStyle")) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[AGRP.Event] Setting player walking style for ${getPlayerDisplayForConsole(client)}`);
setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); setEntityData(getPlayerPed(client), "v.rp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
} }
if (isGameFeatureSupported("fightStyle")) { if (isGameFeatureSupported("fightStyle")) {
@@ -571,20 +570,20 @@ async function onPlayerSpawn(client) {
//sendPlayerGlobalKeyBindsState(client, !isPlayerAccountSettingEnabled(client, "NoKeyBinds")); //sendPlayerGlobalKeyBindsState(client, !isPlayerAccountSettingEnabled(client, "NoKeyBinds"));
//if(isGTAIV()) { //if(isGTAIV()) {
// setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true);
// setEntityData(getPlayerPed(client), "agrp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); // setEntityData(getPlayerPed(client), "v.rp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true);
//} //}
if (isGTAIV()) { if (isGTAIV()) {
@@ -592,7 +591,7 @@ async function onPlayerSpawn(client) {
} }
logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`); logToConsole(LOG_DEBUG, `[AGRP.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped state to ready`);
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
syncPlayerProperties(client); syncPlayerProperties(client);
@@ -609,11 +608,11 @@ async function onPlayerSpawn(client) {
sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance); sendNameTagDistanceToClient(client, getServerConfig().nameTagDistance);
} }
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`); logToConsole(LOG_DEBUG, `[AGRP.Event] Sending properties, jobs, and vehicles to ${getPlayerDisplayForConsole(client)} (no server elements)`);
sendAllBusinessesToPlayer(client); sendAllBusinessesToPlayer(client);
sendAllHousesToPlayer(client); sendAllHousesToPlayer(client);
if (getGame() != AGRP_GAME_GTA_IV) { if (getGame() != V_GAME_GTA_IV) {
sendAllJobsToPlayer(client); sendAllJobsToPlayer(client);
} }
requestPlayerPedNetworkId(client); requestPlayerPedNetworkId(client);
@@ -634,7 +633,7 @@ async function onPlayerSpawn(client) {
logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`); logToConsole(LOG_DEBUG, `[AGRP.Event] Updating all player name tags`);
updateAllPlayerNameTags(); updateAllPlayerNameTags();
setPlayerWeaponDamageEvent(client, AGRP_WEAPON_DAMAGE_EVENT_NORMAL); setPlayerWeaponDamageEvent(client, V_WEAPON_DAMAGE_EVENT_NORMAL);
if (doesPlayerHaveGUIEnabled(client) && getServerConfig().useGUI == true) { if (doesPlayerHaveGUIEnabled(client) && getServerConfig().useGUI == true) {
if (checkForGeoIPModule()) { if (checkForGeoIPModule()) {
@@ -715,7 +714,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
if (client != null) { if (client != null) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
if (getVehicleData(vehicle).spawnLocked == false && canPlayerManageVehicle(client, vehicle) == true) { if (getVehicleData(vehicle).spawnLocked == false && canPlayerManageVehicle(client, vehicle) == true) {
getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle); getVehicleData(vehicle).spawnPosition = getVehiclePosition(vehicle);
@@ -739,7 +738,7 @@ function onPedExitedVehicle(event, ped, vehicle, seat) {
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
} }
} }
} }
@@ -768,14 +767,14 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
return false; return false;
} }
logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); logToConsole(LOG_DEBUG, `[AGRP.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("v.rp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
getPlayerData(client).lastVehicle = vehicle; getPlayerData(client).lastVehicle = vehicle;
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
if (seat == AGRP_VEHSEAT_DRIVER) { if (seat == V_VEHSEAT_DRIVER) {
vehicle.engine = getVehicleData(vehicle).engine; vehicle.engine = getVehicleData(vehicle).engine;
setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true); setEntityData(vehicle, "v.rp.engine", getVehicleData(vehicle).engine, true);
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
if (getVehicleData(vehicle).buyPrice > 0) { if (getVehicleData(vehicle).buyPrice > 0) {
@@ -793,23 +792,23 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
let ownerType = getLocaleString(client, "NotOwned"); let ownerType = getLocaleString(client, "NotOwned");
ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType)); ownerType = toLowerCase(getVehicleOwnerTypeText(getVehicleData(vehicle).ownerType));
switch (getVehicleData(vehicle).ownerType) { switch (getVehicleData(vehicle).ownerType) {
case AGRP_VEHOWNER_CLAN: case V_VEHOWNER_CLAN:
ownerName = getClanData(getClanIndexFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerName = getClanData(getClanIndexFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Clan"); ownerType = getLocaleString(client, "Clan");
break; break;
case AGRP_VEHOWNER_JOB: case V_VEHOWNER_JOB:
ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerName = getJobData(getJobIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Job"); ownerType = getLocaleString(client, "Job");
break; break;
case AGRP_VEHOWNER_PLAYER: case V_VEHOWNER_PLAYER:
let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId); let subAccountData = loadSubAccountFromId(getVehicleData(vehicle).ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`; ownerName = `${subAccountData.firstName} ${subAccountData.lastName}`;
ownerType = getLocaleString(client, "Player"); ownerType = getLocaleString(client, "Player");
break; break;
case AGRP_VEHOWNER_BIZ: case V_VEHOWNER_BIZ:
ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name; ownerName = getBusinessData(getBusinessIdFromDatabaseId(getVehicleData(vehicle).ownerId)).name;
ownerType = getLocaleString(client, "Business"); ownerType = getLocaleString(client, "Business");
break; break;
@@ -839,7 +838,7 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
let currentSubAccount = getPlayerCurrentSubAccount(client); let currentSubAccount = getPlayerCurrentSubAccount(client);
if (isPlayerWorking(client)) { if (isPlayerWorking(client)) {
if (getVehicleData(vehicle).ownerType == AGRP_VEHOWNER_JOB) { if (getVehicleData(vehicle).ownerType == V_VEHOWNER_JOB) {
if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) { if (getVehicleData(vehicle).ownerId == getPlayerCurrentSubAccount(client).job) {
getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle; getPlayerCurrentSubAccount(client).lastJobVehicle = vehicle;
if (!hasPlayerSeenActionTip(client, "JobRouteStart")) { if (!hasPlayerSeenActionTip(client, "JobRouteStart")) {
@@ -884,7 +883,7 @@ function onPedEnteringVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
if (client != null) { if (client != null) {
if (seat == AGRP_VEHSEAT_DRIVER) { if (seat == V_VEHSEAT_DRIVER) {
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
} }
onPlayerEnteringVehicle(client, vehicle, seat); onPlayerEnteringVehicle(client, vehicle, seat);
@@ -908,7 +907,7 @@ function onPedExitingVehicle(event, ped, vehicle, seat) {
if (ped.isType(ELEMENT_PLAYER)) { if (ped.isType(ELEMENT_PLAYER)) {
let client = getClientFromPlayerElement(ped); let client = getClientFromPlayerElement(ped);
if (client != null) { if (client != null) {
if (seat == AGRP_VEHSEAT_DRIVER) { if (seat == V_VEHSEAT_DRIVER) {
//vehicle.netFlags.sendSync = getVehicleData(vehicle).engine; //vehicle.netFlags.sendSync = getVehicleData(vehicle).engine;
} }
onPlayerExitingVehicle(client, vehicle, seat); onPlayerExitingVehicle(client, vehicle, seat);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: fishing.js // FILE: fishing.js
// DESC: Provides fishing functions and commands // DESC: Provides fishing functions and commands
@@ -9,59 +8,59 @@
// =========================================================================== // ===========================================================================
// Fishing Catch Types (Probably not going to be used, in favor of items and their use type) // Fishing Catch Types (Probably not going to be used, in favor of items and their use type)
const AGRP_FISHING_CATCH_TYPE_NONE = 0; const V_FISHING_CATCH_TYPE_NONE = 0;
const AGRP_FISHING_CATCH_TYPE_FISH = 1; const V_FISHING_CATCH_TYPE_FISH = 1;
const AGRP_FISHING_CATCH_TYPE_JUNK = 2; const V_FISHING_CATCH_TYPE_JUNK = 2;
// Fishing Line States // Fishing Line States
const AGRP_FISHING_LINE_STATE_NONE = 0; const V_FISHING_LINE_STATE_NONE = 0;
const AGRP_FISHING_LINE_STATE_READY = 1; const V_FISHING_LINE_STATE_READY = 1;
const AGRP_FISHING_LINE_STATE_CASTING = 2; const V_FISHING_LINE_STATE_CASTING = 2;
const AGRP_FISHING_LINE_STATE_CASTED = 3; const V_FISHING_LINE_STATE_CASTED = 3;
const AGRP_FISHING_LINE_STATE_REELING = 4; const V_FISHING_LINE_STATE_REELING = 4;
const AGRP_FISHING_LINE_STATE_HOOKED = 5; const V_FISHING_LINE_STATE_HOOKED = 5;
// =========================================================================== // ===========================================================================
let fishingCollectables = [ let fishingCollectables = [
// Fish // Fish
["Salmon", AGRP_FISHING_CATCH_TYPE_FISH], ["Salmon", V_FISHING_CATCH_TYPE_FISH],
["Tuna", AGRP_FISHING_CATCH_TYPE_FISH], ["Tuna", V_FISHING_CATCH_TYPE_FISH],
["Crab", AGRP_FISHING_CATCH_TYPE_FISH], ["Crab", V_FISHING_CATCH_TYPE_FISH],
["Trout", AGRP_FISHING_CATCH_TYPE_FISH], ["Trout", V_FISHING_CATCH_TYPE_FISH],
["Sea Bass", AGRP_FISHING_CATCH_TYPE_FISH], ["Sea Bass", V_FISHING_CATCH_TYPE_FISH],
["Shark", AGRP_FISHING_CATCH_TYPE_FISH], ["Shark", V_FISHING_CATCH_TYPE_FISH],
["Turtle", AGRP_FISHING_CATCH_TYPE_FISH], ["Turtle", V_FISHING_CATCH_TYPE_FISH],
["Manta Ray", AGRP_FISHING_CATCH_TYPE_FISH], ["Manta Ray", V_FISHING_CATCH_TYPE_FISH],
["Cat Fish", AGRP_FISHING_CATCH_TYPE_FISH], ["Cat Fish", V_FISHING_CATCH_TYPE_FISH],
["Blue Marlin", AGRP_FISHING_CATCH_TYPE_FISH], ["Blue Marlin", V_FISHING_CATCH_TYPE_FISH],
// Junk // Junk
["Rusty Can", AGRP_FISHING_CATCH_TYPE_JUNK], ["Rusty Can", V_FISHING_CATCH_TYPE_JUNK],
["Old Pants", AGRP_FISHING_CATCH_TYPE_JUNK], ["Old Pants", V_FISHING_CATCH_TYPE_JUNK],
["Old Shoes", AGRP_FISHING_CATCH_TYPE_JUNK], ["Old Shoes", V_FISHING_CATCH_TYPE_JUNK],
["Garbage", AGRP_FISHING_CATCH_TYPE_JUNK], ["Garbage", V_FISHING_CATCH_TYPE_JUNK],
["Baby Diaper", AGRP_FISHING_CATCH_TYPE_JUNK], ["Baby Diaper", V_FISHING_CATCH_TYPE_JUNK],
["Old Tire", AGRP_FISHING_CATCH_TYPE_JUNK], ["Old Tire", V_FISHING_CATCH_TYPE_JUNK],
["Old Car Battery", AGRP_FISHING_CATCH_TYPE_JUNK], ["Old Car Battery", V_FISHING_CATCH_TYPE_JUNK],
["Horse Hoove", AGRP_FISHING_CATCH_TYPE_JUNK], ["Horse Hoove", V_FISHING_CATCH_TYPE_JUNK],
["Soggy Log", AGRP_FISHING_CATCH_TYPE_JUNK], ["Soggy Log", V_FISHING_CATCH_TYPE_JUNK],
["Soggy Dildo", AGRP_FISHING_CATCH_TYPE_JUNK], ["Soggy Dildo", V_FISHING_CATCH_TYPE_JUNK],
["Clump of Seaweed", AGRP_FISHING_CATCH_TYPE_JUNK], ["Clump of Seaweed", V_FISHING_CATCH_TYPE_JUNK],
]; ];
// =========================================================================== // ===========================================================================
let fishingAnimations = { let fishingAnimations = {
[AGRP_GAME_GTA_III]: { [V_GAME_GTA_III]: {
"fishingLineCasting": "bathit1", "fishingLineCasting": "bathit1",
"fishingLineReeling": "aimdown", "fishingLineReeling": "aimdown",
}, },
[AGRP_GAME_GTA_VC]: { [V_GAME_GTA_VC]: {
"fishingLineCasting": "frontpunch", "fishingLineCasting": "frontpunch",
"fishingLineReeling": "aimdown", "fishingLineReeling": "aimdown",
}, },
[AGRP_GAME_GTA_SA]: { [V_GAME_GTA_SA]: {
"fishingLineCasting": "none", "fishingLineCasting": "none",
"fishingLineReeling": "none", "fishingLineReeling": "none",
} }
@@ -70,7 +69,7 @@ let fishingAnimations = {
// =========================================================================== // ===========================================================================
let fishingParticleEffects = { let fishingParticleEffects = {
[AGRP_GAME_GTA_III]: { [V_GAME_GTA_III]: {
"fishingLineCast": [ "fishingLineCast": [
"MediumSprayingWater", "MediumSprayingWater",
0.2, 0.2,
@@ -99,7 +98,7 @@ function castFishingLineCommand(command, params, client) {
return false; return false;
} }
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) { if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "NeedFishingRod")); messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
return false; return false;
} }
@@ -132,7 +131,7 @@ function resetFishingLineCommand(client) {
return false; return false;
} }
if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) { if (doesPlayerHaveItemOfUseTypeEquipped(client, V_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "NeedFishingRod")); messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
return false; return false;
} }
@@ -151,7 +150,7 @@ function resetFishingLineCommand(client) {
showSmallGameMessage(client, messageText); showSmallGameMessage(client, messageText);
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_NONE; getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_NONE;
getPlayerData(client).fishingLineCastStart = 0; getPlayerData(client).fishingLineCastStart = 0;
} }
@@ -173,7 +172,7 @@ function castPlayerFishingLine(client, strength) {
showParticleEffect(frontPosition, getGameConfig().particleEffects[getGame()][particleEffectName], fishingParticleEffects[getGame()].fishingLineCast[1], fishingParticleEffects[getGame()].fishingLineCast[2]); showParticleEffect(frontPosition, getGameConfig().particleEffects[getGame()][particleEffectName], fishingParticleEffects[getGame()].fishingLineCast[1], fishingParticleEffects[getGame()].fishingLineCast[2]);
getPlayerData(client).fishingLineCastPosition = frontPosition; getPlayerData(client).fishingLineCastPosition = frontPosition;
getPlayerData(client).fishingLineState = AGRP_FISHING_LINE_STATE_CASTED; getPlayerData(client).fishingLineState = V_FISHING_LINE_STATE_CASTED;
}, strength * 10); }, strength * 10);
} }
@@ -197,13 +196,13 @@ function isPlayerInFishingSpot(client) {
// =========================================================================== // ===========================================================================
function isPlayerFishing(client) { function isPlayerFishing(client) {
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE); return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE);
} }
// =========================================================================== // ===========================================================================
function isPlayerFishing(client) { function isPlayerFishing(client) {
return (getPlayerData(client).fishingLineState != AGRP_FISHING_LINE_STATE_NONE); return (getPlayerData(client).fishingLineState != V_FISHING_LINE_STATE_NONE);
} }
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: forensics.js // FILE: forensics.js
// DESC: Provides forensics functions and commands (bullet casings, blood, etc) // DESC: Provides forensics functions and commands (bullet casings, blood, etc)
@@ -9,13 +8,13 @@
// =========================================================================== // ===========================================================================
// Forensic Types // Forensic Types
const AGRP_FORENSICS_NONE = 0; const V_FORENSICS_NONE = 0;
const AGRP_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon. const V_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
const AGRP_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot const V_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot
const AGRP_FORENSICS_BODY = 3; // Body. A dead body lol const V_FORENSICS_BODY = 3; // Body. A dead body lol
const AGRP_FORENSICS_HAIR = 4; // Hair. const V_FORENSICS_HAIR = 4; // Hair.
const AGRP_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn const V_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
const AGRP_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten const V_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten
const AGRP_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby) const V_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
// =========================================================================== // ===========================================================================

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: gate.js // FILE: gate.js
// DESC: Provides gate functions and commands // DESC: Provides gate functions and commands
@@ -9,14 +8,14 @@
// =========================================================================== // ===========================================================================
// Gate Owner Types // Gate Owner Types
const AGRP_GATEOWNER_NONE = 0; // Not owned const V_GATEOWNER_NONE = 0; // Not owned
const AGRP_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount) const V_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const AGRP_GATEOWNER_JOB = 2; // Owned by a job const V_GATEOWNER_JOB = 2; // Owned by a job
const AGRP_GATEOWNER_CLAN = 3; // Owned by a clan const V_GATEOWNER_CLAN = 3; // Owned by a clan
const AGRP_GATEOWNER_FACTION = 4; // Owned by a faction const V_GATEOWNER_FACTION = 4; // Owned by a faction
const AGRP_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used. const V_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
const AGRP_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that const V_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
const AGRP_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas. const V_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
// =========================================================================== // ===========================================================================
@@ -28,7 +27,7 @@ class GateData {
this.enabled = false; this.enabled = false;
this.position = toVector3(0.0, 0.0, 0.0); this.position = toVector3(0.0, 0.0, 0.0);
this.locked = true; this.locked = true;
this.ownerType = AGRP_GATEOWNER_NONE; this.ownerType = V_GATEOWNER_NONE;
this.ownerId = 0; this.ownerId = 0;
if (dbAssoc) { if (dbAssoc) {
@@ -55,17 +54,17 @@ function initGateScript() {
function doesPlayerHaveGateKeys(client, vehicle) { function doesPlayerHaveGateKeys(client, vehicle) {
let gateData = getGateData(vehicle); let gateData = getGateData(vehicle);
if (gateData.ownerType == AGRP_GATEOWNER_PUBLIC) { if (gateData.ownerType == V_GATEOWNER_PUBLIC) {
return true; return true;
} }
if (gateData.ownerType == AGRP_GATEOWNER_PLAYER) { if (gateData.ownerType == V_GATEOWNER_PLAYER) {
if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
} }
if (gateData.ownerType == AGRP_GATEOWNER_CLAN) { if (gateData.ownerType == V_GATEOWNER_CLAN) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
return true; return true;
} }
@@ -77,7 +76,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == AGRP_GATEOWNER_FACTION) { if (gateData.ownerType == V_GATEOWNER_FACTION) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) {
return true; return true;
} }
@@ -89,7 +88,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == AGRP_GATEOWNER_JOB) { if (gateData.ownerType == V_GATEOWNER_JOB) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
return true; return true;
} }
@@ -99,7 +98,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == AGRP_GATEOWNER_BUSINESS) { if (gateData.ownerType == V_GATEOWNER_BUSINESS) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
return true; return true;
} }
@@ -109,7 +108,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == AGRP_GATEOWNER_HOUSE) { if (gateData.ownerType == V_GATEOWNER_HOUSE) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
return true; return true;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: gps.js // FILE: gps.js
// DESC: Provides GPS functions and commands // DESC: Provides GPS functions and commands
@@ -9,36 +8,36 @@
// =========================================================================== // ===========================================================================
// GPS State Types // GPS State Types
const AGRP_GPS_TYPE_NONE = 0; // None (invalid) const V_GPS_TYPE_NONE = 0; // None (invalid)
const AGRP_GPS_TYPE_BUSINESS = 1; // Business const V_GPS_TYPE_BUSINESS = 1; // Business
const AGRP_GPS_TYPE_POLICE = 2; // Police Station const V_GPS_TYPE_POLICE = 2; // Police Station
const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital const V_GPS_TYPE_HOSPITAL = 3; // Hospital
const AGRP_GPS_TYPE_JOB = 4; // Job const V_GPS_TYPE_JOB = 4; // Job
const AGRP_GPS_TYPE_GAMELOC = 5; // Game Location const V_GPS_TYPE_GAMELOC = 5; // Game Location
// =========================================================================== // ===========================================================================
function gpsCommand(command, params, client) { function gpsCommand(command, params, client) {
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList"))); messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList")));
let locationType = AGRP_GPS_TYPE_NONE; let locationType = V_GPS_TYPE_NONE;
let useType = AGRP_ITEM_USE_TYPE_NONE; let useType = V_ITEM_USE_TYPE_NONE;
let blipColour = "white"; let blipColour = "white";
switch (toLowerCase(params)) { switch (toLowerCase(params)) {
case "police": case "police":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_POLICE; locationType = V_GPS_TYPE_POLICE;
break; break;
case "hospital": case "hospital":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_HOSPITAL; locationType = V_GPS_TYPE_HOSPITAL;
break; break;
case "job": case "job":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_JOB; locationType = V_GPS_TYPE_JOB;
break; break;
case "skin": case "skin":
@@ -46,8 +45,8 @@ function gpsCommand(command, params, client) {
case "clothes": case "clothes":
case "player": case "player":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_SKIN; useType = V_ITEM_USE_TYPE_SKIN;
break; break;
case "gun": case "gun":
@@ -57,29 +56,29 @@ function gpsCommand(command, params, client) {
case "wep": case "wep":
case "weps": case "weps":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_WEAPON; useType = V_ITEM_USE_TYPE_WEAPON;
break; break;
case "food": case "food":
case "eat": case "eat":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_FOOD; useType = V_ITEM_USE_TYPE_FOOD;
break; break;
case "drink": case "drink":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_DRINK; useType = V_ITEM_USE_TYPE_DRINK;
break; break;
case "alcohol": case "alcohol":
case "booze": case "booze":
case "bar": case "bar":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_ALCOHOL; useType = V_ITEM_USE_TYPE_ALCOHOL;
break; break;
case "repair": case "repair":
@@ -88,8 +87,8 @@ function gpsCommand(command, params, client) {
case "spray": case "spray":
case "fix": case "fix":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHREPAIR; useType = V_ITEM_USE_TYPE_VEHREPAIR;
break; break;
case "vehiclecolour": case "vehiclecolour":
@@ -97,14 +96,14 @@ function gpsCommand(command, params, client) {
case "carcolour": case "carcolour":
case "colour": case "colour":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHCOLOUR; useType = V_ITEM_USE_TYPE_VEHCOLOUR;
break; break;
default: { default: {
let itemTypeId = getItemTypeFromParams(params); let itemTypeId = getItemTypeFromParams(params);
if (getItemTypeData(itemTypeId) != false) { if (getItemTypeData(itemTypeId) != false) {
locationType = AGRP_GPS_TYPE_BUSINESS; locationType = V_GPS_TYPE_BUSINESS;
blipColour = "businessBlue"; blipColour = "businessBlue";
useType = getItemTypeData(itemTypeId).useType; useType = getItemTypeData(itemTypeId).useType;
} else { } else {
@@ -116,12 +115,12 @@ function gpsCommand(command, params, client) {
} }
} }
if (locationType == AGRP_GPS_TYPE_NONE) { if (locationType == V_GPS_TYPE_NONE) {
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation")); messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
return false; return false;
} }
if (locationType == AGRP_GPS_TYPE_BUSINESS) { if (locationType == V_GPS_TYPE_BUSINESS) {
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType); let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
if (!businessId) { if (!businessId) {
messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType")); messagePlayerError(client, getLocaleString(client, "NoBusinessWithItemType"));
@@ -138,7 +137,7 @@ function gpsCommand(command, params, client) {
messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); messagePlayerSuccess(client, "Look for the blinking icon on your mini map");
} }
if (locationType == AGRP_GPS_TYPE_GAMELOC) { if (locationType == V_GPS_TYPE_GAMELOC) {
hideAllBlipsForPlayerGPS(client); hideAllBlipsForPlayerGPS(client);
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10); blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
messagePlayerSuccess(client, "Look for the blinking icon on your mini map"); messagePlayerSuccess(client, "Look for the blinking icon on your mini map");

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: gui.js // FILE: gui.js
// DESC: Provides GUI functions and usage // DESC: Provides GUI functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: help.js // FILE: help.js
// DESC: Provides update info, help commands, and documentation // DESC: Provides update info, help commands, and documentation

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: house.js // FILE: house.js
// DESC: Provides house commands, functions, and usage // DESC: Provides house commands, functions, and usage
@@ -9,19 +8,19 @@
// =========================================================================== // ===========================================================================
// House Location Types // House Location Types
const AGRP_HOUSE_LOC_NONE = 0; // None const V_HOUSE_LOC_NONE = 0; // None
const AGRP_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house const V_HOUSE_LOC_GATE = 1; // Center of any moveable gate that belongs to the house
const AGRP_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped const V_HOUSE_LOC_GARAGE = 2; // Location for garage (pos1 = outside, pos2 = inside). Use pos to teleport or spawn veh/ped
// =========================================================================== // ===========================================================================
// House Owner Types // House Owner Types
const AGRP_HOUSE_OWNER_NONE = 0; // Not owned const V_HOUSE_OWNER_NONE = 0; // Not owned
const AGRP_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount) const V_HOUSE_OWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const AGRP_HOUSE_OWNER_JOB = 2; // Owned by a job const V_HOUSE_OWNER_JOB = 2; // Owned by a job
const AGRP_HOUSE_OWNER_CLAN = 3; // Owned by a clan const V_HOUSE_OWNER_CLAN = 3; // Owned by a clan
const AGRP_HOUSE_OWNER_FACTION = 4; // Owned by a faction const V_HOUSE_OWNER_FACTION = 4; // Owned by a faction
const AGRP_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used. const V_HOUSE_OWNER_PUBLIC = 5; // Is a public house. Technically not owned. This probably won't be used.
// =========================================================================== // ===========================================================================
@@ -32,7 +31,7 @@ class HouseData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0 this.databaseId = 0
this.description = ""; this.description = "";
this.ownerType = AGRP_HOUSE_OWNER_NONE; this.ownerType = V_HOUSE_OWNER_NONE;
this.ownerId = 0; this.ownerId = 0;
this.buyPrice = 0; this.buyPrice = 0;
this.rentPrice = 0; this.rentPrice = 0;
@@ -42,7 +41,7 @@ class HouseData {
this.index = -1; this.index = -1;
this.needsSaved = false; this.needsSaved = false;
this.interiorLights = true; this.interiorLights = true;
this.propertyType = AGRP_PROPERTY_TYPE_HOUSE; this.propertyType = V_PROPERTY_TYPE_HOUSE;
this.itemCache = []; this.itemCache = [];
this.locations = []; this.locations = [];
@@ -269,7 +268,7 @@ function setHouseDescriptionCommand(command, params, client) {
let oldDescription = getHouseData(houseId).description; let oldDescription = getHouseData(houseId).description;
getHouseData(houseId).description = newHouseDescription; getHouseData(houseId).description = newHouseDescription;
setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true); setEntityData(getHouseData(houseId).entrancePickup, "v.rp.label.name", getHouseData(houseId).description, true);
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -302,13 +301,13 @@ function setHouseOwnerCommand(command, params, client) {
} }
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false; return false;
} }
} }
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_PLAYER; getHouseData(houseId).ownerType = V_HOUSE_OWNER_PLAYER;
getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId; getHouseData(houseId).ownerId = getPlayerCurrentSubAccount(newHouseOwner).databaseId;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -334,13 +333,13 @@ function removeHouseOwnerCommand(command, params, client) {
} }
if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { if (!doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); messagePlayerError(client, getLocaleString(client, "CantModifyHouse"));
return false; return false;
} }
} }
getHouseData(houseId).ownerType = AGRP_HOUSE_OWNER_NONE; getHouseData(houseId).ownerType = V_HOUSE_OWNER_NONE;
getHouseData(houseId).ownerId = -1; getHouseData(houseId).ownerId = -1;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -373,7 +372,7 @@ function setHouseClanCommand(command, params, client) {
return false; return false;
} }
if (getHouseData(houseId).ownerType != AGRP_VEHOWNER_PLAYER) { if (getHouseData(houseId).ownerType != V_VEHOWNER_PLAYER) {
messagePlayerError(client, getLocaleString(client, "MustOwnHouse")); messagePlayerError(client, getLocaleString(client, "MustOwnHouse"));
return false; return false;
} }
@@ -384,7 +383,7 @@ function setHouseClanCommand(command, params, client) {
} }
showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "SetHouseClanConfirmMessage"), getLocaleString(client, "SetHouseClanConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
getPlayerData(client).promptType = AGRP_PROMPT_GIVEHOUSETOCLAN; getPlayerData(client).promptType = V_PROMPT_GIVEHOUSETOCLAN;
//messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`); //messagePlayerSuccess(`{MAINCOLOUR}You gave house {houseGreen}${getHouseData(houseId).description}{MAINCOLOUR} to the {clanOrange}${getClanData(clanId).name} {MAINCOLOUR}clan!`);
} }
@@ -1054,7 +1053,7 @@ function createHouseEntrancePickup(houseId) {
return false; return false;
} }
if (areServerElementsSupported() && getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { if (areServerElementsSupported() && getGame() != V_GAME_MAFIA_ONE && getGame() != V_GAME_GTA_IV) {
let entrancePickup = null; let entrancePickup = null;
if (isGameFeatureSupported("pickup")) { if (isGameFeatureSupported("pickup")) {
let pickupModelId = getGameConfig().pickupModels[getGame()].House; let pickupModelId = getGameConfig().pickupModels[getGame()].House;
@@ -1131,8 +1130,8 @@ function createHouseEntranceBlip(houseId) {
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setEntityData(entranceBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_ENTRANCE, false); setEntityData(entranceBlip, "v.rp.owner.type", V_BLIP_HOUSE_ENTRANCE, false);
setEntityData(entranceBlip, "agrp.owner.id", houseId, false); setEntityData(entranceBlip, "v.rp.owner.id", houseId, false);
houseData.entranceBlip = entranceBlip; houseData.entranceBlip = entranceBlip;
} }
@@ -1239,8 +1238,8 @@ function createHouseExitBlip(houseId) {
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setElementTransient(exitBlip, false); setElementTransient(exitBlip, false);
setEntityData(exitBlip, "agrp.owner.type", AGRP_BLIP_HOUSE_EXIT, false); setEntityData(exitBlip, "v.rp.owner.type", V_BLIP_HOUSE_EXIT, false);
setEntityData(exitBlip, "agrp.owner.id", houseId, false); setEntityData(exitBlip, "v.rp.owner.id", houseId, false);
getHouseData(houseId).exitBlip = exitBlip; getHouseData(houseId).exitBlip = exitBlip;
} }
} }
@@ -1249,22 +1248,22 @@ function createHouseExitBlip(houseId) {
function getHouseOwnerTypeText(ownerType) { function getHouseOwnerTypeText(ownerType) {
switch (ownerType) { switch (ownerType) {
case AGRP_HOUSE_OWNER_CLAN: case V_HOUSE_OWNER_CLAN:
return "clan"; return "clan";
case AGRP_HOUSE_OWNER_PLAYER: case V_HOUSE_OWNER_PLAYER:
return "player"; return "player";
case AGRP_HOUSE_OWNER_NONE: case V_HOUSE_OWNER_NONE:
return "not owned"; return "not owned";
case AGRP_HOUSE_OWNER_PUBLIC: case V_HOUSE_OWNER_PUBLIC:
return "not owned"; return "not owned";
case AGRP_HOUSE_OWNER_JOB: case V_HOUSE_OWNER_JOB:
return "job"; return "job";
case AGRP_HOUSE_OWNER_BIZ: case V_HOUSE_OWNER_BIZ:
return "business"; return "business";
default: default:
@@ -1299,28 +1298,28 @@ function getHouseInfoCommand(command, params, client) {
let ownerName = "Unknown"; let ownerName = "Unknown";
switch (getHouseData(houseId).ownerType) { switch (getHouseData(houseId).ownerType) {
case AGRP_HOUSE_OWNER_CLAN: case V_HOUSE_OWNER_CLAN:
ownerName = getClanData(houseData).name; ownerName = getClanData(houseData).name;
break; break;
case AGRP_HOUSE_OWNER_PLAYER: case V_HOUSE_OWNER_PLAYER:
let subAccountData = loadSubAccountFromId(houseData.ownerId); let subAccountData = loadSubAccountFromId(houseData.ownerId);
ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`; ownerName = `${subAccountData.firstName} ${subAccountData.lastName} [${subAccountData.databaseId}]`;
break; break;
case AGRP_HOUSE_OWNER_NONE: case V_HOUSE_OWNER_NONE:
ownerName = "None"; ownerName = "None";
break; break;
case AGRP_HOUSE_OWNER_PUBLIC: case V_HOUSE_OWNER_PUBLIC:
ownerName = "Public"; ownerName = "Public";
break; break;
case AGRP_HOUSE_OWNER_BIZ: case V_HOUSE_OWNER_BIZ:
ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name; ownerName = getBusinessDataFromDatabaseId(houseData.ownerId).name;
break; break;
case AGRP_HOUSE_OWNER_JOB: case V_HOUSE_OWNER_JOB:
ownerName = getJobData(houseData.ownerId).name; ownerName = getJobData(houseData.ownerId).name;
break; break;
} }
@@ -1455,7 +1454,7 @@ function buyHouseCommand(command, params, client) {
return false; return false;
} }
getPlayerData(client).promptType = AGRP_PROMPT_BUYHOUSE; getPlayerData(client).promptType = V_PROMPT_BUYHOUSE;
showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No")); showPlayerPrompt(client, getLocaleString(client, "BuyHouseConfirmMessage"), getLocaleString(client, "BuyHouseConfirmTitle"), getLocaleString(client, "Yes"), getLocaleString(client, "No"));
} }
@@ -1614,7 +1613,7 @@ function cacheHouseItems(houseId) {
getHouseData(houseId).itemCache = []; getHouseData(houseId).itemCache = [];
for (let i in getServerData().items) { for (let i in getServerData().items) {
if (getItemData(i).ownerType == AGRP_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) { if (getItemData(i).ownerType == V_ITEM_OWNER_HOUSE && getItemData(i).ownerId == getHouseData(houseId).databaseId) {
getHouseData(houseId).itemCache.push(i); getHouseData(houseId).itemCache.push(i);
} }
} }
@@ -1643,7 +1642,7 @@ function getHouseIdFromDatabaseId(databaseId) {
//function clearPlayerHouseGameScripts(client, houseId) { //function clearPlayerHouseGameScripts(client, houseId) {
// for(let i in getHouseData(houseId).gameScripts) { // for(let i in getHouseData(houseId).gameScripts) {
// sendPlayerGameScriptState(client, AGRP_GAMESCRIPT_DENY); // sendPlayerGameScriptState(client, V_GAMESCRIPT_DENY);
// } // }
//} //}
@@ -1665,11 +1664,11 @@ function canPlayerSetHouseInteriorLights(client, houseId) {
return true; return true;
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true; return true;
} }
@@ -1685,11 +1684,11 @@ function canPlayerLockUnlockHouse(client, houseId) {
return true; return true;
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER && getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN && getHouseData(houseId).ownerId == getClanData(getPlayerClan(client)).databaseId) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true; return true;
} }
@@ -1739,13 +1738,13 @@ function canPlayerManageHouse(client, houseId) {
return true; return true;
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_PLAYER) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_PLAYER) {
if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (getHouseData(houseId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
} }
if (getHouseData(houseId).ownerType == AGRP_HOUSE_OWNER_CLAN) { if (getHouseData(houseId).ownerType == V_HOUSE_OWNER_CLAN) {
if (getHouseData(houseId).ownerId == getPlayerClan(client)) { if (getHouseData(houseId).ownerId == getPlayerClan(client)) {
if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) { if (doesPlayerHaveClanPermission(client, getClanFlagValue("ManageHouses"))) {
return true; return true;
@@ -1779,7 +1778,7 @@ function getHouseFromParams(params) {
// =========================================================================== // ===========================================================================
function updateHousePickupLabelData(houseId) { function updateHousePickupLabelData(houseId) {
if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE || getGame() == AGRP_GAME_GTA_IV) { if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) {
sendHouseToPlayer(null, houseId, getHouseData(houseId).description, getHouseData(houseId).entrancePosition, getHouseEntranceBlipModelForNetworkEvent(houseId), getHouseEntrancePickupModelForNetworkEvent(houseId), getHouseData(houseId).buyPrice, getHouseData(houseId).rentPrice, getHouseData(houseId).hasInterior, getHouseData(houseId).locked); sendHouseToPlayer(null, houseId, getHouseData(houseId).description, getHouseData(houseId).entrancePosition, getHouseEntranceBlipModelForNetworkEvent(houseId), getHouseEntrancePickupModelForNetworkEvent(houseId), getHouseData(houseId).buyPrice, getHouseData(houseId).rentPrice, getHouseData(houseId).hasInterior, getHouseData(houseId).locked);
return false; return false;
} }
@@ -1787,26 +1786,26 @@ function updateHousePickupLabelData(houseId) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
if (houseData.entrancePickup != null) { if (houseData.entrancePickup != null) {
setEntityData(houseData.entrancePickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_ENTRANCE, false); setEntityData(houseData.entrancePickup, "v.rp.owner.type", V_PICKUP_HOUSE_ENTRANCE, false);
setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false); setEntityData(houseData.entrancePickup, "v.rp.owner.id", houseId, false);
setEntityData(houseData.entrancePickup, "agrp.label.type", AGRP_LABEL_HOUSE, true); setEntityData(houseData.entrancePickup, "v.rp.label.type", V_LABEL_HOUSE, true);
setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true); setEntityData(houseData.entrancePickup, "v.rp.label.name", houseData.description, true);
setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true); setEntityData(houseData.entrancePickup, "v.rp.label.locked", houseData.locked, true);
setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true); setEntityData(houseData.entrancePickup, "v.rp.label.price", houseData.buyPrice, true);
setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true); setEntityData(houseData.entrancePickup, "v.rp.label.rentprice", houseData.rentPrice, true);
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_ENTER, true); setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_ENTER, true);
if (houseData.buyPrice > 0) { if (houseData.buyPrice > 0) {
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_BUYHOUSE, true); setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_BUYHOUSE, true);
} else if (houseData.rentPrice > 0) { } else if (houseData.rentPrice > 0) {
setEntityData(houseData.entrancePickup, "agrp.label.help", AGRP_PROPLABEL_INFO_RENTHOUSE, true); setEntityData(houseData.entrancePickup, "v.rp.label.help", V_PROPLABEL_INFO_RENTHOUSE, true);
} }
} }
if (houseData.exitPickup != null) { if (houseData.exitPickup != null) {
setEntityData(houseData.exitPickup, "agrp.owner.type", AGRP_PICKUP_HOUSE_EXIT, false); setEntityData(houseData.exitPickup, "v.rp.owner.type", V_PICKUP_HOUSE_EXIT, false);
setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false); setEntityData(houseData.exitPickup, "v.rp.owner.id", houseId, false);
setEntityData(houseData.exitPickup, "agrp.label.type", AGRP_LABEL_EXIT, true); setEntityData(houseData.exitPickup, "v.rp.label.type", V_LABEL_EXIT, true);
} }
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: insurance.js // FILE: insurance.js
// DESC: Provides insurance commands, functions, and usage // DESC: Provides insurance commands, functions, and usage
@@ -9,33 +8,33 @@
// =========================================================================== // ===========================================================================
// Insurance Account Owner Types // Insurance Account Owner Types
const AGRP_INS_ACCT_OWNER_NONE = 0; // None const V_INS_ACCT_OWNER_NONE = 0; // None
const AGRP_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company const V_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
const AGRP_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company const V_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
const AGRP_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company const V_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
// =========================================================================== // ===========================================================================
// Insurance Account Entity Types // Insurance Account Entity Types
const AGRP_INS_ACCT_ENTITY_NONE = 0; // None const V_INS_ACCT_ENTITY_NONE = 0; // None
const AGRP_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance const V_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
const AGRP_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance const V_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
const AGRP_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance const V_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
const AGRP_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance const V_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
const AGRP_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance const V_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
// =========================================================================== // ===========================================================================
// Insurance Account History Types // Insurance Account History Types
const AGRP_INS_ACCT_HISTORY_NONE = 0; // None const V_INS_ACCT_HISTORY_NONE = 0; // None
const AGRP_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury) const V_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
const AGRP_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death) const V_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
const AGRP_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed const V_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
const AGRP_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed const V_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
const AGRP_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen const V_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
const AGRP_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door) const V_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
const AGRP_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from const V_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
const AGRP_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged const V_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
const AGRP_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from const V_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
// =========================================================================== // ===========================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: drink.js // FILE: drink.js
// DESC: Provides features and usage for the drink item type // DESC: Provides features and usage for the drink item type

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: food.js // FILE: food.js
// DESC: Provides features and usage for the food item type // DESC: Provides features and usage for the food item type

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: handcuff.js // FILE: handcuff.js
// DESC: Provides features and usage for the handcuff item type // DESC: Provides features and usage for the handcuff item type
@@ -11,20 +10,20 @@
// =========================================================================== // ===========================================================================
function isPlayerHandCuffed(client) { function isPlayerHandCuffed(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED); return (getPlayerData(client).pedState == V_PEDSTATE_BINDED);
} }
// =========================================================================== // ===========================================================================
function handCuffPlayer(client) { function handCuffPlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED; getPlayerData(client).pedState = V_PEDSTATE_BINDED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
} }
// =========================================================================== // ===========================================================================
function unHandCuffPlayer(client) { function unHandCuffPlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: phone.js // FILE: phone.js
// DESC: Provides features and usage for the phone item type // DESC: Provides features and usage for the phone item type
@@ -10,7 +9,7 @@
function getItemWithPhoneNumber(phoneNumber) { function getItemWithPhoneNumber(phoneNumber) {
for (let i in getServerData().items) { for (let i in getServerData().items) {
if (getItemTypeData(getItemData(i).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_PHONE) { if (getItemTypeData(getItemData(i).itemTypeIndex).useType == V_ITEM_USE_TYPE_PHONE) {
if (getItemData(i).value == phoneNumber) { if (getItemData(i).value == phoneNumber) {
return i; return i;
} }
@@ -31,15 +30,15 @@ function ringPhoneForNearbyPlayers(itemIndex) {
/* /*
if(isPhoneItemEnabled(itemIndex)) { if(isPhoneItemEnabled(itemIndex)) {
switch(getItemData(itemIndex).ownerType) { switch(getItemData(itemIndex).ownerType) {
case AGRP_ITEM_OWNER_GROUND: case V_ITEM_OWNER_GROUND:
playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra); playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra);
break; break;
case AGRP_ITEM_OWNER_VEHTRUNK: case V_ITEM_OWNER_VEHTRUNK:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break; break;
case AGRP_ITEM_OWNER_VEHDASH: case V_ITEM_OWNER_VEHDASH:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break; break;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: handcuff.js // FILE: handcuff.js
// DESC: Provides features and usage for the handcuff item type // DESC: Provides features and usage for the handcuff item type
@@ -11,20 +10,20 @@
// =========================================================================== // ===========================================================================
function isPlayerTied(client) { function isPlayerTied(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED); return (getPlayerData(client).pedState == V_PEDSTATE_BINDED);
} }
// =========================================================================== // ===========================================================================
function ropeTiePlayer(client) { function ropeTiePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED; getPlayerData(client).pedState = V_PEDSTATE_BINDED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
} }
// =========================================================================== // ===========================================================================
function ropeUnTiePlayer(client) { function ropeUnTiePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: tazer.js // FILE: tazer.js
// DESC: Provides features and usage for the tazer item type // DESC: Provides features and usage for the tazer item type
@@ -11,13 +10,13 @@
// =========================================================================== // ===========================================================================
function isPlayerTazed(client) { function isPlayerTazed(client) {
return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED); return (getPlayerData(client).pedState == V_PEDSTATE_TAZED);
} }
// =========================================================================== // ===========================================================================
function tazePlayer(client) { function tazePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_TAZED; getPlayerData(client).pedState = V_PEDSTATE_TAZED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
let animationId = getAnimationFromParams("tazed"); let animationId = getAnimationFromParams("tazed");
@@ -34,7 +33,7 @@ function tazePlayer(client) {
// =========================================================================== // ===========================================================================
function unTazePlayer(client) { function unTazePlayer(client) {
getPlayerData(client).pedState = AGRP_PEDSTATE_READY; getPlayerData(client).pedState = V_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo); setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: walkie-talkie.js // FILE: walkie-talkie.js
// DESC: Provides features and usage for the walkie-talkie item type // DESC: Provides features and usage for the walkie-talkie item type
@@ -9,7 +8,7 @@
// =========================================================================== // ===========================================================================
function getPlayerActiveWalkieTalkieFrequency(client) { function getPlayerActiveWalkieTalkieFrequency(client) {
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE); let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE);
if (walkieTalkieSlot != -1) { if (walkieTalkieSlot != -1) {
if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) { if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) {
@@ -32,7 +31,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
// if(isPlayerSpawned(clients[i])) { // if(isPlayerSpawned(clients[i])) {
// if(!isSamePlayer(transmittingPlayer, clients[i])) { // if(!isSamePlayer(transmittingPlayer, clients[i])) {
// if(getPlayerActiveWalkieTalkieFrequency(clients[i]) == radioFrequency) { // if(getPlayerActiveWalkieTalkieFrequency(clients[i]) == radioFrequency) {
// if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], AGRP_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) { // if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], V_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) {
// walkieTalkieIncomingToNearbyPlayers(clients[i], messageText); // walkieTalkieIncomingToNearbyPlayers(clients[i], messageText);
// } // }
// } // }
@@ -43,7 +42,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
let items = getServerData().items; let items = getServerData().items;
for (let i in items) { for (let i in items) {
if (items[i].enabled) { if (items[i].enabled) {
if (getItemTypeData(items[i].itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { if (getItemTypeData(items[i].itemTypeIndex).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
if (items[i].value == radioFrequency) { if (items[i].value == radioFrequency) {
walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i)); walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i));
} }
@@ -126,7 +125,7 @@ function walkieTalkieChatCommand(command, params, client) {
return false; return false;
} }
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE); let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, V_ITEM_USE_TYPE_WALKIETALKIE);
if (!getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot]).enabled) { if (!getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot]).enabled) {
messagePlayerError(client, "Please turn on a walkie talkie first!"); messagePlayerError(client, "Please turn on a walkie talkie first!");
return false; return false;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: job.js // FILE: job.js
// DESC: Provides job functions and usage // DESC: Provides job functions and usage
@@ -9,37 +8,37 @@
// =========================================================================== // ===========================================================================
// Job Types // Job Types
const AGRP_JOB_NONE = 0; const V_JOB_NONE = 0;
const AGRP_JOB_POLICE = 1; const V_JOB_POLICE = 1;
const AGRP_JOB_MEDICAL = 2; const V_JOB_MEDICAL = 2;
const AGRP_JOB_FIRE = 3; const V_JOB_FIRE = 3;
const AGRP_JOB_BUS = 4; const V_JOB_BUS = 4;
const AGRP_JOB_TAXI = 5; const V_JOB_TAXI = 5;
const AGRP_JOB_GARBAGE = 6; const V_JOB_GARBAGE = 6;
const AGRP_JOB_WEAPON = 7; const V_JOB_WEAPON = 7;
const AGRP_JOB_DRUG = 8; const V_JOB_DRUG = 8;
const AGRP_JOB_PIZZA = 9; const V_JOB_PIZZA = 9;
const AGRP_JOB_GENERIC = 10; const V_JOB_GENERIC = 10;
// =========================================================================== // ===========================================================================
// Job Route States // Job Route States
const AGRP_JOB_ROUTE_STATE_NONE = 0; // None const V_JOB_ROUTE_STATE_NONE = 0; // None
const AGRP_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one. const V_JOB_ROUTE_STATE_INPROGRESS = 1; // Route is in progress. Player is in between stops but not at the last one.
const AGRP_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route const V_JOB_ROUTE_STATE_LASTSTOP = 2; // Player is heading to the last stop on the route
const AGRP_JOB_ROUTE_STATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume const V_JOB_ROUTE_STATE_PAUSED = 3; // Route is paused for some reason. For police, this could be player accepted callout and once finished, patrol route will resume
const AGRP_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one const V_JOB_ROUTE_STATE_ATSTOP = 4; // For bus/trash stops that freeze player, this is the state when they're at one
// =========================================================================== // ===========================================================================
// Job Route Location Types // Job Route Location Types
const AGRP_JOB_ROUTE_LOC_TYPE_NONE = 0; // None const V_JOB_ROUTE_LOC_TYPE_NONE = 0; // None
const AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes) const V_JOB_ROUTE_LOC_TYPE_CHECKPOINT = 1; // Checkpoint (used for bus routes)
const AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job) const V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE = 2; // Burning vehicle (used for firefighter job)
const AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job) const V_JOB_ROUTE_LOC_TYPE_INJURED_PED = 3; // Injured ped (used for paramedic job)
const AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job) const V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE = 4; // Mess/Garbage on ground (used for street sweeper job)
const AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job) const V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN = 5; // Garbage in bin (used for trash collector job)
const AGRP_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such const V_JOB_ROUTE_LOC_TYPE_FIRE = 5; // Scripted fire, placed on buildings and such
// =========================================================================== // ===========================================================================
@@ -57,7 +56,7 @@ class JobData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0; this.databaseId = 0;
this.serverId = 0; this.serverId = 0;
this.type = AGRP_JOB_NONE; this.type = V_JOB_NONE;
this.name = "Unnamed"; this.name = "Unnamed";
this.enabled = true; this.enabled = true;
this.blipModel = -1 this.blipModel = -1
@@ -176,7 +175,7 @@ class JobRouteLocationData {
this.position = toVector3(0.0, 0.0, 0.0); this.position = toVector3(0.0, 0.0, 0.0);
this.stopDelay = 0; this.stopDelay = 0;
this.pay = 0; this.pay = 0;
this.type = AGRP_JOB_ROUTE_LOC_TYPE_NONE; this.type = V_JOB_ROUTE_LOC_TYPE_NONE;
this.gotoMessage = ""; this.gotoMessage = "";
this.departMessage = ""; this.departMessage = "";
this.whoCreated = 0; this.whoCreated = 0;
@@ -469,60 +468,60 @@ class JobRouteLocationType {
// For use with the /jobrouteloctype command // For use with the /jobrouteloctype command
let jobRouteLocationTypes = { let jobRouteLocationTypes = {
[AGRP_GAME_GTA_III]: [ [V_GAME_GTA_III]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_GTA_VC]: [ [V_GAME_GTA_VC]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_GTA_SA]: [ [V_GAME_GTA_SA]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_GTA_IV]: [ [V_GAME_GTA_IV]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_MAFIA_ONE]: [ [V_GAME_MAFIA_ONE]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_MAFIA_TWO]: [ [V_GAME_MAFIA_TWO]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
[AGRP_GAME_MAFIA_ONE_DE]: [ [V_GAME_MAFIA_ONE_DE]: [
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_CHECKPOINT, "Checkpoint"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GROUND_GARBAGE, "GroundGarbage"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_GARBAGE_BIN, "GarbagePickup"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_BURNING_VEHICLE, "BurningVehicle"),
new JobRouteLocationType(AGRP_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"), new JobRouteLocationType(V_JOB_ROUTE_LOC_TYPE_INJURED_PED, "InjuredPed"),
], ],
} }
@@ -811,11 +810,11 @@ function createAllJobPickups() {
for (let j in getServerData().jobs[i].locations) { for (let j in getServerData().jobs[i].locations) {
pickupCount++; pickupCount++;
getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position); getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position);
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false); setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.type", V_PICKUP_JOB, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.id", j, false); setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.owner.id", j, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", AGRP_LABEL_JOB, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.type", V_LABEL_JOB, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.name", getServerData().jobs[i].name, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.name", getServerData().jobs[i].name, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.jobType", getServerData().jobs[i].databaseId, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "v.rp.label.jobType", getServerData().jobs[i].databaseId, true);
setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false); setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false);
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension); setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
addToWorld(getServerData().jobs[i].locations[j].pickup); addToWorld(getServerData().jobs[i].locations[j].pickup);
@@ -840,7 +839,7 @@ function showJobInformationToPlayer(client, jobType) {
} }
switch (jobType) { switch (jobType) {
case AGRP_JOB_POLICE: case V_JOB_POLICE:
if (!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
return false; return false;
} }
@@ -853,7 +852,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_MEDICAL: case V_JOB_MEDICAL:
messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "== Job Help =================================");
messagePlayerInfo(client, "- Paramedics help people by healing them."); messagePlayerInfo(client, "- Paramedics help people by healing them.");
messagePlayerInfo(client, "- Use /startwork at the hospital to work as a Paramedic."); messagePlayerInfo(client, "- Use /startwork at the hospital to work as a Paramedic.");
@@ -862,7 +861,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_FIRE: case V_JOB_FIRE:
if (!canClientUseFireJob(client)) { if (!canClientUseFireJob(client)) {
return false; return false;
} }
@@ -874,7 +873,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_BUS: case V_JOB_BUS:
messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "== Job Help =================================");
messagePlayerInfo(client, "- Bus Drivers transport people around the city on a route"); messagePlayerInfo(client, "- Bus Drivers transport people around the city on a route");
messagePlayerInfo(client, "- Use /startwork at the bus depot to work as a Bus Driver."); messagePlayerInfo(client, "- Use /startwork at the bus depot to work as a Bus Driver.");
@@ -883,7 +882,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_TAXI: case V_JOB_TAXI:
messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "== Job Help =================================");
messagePlayerInfo(client, "- Taxi Drivers transport people around the city"); messagePlayerInfo(client, "- Taxi Drivers transport people around the city");
messagePlayerInfo(client, "- Use /startwork at the taxi depot to work as a Taxi Driver."); messagePlayerInfo(client, "- Use /startwork at the taxi depot to work as a Taxi Driver.");
@@ -893,7 +892,7 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_GARBAGE: case V_JOB_GARBAGE:
messagePlayerInfo(client, "== Job Help ================================="); messagePlayerInfo(client, "== Job Help =================================");
messagePlayerInfo(client, "- Garbage Collectors pick up the trash around the city."); messagePlayerInfo(client, "- Garbage Collectors pick up the trash around the city.");
messagePlayerInfo(client, "- Use /startwork at the garbage depot to work as a Garbage Collector."); messagePlayerInfo(client, "- Use /startwork at the garbage depot to work as a Garbage Collector.");
@@ -904,10 +903,10 @@ function showJobInformationToPlayer(client, jobType) {
messagePlayerInfo(client, "- When finished, use /stopwork to stop working."); messagePlayerInfo(client, "- When finished, use /stopwork to stop working.");
break; break;
case AGRP_JOB_WEAPON: case V_JOB_WEAPON:
break; break;
case AGRP_JOB_DRUG: case V_JOB_DRUG:
break; break;
default: default:
@@ -949,7 +948,7 @@ function takeJobCommand(command, params, client) {
return false; return false;
} }
if (getPlayerCurrentSubAccount(client).job > AGRP_JOB_NONE) { if (getPlayerCurrentSubAccount(client).job > V_JOB_NONE) {
messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}")); messagePlayerInfo(client, getLocaleString(client, "QuitJobToTakeAnother", "{ALTCOLOUR}/quitjob{MAINCOLOUR}"));
return false; return false;
} }
@@ -981,7 +980,7 @@ function startWorkingCommand(command, params, client) {
return false; return false;
} }
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false; return false;
} }
@@ -993,7 +992,7 @@ function startWorkingCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else { } else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "DontHaveAJob")); messagePlayerError(client, getLocaleString(client, "DontHaveAJob"));
messagePlayerInfo(client, "You can get a job by going the yellow points on the map."); messagePlayerInfo(client, "You can get a job by going the yellow points on the map.");
return false; return false;
@@ -1054,41 +1053,41 @@ function startWorking(client) {
switchPlayerActiveHotBarSlot(client, -1); switchPlayerActiveHotBarSlot(client, -1);
getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client); getPlayerCurrentSubAccount(client).skin = getPlayerSkin(client);
storePlayerItemsInTempLocker(client); storePlayerItemsInTempLocker(client);
getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_JOB; getPlayerData(client).tempLockerType = V_TEMP_LOCKER_TYPE_JOB;
messagePlayerInfo(client, getLocaleString(client, "ItemsStoredForJob")); messagePlayerInfo(client, getLocaleString(client, "ItemsStoredForJob"));
getPlayerCurrentSubAccount(client).isWorking = true; getPlayerCurrentSubAccount(client).isWorking = true;
let jobId = getPlayerCurrentSubAccount(client).job; let jobId = getPlayerCurrentSubAccount(client).job;
switch (getJobIndexFromDatabaseId(jobId)) { switch (getJobIndexFromDatabaseId(jobId)) {
case AGRP_JOB_POLICE: case V_JOB_POLICE:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break; break;
case AGRP_JOB_MEDICAL: case V_JOB_MEDICAL:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break; break;
case AGRP_JOB_FIRE: case V_JOB_FIRE:
messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`)); messagePlayerInfo(client, getLocaleString(client, "JobEquipAndUniformLabel", `{ALTCOLOUR}/uniform{MAINCOLOUR}, {ALTCOLOUR}/equip{MAINCOLOUR}`));
break; break;
case AGRP_JOB_BUS: case V_JOB_BUS:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus"))); messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Bus")));
break; break;
case AGRP_JOB_TAXI: case V_JOB_TAXI:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi"))); messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "Taxi")));
break; break;
case AGRP_JOB_GARBAGE: case V_JOB_GARBAGE:
messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck"))); messagePlayerInfo(client, getLocaleString(client, "GetStartedJobVehicle", getGroupedLocaleString(client, "VehicleTypes", "GarbageTruck")));
break; break;
case AGRP_JOB_WEAPON: case V_JOB_WEAPON:
break; break;
case AGRP_JOB_DRUG: case V_JOB_DRUG:
break; break;
default: default:
@@ -1131,10 +1130,10 @@ function givePlayerJobEquipment(client, equipmentId) {
for (let i in getJobData(jobId).equipment[equipmentId].items) { for (let i in getJobData(jobId).equipment[equipmentId].items) {
let value = getJobData(jobId).equipment[equipmentId].items[i].value let value = getJobData(jobId).equipment[equipmentId].items[i].value
if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) { if (getItemTypeData(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType)).useType == V_ITEM_USE_TYPE_WALKIETALKIE) {
value = getJobData(jobId).walkieTalkieFrequency; value = getJobData(jobId).walkieTalkieFrequency;
} }
let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, AGRP_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); let itemId = createItem(getItemTypeIndexFromDatabaseId(getJobData(jobId).equipment[equipmentId].items[i].itemType), value, V_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId);
getItemData(itemId).needsSaved = false; getItemData(itemId).needsSaved = false;
getItemData(itemId).databaseId = -1; // Make sure it doesnt save getItemData(itemId).databaseId = -1; // Make sure it doesnt save
let freeSlot = getPlayerFirstEmptyHotBarSlot(client); let freeSlot = getPlayerFirstEmptyHotBarSlot(client);
@@ -1188,37 +1187,37 @@ function stopWorking(client) {
/* /*
switch (getJobType(jobId)) { switch (getJobType(jobId)) {
case AGRP_JOB_POLICE: case V_JOB_POLICE:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station"); messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the police station");
break; break;
case AGRP_JOB_MEDICAL: case V_JOB_MEDICAL:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital"); messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the hospital");
break; break;
case AGRP_JOB_FIRE: case V_JOB_FIRE:
messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station"); messagePlayerInfo(client, "Your uniform, equipment, and vehicle have been returned to the fire station");
break; break;
case AGRP_JOB_BUS: case V_JOB_BUS:
messagePlayerInfo(client, "Your vehicle has been returned to the bus depot"); messagePlayerInfo(client, "Your vehicle has been returned to the bus depot");
break; break;
case AGRP_JOB_TAXI: case V_JOB_TAXI:
messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot"); messagePlayerInfo(client, "Your vehicle has been returned to the taxi depot");
break; break;
case AGRP_JOB_GARBAGE: case V_JOB_GARBAGE:
messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump"); messagePlayerInfo(client, "Your vehicle has been returned to the city trash dump");
break; break;
case AGRP_JOB_WEAPON: case V_JOB_WEAPON:
break; break;
case AGRP_JOB_DRUG: case V_JOB_DRUG:
break; break;
case AGRP_JOB_GENERIC: case V_JOB_GENERIC:
messagePlayerInfo(client, "Your vehicle has been respawned at your job location"); messagePlayerInfo(client, "Your vehicle has been respawned at your job location");
break; break;
@@ -1259,7 +1258,7 @@ function jobUniformCommand(command, params, client) {
return false; return false;
} }
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false; return false;
} }
@@ -1271,7 +1270,7 @@ function jobUniformCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else { } else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "NotYourJob")); messagePlayerError(client, getLocaleString(client, "NotYourJob"));
messagePlayerInfo(client, getLocaleString(client, "JobPoints")); messagePlayerInfo(client, getLocaleString(client, "JobPoints"));
return false; return false;
@@ -1362,7 +1361,7 @@ function jobEquipmentCommand(command, params, client) {
return false; return false;
} }
if (getVehicleData(closestVehicle).ownerType != AGRP_VEHOWNER_JOB) { if (getVehicleData(closestVehicle).ownerType != V_VEHOWNER_JOB) {
messagePlayerError(client, getLocaleString(client, "NotAJobVehicle")); messagePlayerError(client, getLocaleString(client, "NotAJobVehicle"));
return false; return false;
} }
@@ -1374,7 +1373,7 @@ function jobEquipmentCommand(command, params, client) {
jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId)); jobData = getJobData(getJobIdFromDatabaseId(getVehicleData(closestVehicle).ownerId));
} else { } else {
if (getPlayerCurrentSubAccount(client).job == AGRP_JOB_NONE) { if (getPlayerCurrentSubAccount(client).job == V_JOB_NONE) {
messagePlayerError(client, getLocaleString(client, "NotYourJob")); messagePlayerError(client, getLocaleString(client, "NotYourJob"));
if (hasPlayerSeenActionTip(client, "JobLocations")) { if (hasPlayerSeenActionTip(client, "JobLocations")) {
@@ -2407,7 +2406,7 @@ function jobStopRouteCommand(command, params, client) {
return false; return false;
} }
//if(!doesPlayerHaveJobType(client, AGRP_JOB_BUS) && !doesPlayerHaveJobType(client, AGRP_JOB_GARBAGE)) { //if(!doesPlayerHaveJobType(client, V_JOB_BUS) && !doesPlayerHaveJobType(client, V_JOB_GARBAGE)) {
// messagePlayerError(client, "Your job doesn't use a route!"); // messagePlayerError(client, "Your job doesn't use a route!");
// return false; // return false;
//} //}
@@ -3193,11 +3192,11 @@ function createJobLocationPickup(jobId, locationId) {
tempJobData.locations[locationId].pickup = pickup; tempJobData.locations[locationId].pickup = pickup;
setElementDimension(pickup, tempJobData.locations[locationId].dimension); setElementDimension(pickup, tempJobData.locations[locationId].dimension);
setElementOnAllDimensions(pickup, false); setElementOnAllDimensions(pickup, false);
setEntityData(pickup, "agrp.owner.type", AGRP_PICKUP_JOB, false); setEntityData(pickup, "v.rp.owner.type", V_PICKUP_JOB, false);
setEntityData(pickup, "agrp.owner.id", locationId, false); setEntityData(pickup, "v.rp.owner.id", locationId, false);
setEntityData(pickup, "agrp.label.type", AGRP_LABEL_JOB, true); setEntityData(pickup, "v.rp.label.type", V_LABEL_JOB, true);
setEntityData(pickup, "agrp.label.name", tempJobData.name, true); setEntityData(pickup, "v.rp.label.name", tempJobData.name, true);
setEntityData(pickup, "agrp.label.jobType", tempJobData.databaseId, true); setEntityData(pickup, "v.rp.label.jobType", tempJobData.databaseId, true);
addToWorld(pickup); addToWorld(pickup);
} }
} else { } else {
@@ -3597,7 +3596,7 @@ function createJobRoute(routeName, closestJobLocation, whoCreated = defaultNoAcc
// =========================================================================== // ===========================================================================
function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = AGRP_JOB_ROUTE_LOC_TYPE_NONE) { function createJobRouteLocation(routeLocationName, position, jobRouteData, whoCreated = defaultNoAccountId, delay = 0, arriveMessage = "", gotoMessage = "", type = V_JOB_ROUTE_LOC_TYPE_NONE) {
let tempJobRouteLocationData = new JobRouteLocationData(false); let tempJobRouteLocationData = new JobRouteLocationData(false);
tempJobRouteLocationData.name = routeLocationName; tempJobRouteLocationData.name = routeLocationName;
tempJobRouteLocationData.routeId = jobRouteData.databaseId; tempJobRouteLocationData.routeId = jobRouteData.databaseId;

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: bus.js // FILE: bus.js
// DESC: Provides bus driver job functions and usage // DESC: Provides bus driver job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: drug.js // FILE: drug.js
// DESC: Provides drug runner/dealer job functions and usage // DESC: Provides drug runner/dealer job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: fire.js // FILE: fire.js
// DESC: Provides firefighter job functions and usage // DESC: Provides firefighter job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: garbage.js // FILE: garbage.js
// DESC: Provides garbage collector job functions and usage // DESC: Provides garbage collector job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: medic.js // FILE: medic.js
// DESC: Provides paramedic job functions and usage // DESC: Provides paramedic job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: pizza-delivery.js // FILE: pizza-delivery.js
// DESC: Provides pizza delivery driver job functions and usage // DESC: Provides pizza delivery driver job functions and usage

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: police.js // FILE: police.js
// DESC: Provides police officer job functions and usage // DESC: Provides police officer job functions and usage
@@ -24,7 +23,7 @@ function policeTazerCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -50,7 +49,7 @@ function policeCuffCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -76,7 +75,7 @@ function policeArrestCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -102,7 +101,7 @@ function policeSearchCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -128,7 +127,7 @@ function policeDragCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -154,7 +153,7 @@ function policeDetainCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, V_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }

View File

@@ -1,7 +1,6 @@
// =========================================================================== // ===========================================================================
// Asshat Gaming Roleplay // Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/agrp_main // https://github.com/VortrexFTW/v-roleplay
// (c) 2022 Asshat Gaming
// =========================================================================== // ===========================================================================
// FILE: taxi.js // FILE: taxi.js
// DESC: Provides taxi driver job functions and usage // DESC: Provides taxi driver job functions and usage
@@ -24,7 +23,7 @@ function taxiSetFareCommand(command, params, client) {
return false; return false;
} }
if (!doesPlayerHaveJobType(client, AGRP_JOB_TAXI)) { if (!doesPlayerHaveJobType(client, V_JOB_TAXI)) {
messagePlayerError(client, "You don't have a taxi job."); messagePlayerError(client, "You don't have a taxi job.");
return false; return false;
} }

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