Change net event and const prefix

This commit is contained in:
Vortrex
2022-06-30 18:29:00 -05:00
parent dd3f027c1e
commit 2f7f3a1b00
51 changed files with 1124 additions and 1125 deletions

View File

@@ -19,7 +19,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
let freezePlayer = false; let freezePlayer = false;
switch (animationData.moveType) { switch (animationData.moveType) {
case VRR_ANIMMOVE_FORWARD: { case AGRP_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));
@@ -28,7 +28,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case VRR_ANIMMOVE_BACK: { case AGRP_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));
@@ -37,7 +37,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case VRR_ANIMMOVE_LEFT: { case AGRP_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));
@@ -46,7 +46,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break; break;
} }
case VRR_ANIMMOVE_RIGHT: { case AGRP_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));
@@ -60,9 +60,9 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
} }
} }
if (getGame() < VRR_GAME_GTA_IV) { if (getGame() < AGRP_GAME_GTA_IV) {
if (animationData.animType == VRR_ANIMTYPE_NORMAL || animationData.animType == VRR_ANIMTYPE_SURRENDER) { if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) {
if (getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations(); ped.clearAnimations();
} else { } else {
ped.clearObjective(); ped.clearObjective();
@@ -74,7 +74,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
setLocalPlayerControlState(false, false); setLocalPlayerControlState(false, false);
localPlayer.collisionsEnabled = false; localPlayer.collisionsEnabled = false;
} }
} else if (animationData.animType == VRR_ANIMTYPE_BLEND) { } else if (animationData.animType == AGRP_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);
} }
@@ -95,7 +95,7 @@ function forcePedAnimation(pedId, animSlot) {
let animationData = getAnimationData(animSlot); let animationData = getAnimationData(animSlot);
if (getGame() < VRR_GAME_GTA_IV) { if (getGame() < AGRP_GAME_GTA_IV) {
ped.position = ped.position; ped.position = ped.position;
ped.addAnimation(animationData.groupId, animationData.animId); ped.addAnimation(animationData.groupId, animationData.animId);
@@ -119,8 +119,8 @@ function makePedStopAnimation(pedId) {
return false; return false;
} }
if (getGame() != VRR_GAME_GTA_IV) { if (getGame() != AGRP_GAME_GTA_IV) {
if (getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) { if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations(); ped.clearAnimations();
} else { } else {
ped.clearObjective(); ped.clearObjective();
@@ -128,7 +128,7 @@ function makePedStopAnimation(pedId) {
} }
if (ped == localPlayer) { if (ped == localPlayer) {
if (getGame() != VRR_GAME_GTA_IV) { if (getGame() != AGRP_GAME_GTA_IV) {
localPlayer.collisionsEnabled = true; localPlayer.collisionsEnabled = true;
} }
setLocalPlayerControlState(true, false); setLocalPlayerControlState(true, false);

View File

@@ -41,7 +41,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
if (blipModel == -1) { if (blipModel == -1) {
if (businessData.blipId != -1) { if (businessData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`); logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId); natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -55,7 +55,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
} else { } else {
if (businessData.blipId != -1) { if (businessData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`); logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_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

@@ -151,7 +151,7 @@ function onElementStreamIn(event, element) {
function onLocalPlayerExitedVehicle(event, vehicle, seat) { function onLocalPlayerExitedVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`); logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (inVehicleSeat) { if (inVehicleSeat) {
parkedVehiclePosition = false; parkedVehiclePosition = false;
@@ -164,7 +164,7 @@ function onLocalPlayerExitedVehicle(event, vehicle, seat) {
function onLocalPlayerEnteredVehicle(event, vehicle, seat) { function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`); logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
//if(inVehicleSeat == 0) { //if(inVehicleSeat == 0) {
@@ -188,7 +188,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
if (damagedEntity == localPlayer) { if (damagedEntity == localPlayer) {
//if(!weaponDamageEnabled[damagerEntity.name]) { //if(!weaponDamageEnabled[damagerEntity.name]) {
preventDefaultEventAction(event); preventDefaultEventAction(event);
sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); sendNetworkEventToServer("agrp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
//} //}
} }
} }

View File

@@ -17,8 +17,8 @@ let gpsBlipBlinkTimer = null;
function showGPSLocation(position, colour) { function showGPSLocation(position, colour) {
logToConsole(LOG_DEBUG, `[VRR.GPS] Showing gps location`); logToConsole(LOG_DEBUG, `[VRR.GPS] Showing gps location`);
if(getMultiplayerMod() == VRR_MPMOD_GTAC) { if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == AGRP_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 {
@@ -26,7 +26,7 @@ function showGPSLocation(position, colour) {
gpsSphere.colour = colour; gpsSphere.colour = colour;
} }
if(gpsBlip != null) { if (gpsBlip != null) {
destroyElement(gpsBlip); destroyElement(gpsBlip);
} }
@@ -40,16 +40,16 @@ function showGPSLocation(position, colour) {
function blinkGPSBlip(times, position, colour) { function blinkGPSBlip(times, position, colour) {
gpsBlipBlinkTimes = times; gpsBlipBlinkTimes = times;
gpsBlipBlinkTimer = setInterval(function() { gpsBlipBlinkTimer = setInterval(function () {
if(gpsBlip != null) { if (gpsBlip != null) {
destroyElement(gpsBlip); destroyElement(gpsBlip);
gpsBlip = null; gpsBlip = null;
} else { } else {
gpsBlip = game.createBlip(position, 0, 2, colour); gpsBlip = game.createBlip(position, 0, 2, colour);
} }
if(gpsBlipBlinkAmount >= gpsBlipBlinkTimes) { if (gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
if(gpsBlip != null) { if (gpsBlip != null) {
destroyElement(gpsBlip); destroyElement(gpsBlip);
gpsBlip = null; gpsBlip = null;
} }

View File

@@ -25,8 +25,8 @@ class HouseData {
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) { function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`); logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`);
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
if(getHouseData(houseId) != false) { if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
houseData.description = description; houseData.description = description;
houseData.entrancePosition = entrancePosition; houseData.entrancePosition = entrancePosition;
@@ -35,10 +35,10 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
houseData.hasInterior = hasInterior; houseData.hasInterior = hasInterior;
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`);
if(blipModel == -1) { if (blipModel == -1) {
if(houseData.blipId != -1) { if (houseData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been removed by the server`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); natives.removeBlipAndClearIndex(getHouseData(houseId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -48,18 +48,18 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`);
} }
} else { } else {
if(houseData.blipId != -1) { if (houseData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been changed by the server`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_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);
natives.setBlipAsShortRange(houseData.blipId, true); natives.setBlipAsShortRange(houseData.blipId, true);
natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ...": ""}`); natives.changeBlipNameFromAscii(houseData.blipId, `${houseData.name.substr(0, 24)}${(houseData.name.length > 24) ? " ..." : ""}`);
} }
} else { } else {
let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name); let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name);
if(blipId != -1) { if (blipId != -1) {
houseData.blipId = blipId; houseData.blipId = blipId;
} }
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
@@ -68,9 +68,9 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`);
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior); let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
if(blipModel != -1) { if (blipModel != -1) {
let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House"); let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
if(blipId != -1) { if (blipId != -1) {
tempHouseData.blipId = blipId; tempHouseData.blipId = blipId;
} }
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
@@ -89,10 +89,10 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
* @param {number} houseId - The ID of the house (initially provided by server) * @param {number} houseId - The ID of the house (initially provided by server)
* @return {HouseData} The house's data (class instance) * @return {HouseData} The house's data (class instance)
*/ */
function getHouseData(houseId) { function getHouseData(houseId) {
let houses = getServerData().houses; let houses = getServerData().houses;
for(let i in houses) { for (let i in houses) {
if(houses[i].houseId == houseId) { if (houses[i].houseId == houseId) {
return houses[i]; return houses[i];
} }
} }
@@ -103,7 +103,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
// =========================================================================== // ===========================================================================
function setAllHouseDataIndexes() { function setAllHouseDataIndexes() {
for(let i in getServerData().houses) { for (let i in getServerData().houses) {
getServerData().houses[i].index = i; getServerData().houses[i].index = i;
} }
} }

View File

@@ -57,8 +57,8 @@ function setLocalPlayerWorkingState(tempWorking) {
function showJobRouteLocation(position, colour) { function showJobRouteLocation(position, colour) {
logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`); logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`);
if(getMultiplayerMod() == VRR_MPMOD_GTAC) { if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == AGRP_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 {
@@ -66,7 +66,7 @@ function showJobRouteLocation(position, colour) {
jobRouteLocationSphere.colour = colour; jobRouteLocationSphere.colour = colour;
} }
if(jobRouteLocationBlip != null) { if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip); destroyElement(jobRouteLocationBlip);
} }
@@ -85,12 +85,12 @@ function enteredJobRouteSphere() {
jobBlipBlinkAmount = 0; jobBlipBlinkAmount = 0;
jobBlipBlinkTimes = 0; jobBlipBlinkTimes = 0;
if(jobRouteLocationBlip != null) { if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip); destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null; jobRouteLocationBlip = null;
} }
if(jobRouteLocationSphere != null) { if (jobRouteLocationSphere != null) {
destroyElement(jobRouteLocationSphere); destroyElement(jobRouteLocationSphere);
jobRouteLocationSphere = null; jobRouteLocationSphere = null;
} }
@@ -102,16 +102,16 @@ function enteredJobRouteSphere() {
function blinkJobRouteLocationBlip(times, position, colour) { function blinkJobRouteLocationBlip(times, position, colour) {
jobBlipBlinkTimes = times; jobBlipBlinkTimes = times;
jobBlipBlinkTimer = setInterval(function() { jobBlipBlinkTimer = setInterval(function () {
if(jobRouteLocationBlip != null) { if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip); destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null; jobRouteLocationBlip = null;
} else { } else {
jobRouteLocationBlip = game.createBlip(position, 0, 2, colour); jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
} }
if(jobBlipBlinkAmount >= jobBlipBlinkTimes) { if (jobBlipBlinkAmount >= jobBlipBlinkTimes) {
if(jobRouteLocationBlip != null) { if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip); destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null; jobRouteLocationBlip = null;
} }
@@ -138,8 +138,8 @@ function hideJobRouteLocation() {
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) { function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`); logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_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;
jobData.name = name; jobData.name = name;
@@ -148,10 +148,10 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
jobData.pickupModel = pickupModel; jobData.pickupModel = pickupModel;
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`);
if(blipModel == -1) { if (blipModel == -1) {
if(jobData.blipId != -1) { if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been removed by the server`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getJobData(jobId).blipId); natives.removeBlipAndClearIndex(getJobData(jobId).blipId);
} else { } else {
destroyElement(getElementFromId(blipId)); destroyElement(getElementFromId(blipId));
@@ -161,18 +161,18 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip is unchanged`);
} }
} else { } else {
if(jobData.blipId != -1) { if (jobData.blipId != -1) {
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been changed by the server`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_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);
natives.setBlipAsShortRange(jobData.blipId, true); natives.setBlipAsShortRange(jobData.blipId, true);
natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ...": ""}`); natives.changeBlipNameFromAscii(jobData.blipId, `${jobData.name.substr(0, 24)}${(jobData.name.length > 24) ? " ..." : ""}`);
} }
} else { } else {
let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name); let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name);
if(blipId != -1) { if (blipId != -1) {
jobData.blipId = blipId; jobData.blipId = blipId;
} }
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
@@ -181,9 +181,9 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`);
let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel); let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel);
if(blipModel != -1) { if (blipModel != -1) {
let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name); let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name);
if(blipId != -1) { if (blipId != -1) {
tempJobData.blipId = blipId; tempJobData.blipId = blipId;
} }
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`); logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
@@ -202,9 +202,9 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
* @param {number} job - The ID of the job (initially provided by server) * @param {number} job - The ID of the job (initially provided by server)
* @return {JobData} The job's data (class instance) * @return {JobData} The job's data (class instance)
*/ */
function getJobData(jobId) { function getJobData(jobId) {
for(let i in getServerData().jobs) { for (let i in getServerData().jobs) {
if(getServerData().jobs[i].jobId == jobId) { if (getServerData().jobs[i].jobId == jobId) {
return getServerData().jobs[i]; return getServerData().jobs[i];
} }
} }
@@ -215,7 +215,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
// =========================================================================== // ===========================================================================
function setAllJobDataIndexes() { function setAllJobDataIndexes() {
for(let i in getServerData().jobs) { for (let i in getServerData().jobs) {
jobs[i].index = i; jobs[i].index = i;
} }
} }

View File

@@ -333,37 +333,37 @@ 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("vrr.label.type") != null) { if (pickups[i].getData("agrp.label.type") != null) {
if (getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) { if (getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
if (!pickups[i].isOnScreen) { if (!pickups[i].isOnScreen) {
let price = "0"; let price = "0";
let rentPrice = "0"; let rentPrice = "0";
let labelInfoType = VRR_PROPLABEL_INFO_NONE; let labelInfoType = VRR_PROPLABEL_INFO_NONE;
if (pickups[i].getData("vrr.label.price") != null) { if (pickups[i].getData("agrp.label.price") != null) {
price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price")); price = makeLargeNumberReadable(pickups[i].getData("agrp.label.price"));
} }
if (pickups[i].getData("vrr.label.rentprice") != null) { if (pickups[i].getData("agrp.label.rentprice") != null) {
rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice")); rentPrice = makeLargeNumberReadable(pickups[i].getData("agrp.label.rentprice"));
} }
if (pickups[i].getData("vrr.label.help") != null) { if (pickups[i].getData("agrp.label.help") != null) {
labelInfoType = pickups[i].getData("vrr.label.help"); labelInfoType = pickups[i].getData("agrp.label.help");
} }
switch (pickups[i].getData("vrr.label.type")) { switch (pickups[i].getData("agrp.label.type")) {
case VRR_LABEL_BUSINESS: { case VRR_LABEL_BUSINESS: {
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType); renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), true, price, rentPrice, labelInfoType);
break; break;
} }
case VRR_LABEL_HOUSE: { case VRR_LABEL_HOUSE: {
renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType); renderPropertyEntranceLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.locked"), false, price, rentPrice, labelInfoType);
break; break;
} }
case VRR_LABEL_JOB: { case VRR_LABEL_JOB: {
renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType")); renderJobLabel(pickups[i].getData("agrp.label.name"), pickups[i].position, pickups[i].getData("agrp.label.jobType"));
break; break;
} }

View File

@@ -63,7 +63,7 @@ let mouseCameraEnabled = false;
let currentPickup = false; let currentPickup = false;
let vehiclePurchaseState = VRR_VEHBUYSTATE_NONE; let vehiclePurchaseState = AGRP_VEHBUYSTATE_NONE;
let vehiclePurchasing = null; let vehiclePurchasing = null;
let vehiclePurchasePosition = null; let vehiclePurchasePosition = null;

View File

@@ -48,10 +48,10 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
playerPaused[clientName] = paused; playerPaused[clientName] = paused;
playerPing[clientName] = ping; playerPing[clientName] = ping;
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_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) {
getPlayerPed(client).setNametag(characterName, colour); getPlayerPed(client).setNametag(characterName, colour);
} }
} }
@@ -67,7 +67,7 @@ function updatePlayerPing(clientName, ping) {
// =========================================================================== // ===========================================================================
function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, afk, skin) { function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, afk, skin) {
if(nametagFont == null) { if (nametagFont == null) {
return false; return false;
} }
@@ -80,10 +80,10 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// ------------------------------------------- // -------------------------------------------
// Health Bar // Health Bar
if(getMultiplayerMod() == VRR_MPMOD_GTAC) { if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == AGRP_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;
} else { } else {
y -= 5; y -= 5;
@@ -95,44 +95,43 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
y -= 5; y -= 5;
} }
if(health > 0.0) { if (health > 0.0) {
let hx = x-width/2; let hx = x - width / 2;
let hy = y-10/2; let hy = y - 10 / 2;
let colourB = toColour(0, 0, 0, Math.floor(255.0*alpha)); // Background colour (black) let colourB = toColour(0, 0, 0, Math.floor(255.0 * alpha)); // Background colour (black)
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB); graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
let colour = toColour(Math.floor(255.0-(health*255.0)), Math.floor(health*255.0), 0, Math.floor(255.0*alpha)); // Health bar colour (varies, depending on health) let colour = toColour(Math.floor(255.0 - (health * 255.0)), Math.floor(health * 255.0), 0, Math.floor(255.0 * alpha)); // Health bar colour (varies, depending on health)
graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*health, 10-6], colour, colour, colour, colour); graphics.drawRectangle(null, [hx + 2, hy + 2], [(width - 4) * health, 10 - 6], colour, colour, colour, colour);
} }
// Armour Bar // Armour Bar
if (armour > 0.0) if (armour > 0.0) {
{
// Go up 10 pixels to draw the next part // Go up 10 pixels to draw the next part
y -= 10; y -= 10;
let hx = x-width/2; let hx = x - width / 2;
let hy = y-10/2; let hy = y - 10 / 2;
let colourB = toColour(255, 0, 0, 0); // Background colour (black) let colourB = toColour(255, 0, 0, 0); // Background colour (black)
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB); graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
let colour = toColour(255, 255, 255, 255); // Armour bar colour (white) let colour = toColour(255, 255, 255, 255); // Armour bar colour (white)
graphics.drawRectangle(null, [hx+2, hy+2], [(width-4)*armour, 10-6], colour, colour, colour, colour); graphics.drawRectangle(null, [hx + 2, hy + 2], [(width - 4) * armour, 10 - 6], colour, colour, colour, colour);
} }
y -= 20; y -= 20;
// Nametag // Nametag
if(nametagFont != null) { if (nametagFont != null) {
let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false); let size = nametagFont.measure(text, game.width, 0.0, 0.0, nametagFont.size, false, false);
nametagFont.render(text, [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true); nametagFont.render(text, [x - size[0] / 2, y - size[1] / 2], game.width, 0.0, 0.0, nametagFont.size, colour, false, false, false, true);
} }
// Go up another 10 pixels for the next part // Go up another 10 pixels for the next part
y -= 20; y -= 20;
// AFK Status // AFK Status
if(afkStatusFont != null) { if (afkStatusFont != null) {
if(afk) { if (afk) {
let size = afkStatusFont.measure("PAUSED", game.width, 0.0, 0.0, afkStatusFont.size, false, false); let size = afkStatusFont.measure("PAUSED", game.width, 0.0, 0.0, afkStatusFont.size, false, false);
afkStatusFont.render("PAUSED", [x-size[0]/2, y-size[1]/2], game.width, 0.0, 0.0, afkStatusFont.size, toColour(255, 0, 0, 255), false, false, false, true); afkStatusFont.render("PAUSED", [x - size[0] / 2, y - size[1] / 2], game.width, 0.0, 0.0, afkStatusFont.size, toColour(255, 0, 0, 255), false, false, false, true);
} }
} }
} }
@@ -140,11 +139,11 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// =========================================================================== // ===========================================================================
function updateNametag(element) { function updateNametag(element) {
if(!areWorldLabelsSupported()) { if (!areWorldLabelsSupported()) {
return false; return false;
} }
if(localPlayer != null) { if (localPlayer != null) {
let playerPos = localPlayer.position; let playerPos = localPlayer.position;
let elementPos = element.position; let elementPos = element.position;
@@ -154,50 +153,50 @@ function updateNametag(element) {
let screenPos = getScreenFromWorldPosition(elementPos); let screenPos = getScreenFromWorldPosition(elementPos);
if (screenPos[2] >= 0.0) { if (screenPos[2] >= 0.0) {
let health = element.health/100.0; let health = element.health / 100.0;
if(health > 1.0) { if (health > 1.0) {
health = 1.0; health = 1.0;
} }
let armour = element.armour/100.0; let armour = element.armour / 100.0;
if(armour > 1.0) { if (armour > 1.0) {
armour = 1.0; armour = 1.0;
} }
let distance = playerPos.distance(elementPos); let distance = playerPos.distance(elementPos);
if(distance <= nametagDistance) { if (distance <= nametagDistance) {
if(typeof game.processLineOfSight != "undefined") { if (typeof game.processLineOfSight != "undefined") {
let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true); let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true);
if(losCheck != null) { if (losCheck != null) {
return false; return false;
} }
} }
if(element.type == ELEMENT_PLAYER) { if (element.type == ELEMENT_PLAYER) {
let name = element.name; let name = element.name;
let colour = COLOUR_WHITE; let colour = COLOUR_WHITE;
let paused = false; let paused = false;
let ping = -1; let ping = -1;
if(element.isType(ELEMENT_PLAYER)) { if (element.isType(ELEMENT_PLAYER)) {
if(typeof playerNames[element.name] != "undefined") { if (typeof playerNames[element.name] != "undefined") {
name = playerNames[element.name]; name = playerNames[element.name];
} }
if(typeof playerPaused[element.name] != "undefined") { if (typeof playerPaused[element.name] != "undefined") {
paused = playerPaused[element.name]; paused = playerPaused[element.name];
} }
if(typeof playerColours[element.name] != "undefined") { if (typeof playerColours[element.name] != "undefined") {
colour = playerColours[element.name]; colour = playerColours[element.name];
} }
if(typeof playerPing[element.name] != "undefined") { if (typeof playerPing[element.name] != "undefined") {
ping = playerPing[element.name]; ping = playerPing[element.name];
} }
} }
drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0-distance/nametagDistance, distance, colour, paused, element.skin); drawNametag(screenPos[0], screenPos[1], health, armour, name, ping, 1.0 - distance / nametagDistance, distance, colour, paused, element.skin);
} }
} }
} }
@@ -207,8 +206,8 @@ function updateNametag(element) {
// =========================================================================== // ===========================================================================
function getClientFromPlayer(player) { function getClientFromPlayer(player) {
getClients().forEach(function(client) { getClients().forEach(function (client) {
if(getPlayerPed(client) == player) { if (getPlayerPed(client) == player) {
return client; return client;
} }
}); });
@@ -221,8 +220,8 @@ function processNameTagRendering(event) {
// return false; // return false;
//} //}
getElementsByType(ELEMENT_PED).forEach(function(ped) { getElementsByType(ELEMENT_PED).forEach(function (ped) {
if(ped != localPlayer) { if (ped != localPlayer) {
updateNametag(ped); updateNametag(ped);
} }
}); });

View File

@@ -20,157 +20,157 @@ 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("vrr.chatScrollLines", setChatScrollLines); addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines);
addNetworkEventHandler("vrr.chatAutoHideDelay", setChatAutoHideDelay); addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay);
addNetworkEventHandler("vrr.chatTimeStamps", setChatBoxTimeStampsState); addNetworkEventHandler("agrp.chatTimeStamps", setChatBoxTimeStampsState);
// Messaging (like textdraws and stuff) // Messaging (like textdraws and stuff)
addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage);
// Job // Job
addNetworkEventHandler("vrr.job", receiveJobFromServer); addNetworkEventHandler("agrp.job", receiveJobFromServer);
addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState); addNetworkEventHandler("agrp.working", setLocalPlayerWorkingState);
addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType); addNetworkEventHandler("agrp.jobType", setLocalPlayerJobType);
addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); addNetworkEventHandler("agrp.showJobRouteLocation", showJobRouteLocation);
addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); addNetworkEventHandler("agrp.hideJobRouteLocation", hideJobRouteLocation);
// Local player states and values // Local player states and values
addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); addNetworkEventHandler("agrp.restoreCamera", restoreLocalCamera);
addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); addNetworkEventHandler("agrp.cameraLookAt", setLocalCameraLookAt);
addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState); addNetworkEventHandler("agrp.freeze", setLocalPlayerFrozenState);
addNetworkEventHandler("vrr.control", setLocalPlayerControlState); addNetworkEventHandler("agrp.control", setLocalPlayerControlState);
addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera); addNetworkEventHandler("agrp.fadeCamera", fadeLocalCamera);
addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle); addNetworkEventHandler("agrp.removeFromVehicle", removeLocalPlayerFromVehicle);
addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons); addNetworkEventHandler("agrp.clearWeapons", clearLocalPlayerWeapons);
addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon); addNetworkEventHandler("agrp.giveWeapon", giveLocalPlayerWeapon);
addNetworkEventHandler("vrr.position", setLocalPlayerPosition); addNetworkEventHandler("agrp.position", setLocalPlayerPosition);
addNetworkEventHandler("vrr.heading", setLocalPlayerHeading); addNetworkEventHandler("agrp.heading", setLocalPlayerHeading);
addNetworkEventHandler("vrr.interior", setLocalPlayerInterior); addNetworkEventHandler("agrp.interior", setLocalPlayerInterior);
addNetworkEventHandler("vrr.spawned", onServerSpawnedLocalPlayer); addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer);
addNetworkEventHandler("vrr.money", setLocalPlayerCash); addNetworkEventHandler("agrp.money", setLocalPlayerCash);
addNetworkEventHandler("vrr.armour", setLocalPlayerArmour); addNetworkEventHandler("agrp.armour", setLocalPlayerArmour);
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin);
addNetworkEventHandler("vrr.pedSpeak", makeLocalPlayerPedSpeak); addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak);
addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); addNetworkEventHandler("agrp.infiniteRun", setLocalPlayerInfiniteRun);
addNetworkEventHandler("vrr.playerCop", setLocalPlayerAsCopState); addNetworkEventHandler("agrp.playerCop", setLocalPlayerAsCopState);
addNetworkEventHandler("vrr.health", setLocalPlayerHealth); addNetworkEventHandler("agrp.health", setLocalPlayerHealth);
addNetworkEventHandler("vrr.wantedLevel", setLocalPlayerWantedLevel); addNetworkEventHandler("agrp.wantedLevel", setLocalPlayerWantedLevel);
addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); addNetworkEventHandler("agrp.playerPedId", sendLocalPlayerNetworkIdToServer);
addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); addNetworkEventHandler("agrp.ped", setLocalPlayerPedPartsAndProps);
addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn); addNetworkEventHandler("agrp.spawn", serverRequestedLocalPlayerSpawn);
addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); addNetworkEventHandler("agrp.clearPedState", clearLocalPedState);
addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); addNetworkEventHandler("agrp.drunkEffect", setLocalPlayerDrunkEffect);
addNetworkEventHandler("vrr.deleteLocalPlayerPed", deleteLocalPlayerPed); addNetworkEventHandler("agrp.deleteLocalPlayerPed", deleteLocalPlayerPed);
// Vehicle // Vehicle
addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer); addNetworkEventHandler("agrp.vehicle", receiveVehicleFromServer);
addNetworkEventHandler("vrr.veh.lights", setVehicleLights); addNetworkEventHandler("agrp.veh.lights", setVehicleLights);
addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
addNetworkEventHandler("vrr.veh.repair", repairVehicle); addNetworkEventHandler("agrp.veh.repair", repairVehicle);
// Radio // Radio
addNetworkEventHandler("vrr.radioStream", playStreamingRadio); addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
addNetworkEventHandler("vrr.audioFileStream", playAudioFile); addNetworkEventHandler("agrp.audioFileStream", playAudioFile);
addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio); addNetworkEventHandler("agrp.stopRadioStream", stopStreamingRadio);
addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume); addNetworkEventHandler("agrp.radioVolume", setStreamingRadioVolume);
// Key Bindings // Key Bindings
addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); addNetworkEventHandler("agrp.delKeyBind", unBindAccountKey);
addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); addNetworkEventHandler("agrp.addKeyBind", bindAccountKey);
addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); addNetworkEventHandler("agrp.clearKeyBinds", clearKeyBinds);
// Weapon Damage // Weapon Damage
addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); addNetworkEventHandler("agrp.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); addNetworkEventHandler("agrp.weaponDamageEvent", setPlayerWeaponDamageEvent);
// GUI // GUI
addNetworkEventHandler("vrr.showRegistration", showRegistrationGUI); addNetworkEventHandler("agrp.showRegistration", showRegistrationGUI);
addNetworkEventHandler("vrr.showNewCharacter", showNewCharacterGUI); addNetworkEventHandler("agrp.showNewCharacter", showNewCharacterGUI);
addNetworkEventHandler("vrr.showLogin", showLoginGUI); addNetworkEventHandler("agrp.showLogin", showLoginGUI);
addNetworkEventHandler("vrr.2fa", showTwoFactorAuthGUI); addNetworkEventHandler("agrp.2fa", showTwoFactorAuthGUI);
addNetworkEventHandler("vrr.showResetPasswordCodeInput", resetPasswordCodeInputGUI); addNetworkEventHandler("agrp.showResetPasswordCodeInput", resetPasswordCodeInputGUI);
addNetworkEventHandler("vrr.showResetPasswordEmailInput", resetPasswordEmailInputGUI); addNetworkEventHandler("agrp.showResetPasswordEmailInput", resetPasswordEmailInputGUI);
addNetworkEventHandler("vrr.showChangePassword", showChangePasswordGUI); addNetworkEventHandler("agrp.showChangePassword", showChangePasswordGUI);
addNetworkEventHandler("vrr.showCharacterSelect", showCharacterSelectGUI); addNetworkEventHandler("agrp.showCharacterSelect", showCharacterSelectGUI);
addNetworkEventHandler("vrr.switchCharacterSelect", switchCharacterSelectGUI); addNetworkEventHandler("agrp.switchCharacterSelect", switchCharacterSelectGUI);
addNetworkEventHandler("vrr.showError", showErrorGUI); addNetworkEventHandler("agrp.showError", showErrorGUI);
addNetworkEventHandler("vrr.showInfo", showInfoGUI); addNetworkEventHandler("agrp.showInfo", showInfoGUI);
addNetworkEventHandler("vrr.showPrompt", showYesNoPromptGUI); addNetworkEventHandler("agrp.showPrompt", showYesNoPromptGUI);
addNetworkEventHandler("vrr.loginSuccess", loginSuccess); addNetworkEventHandler("agrp.loginSuccess", loginSuccess);
addNetworkEventHandler("vrr.characterSelectSuccess", characterSelectSuccess); addNetworkEventHandler("agrp.characterSelectSuccess", characterSelectSuccess);
addNetworkEventHandler("vrr.loginFailed", loginFailed); addNetworkEventHandler("agrp.loginFailed", loginFailed);
addNetworkEventHandler("vrr.registrationSuccess", registrationSuccess); addNetworkEventHandler("agrp.registrationSuccess", registrationSuccess);
addNetworkEventHandler("vrr.registrationFailed", registrationFailed); addNetworkEventHandler("agrp.registrationFailed", registrationFailed);
addNetworkEventHandler("vrr.newCharacterFailed", newCharacterFailed); addNetworkEventHandler("agrp.newCharacterFailed", newCharacterFailed);
addNetworkEventHandler("vrr.changePassword", showChangePasswordGUI); addNetworkEventHandler("agrp.changePassword", showChangePasswordGUI);
addNetworkEventHandler("vrr.showLocaleChooser", showLocaleChooserGUI); addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
addNetworkEventHandler("vrr.guiColour", setGUIColours); addNetworkEventHandler("agrp.guiColour", setGUIColours);
// Business // Business
addNetworkEventHandler("vrr.business", receiveBusinessFromServer); addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
// House // House
addNetworkEventHandler("vrr.house", receiveHouseFromServer); addNetworkEventHandler("agrp.house", receiveHouseFromServer);
// GPS // GPS
addNetworkEventHandler("vrr.showGPSBlip", showGPSLocation); addNetworkEventHandler("agrp.showGPSBlip", showGPSLocation);
// Locale // Locale
addNetworkEventHandler("vrr.locale", setLocale); addNetworkEventHandler("agrp.locale", setLocale);
addNetworkEventHandler("vrr.localeChooser", toggleLocaleChooserGUI); addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI);
// Misc // Misc
addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
addNetworkEventHandler("vrr.mouseCamera", toggleMouseCamera); addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
addNetworkEventHandler("vrr.clearPickups", clearLocalPlayerOwnedPickups); addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
addNetworkEventHandler("vrr.logo", setServerLogoRenderState); addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
addNetworkEventHandler("vrr.ambience", setCityAmbienceState); addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
addNetworkEventHandler("vrr.runCode", runClientCode); addNetworkEventHandler("agrp.runCode", runClientCode);
addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
addNetworkEventHandler("vrr.snow", setSnowState); addNetworkEventHandler("agrp.snow", setSnowState);
addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
addNetworkEventHandler("vrr.set2DRendering", set2DRendering); addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
addNetworkEventHandler("vrr.logLevel", setLogLevel); addNetworkEventHandler("agrp.logLevel", setLogLevel);
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
addNetworkEventHandler("vrr.nametag", updatePlayerNameTag); addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
addNetworkEventHandler("vrr.nametagDistance", setNameTagDistance); addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
addNetworkEventHandler("vrr.ping", updatePlayerPing); addNetworkEventHandler("agrp.ping", updatePlayerPing);
addNetworkEventHandler("vrr.anim", makePedPlayAnimation); addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
addNetworkEventHandler("vrr.stopAnim", makePedStopAnimation); addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
addNetworkEventHandler("vrr.forceAnim", forcePedAnimation); addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior);
addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties); addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties);
addNetworkEventHandler("vrr.elementPosition", setElementPosition); addNetworkEventHandler("agrp.elementPosition", setElementPosition);
addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled); addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState); addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
addNetworkEventHandler("vrr.holdObject", makePedHoldObject); addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
} }
// =========================================================================== // ===========================================================================
function sendResourceReadySignalToServer() { function sendResourceReadySignalToServer() {
sendNetworkEventToServer("vrr.clientReady"); sendNetworkEventToServer("agrp.clientReady");
} }
// =========================================================================== // ===========================================================================
function sendResourceStartedSignalToServer() { function sendResourceStartedSignalToServer() {
sendNetworkEventToServer("vrr.clientStarted"); sendNetworkEventToServer("agrp.clientStarted");
} }
// =========================================================================== // ===========================================================================
function sendResourceStoppedSignalToServer() { function sendResourceStoppedSignalToServer() {
if (isConnected) { if (isConnected) {
sendNetworkEventToServer("vrr.clientStopped"); sendNetworkEventToServer("agrp.clientStopped");
} }
} }
@@ -227,19 +227,19 @@ function onServerSpawnedLocalPlayer(state) {
// =========================================================================== // ===========================================================================
function tellServerPlayerUsedKeyBind(key) { function tellServerPlayerUsedKeyBind(key) {
sendNetworkEventToServer("vrr.useKeyBind", key); sendNetworkEventToServer("agrp.useKeyBind", key);
} }
// =========================================================================== // ===========================================================================
function tellServerPlayerArrivedAtJobRouteLocation() { function tellServerPlayerArrivedAtJobRouteLocation() {
sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation"); sendNetworkEventToServer("agrp.arrivedAtJobRouteLocation");
} }
// =========================================================================== // ===========================================================================
function tellServerItemActionDelayComplete() { function tellServerItemActionDelayComplete() {
sendNetworkEventToServer("vrr.itemActionDelayComplete"); sendNetworkEventToServer("agrp.itemActionDelayComplete");
} }
// =========================================================================== // ===========================================================================
@@ -249,13 +249,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("vrr.clientInfo", clientVersion, game.width, game.height); sendNetworkEventToServer("agrp.clientInfo", clientVersion, game.width, game.height);
} }
// =========================================================================== // ===========================================================================
function sendServerNewAFKStatus(state) { function sendServerNewAFKStatus(state) {
sendNetworkEventToServer("vrr.afk", state); sendNetworkEventToServer("agrp.afk", state);
} }
// =========================================================================== // ===========================================================================
@@ -354,7 +354,7 @@ function makePedHoldObject(pedId, modelIndex) {
// =========================================================================== // ===========================================================================
function sendLocalPlayerNetworkIdToServer() { function sendLocalPlayerNetworkIdToServer() {
sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer)); sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
} }
// =========================================================================== // ===========================================================================
@@ -413,7 +413,7 @@ function serverRequestedLocalPlayerSpawn(skinId, position) {
// =========================================================================== // ===========================================================================
function sendLocaleSelectToServer(localeId) { function sendLocaleSelectToServer(localeId) {
sendNetworkEventToServer("vrr.localeSelect", localeId); sendNetworkEventToServer("agrp.localeSelect", localeId);
} }
// =========================================================================== // ===========================================================================

View File

@@ -9,10 +9,10 @@
function processNPCMovement(npc) { function processNPCMovement(npc) {
//if(npc.isSyncer == true) { //if(npc.isSyncer == true) {
if(getEntityData(npc, "vrr.lookAtClosestPlayer") == true) { if (getEntityData(npc, "agrp.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

@@ -25,8 +25,8 @@ function initClientScripts() {
// =========================================================================== // ===========================================================================
function setUpInitialGame() { function setUpInitialGame() {
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == AGRP_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
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
@@ -44,8 +44,8 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js) // Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true); SetStandardControlsEnabled(true);
} else if(getGame() == VRR_GAME_GTA_VC) { } else if (getGame() == AGRP_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
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0); game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
@@ -87,8 +87,8 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js) // Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true); SetStandardControlsEnabled(true);
} else if(getGame() == VRR_GAME_GTA_SA) { } else if (getGame() == AGRP_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);
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400); game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
@@ -124,7 +124,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() == VRR_GAME_GTA_IV) { } else if (getGame() == AGRP_GAME_GTA_IV) {
natives.allowEmergencyServices(false); natives.allowEmergencyServices(false);
natives.setCreateRandomCops(true); natives.setCreateRandomCops(true);
natives.setMaxWantedLevel(0); natives.setMaxWantedLevel(0);
@@ -186,7 +186,7 @@ function setUpInitialGame() {
// Some last steps // Some last steps
//natives.loadAllObjectsNow(); //natives.loadAllObjectsNow();
} else if(getGame() == VRR_GAME_MAFIA_ONE) { } else if (getGame() == AGRP_GAME_MAFIA_ONE) {
game.mapEnabled = false; game.mapEnabled = false;
game.setTrafficEnabled(false); game.setTrafficEnabled(false);
} }

View File

@@ -8,37 +8,37 @@
// =========================================================================== // ===========================================================================
function processSync(event, deltaTime) { function processSync(event, deltaTime) {
if(localPlayer != null) { if (localPlayer != null) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
sendNetworkEventToServer("vrr.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position); sendNetworkEventToServer("agrp.plr.pos", (localPlayer.vehicle != null) ? localPlayer.vehicle.position : localPlayer.position);
sendNetworkEventToServer("vrr.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading); sendNetworkEventToServer("agrp.plr.rot", (localPlayer.vehicle != null) ? localPlayer.vehicle.heading : localPlayer.heading);
//if(localPlayer.vehicle != null) { //if(localPlayer.vehicle != null) {
// sendNetworkEventToServer("vrr.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position); // sendNetworkEventToServer("agrp.veh.pos", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.position);
// sendNetworkEventToServer("vrr.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading); // sendNetworkEventToServer("agrp.veh.rot", getVehicleForNetworkEvent(localPlayer.vehicle), localPlayer.vehicle.heading);
//} //}
} }
if(localPlayer.health <= 0) { if (localPlayer.health <= 0) {
if(!calledDeathEvent) { if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`); logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons(); localPlayer.clearWeapons();
calledDeathEvent = true; calledDeathEvent = true;
sendNetworkEventToServer("vrr.playerDeath"); sendNetworkEventToServer("agrp.playerDeath");
} }
} }
} }
if(localPlayer.health <= 0) { if (localPlayer.health <= 0) {
if(!calledDeathEvent) { if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`); logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons(); localPlayer.clearWeapons();
calledDeathEvent = true; calledDeathEvent = true;
sendNetworkEventToServer("vrr.playerDeath"); sendNetworkEventToServer("agrp.playerDeath");
} }
} }
if(streamingRadioElement) { if (streamingRadioElement) {
streamingRadio.position = getElementPosition(streamingRadioElement.id); streamingRadio.position = getElementPosition(streamingRadioElement.id);
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position); //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);
} }
@@ -53,20 +53,20 @@ function setVehicleEngine(vehicleId, state) {
// =========================================================================== // ===========================================================================
function setVehicleLights(vehicleId, state) { function setVehicleLights(vehicleId, state) {
if(getGame() != VRR_GAME_MAFIA_ONE) { if (getGame() != VRR_GAME_MAFIA_ONE) {
if(!state) { if (!state) {
getElementFromId(vehicleId).lightStatus = 2; getElementFromId(vehicleId).lightStatus = 2;
} else { } else {
getElementFromId(vehicleId).lightStatus = 1; getElementFromId(vehicleId).lightStatus = 1;
} }
} else if(getGame() == VRR_GAME_GTA_IV) { } else if (getGame() == VRR_GAME_GTA_IV) {
if(!state) { if (!state) {
natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0)); natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 0));
} else { } else {
natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1)); natives.forceCarLights(natives.getVehicleFromNetworkId(vehicleId, 1));
} }
} else { } else {
if(!state) { if (!state) {
getElementFromId(vehicleId).lights = false; getElementFromId(vehicleId).lights = false;
} else { } else {
getElementFromId(vehicleId).lights = true; getElementFromId(vehicleId).lights = true;
@@ -83,72 +83,72 @@ function repairVehicle(syncId) {
// =========================================================================== // ===========================================================================
function syncVehicleProperties(vehicle) { function syncVehicleProperties(vehicle) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return false; return false;
} }
if(doesEntityDataExist(vehicle, "vrr.lights")) { if (doesEntityDataExist(vehicle, "agrp.lights")) {
let lightStatus = getEntityData(vehicle, "vrr.lights"); let lightStatus = getEntityData(vehicle, "agrp.lights");
if(!lightStatus) { if (!lightStatus) {
vehicle.lightStatus = 2; vehicle.lightStatus = 2;
} else { } else {
vehicle.lightStatus = 1; vehicle.lightStatus = 1;
} }
} }
if(doesEntityDataExist(vehicle, "vrr.invincible")) { if (doesEntityDataExist(vehicle, "agrp.invincible")) {
let invincible = getEntityData(vehicle, "vrr.invincible"); let invincible = getEntityData(vehicle, "agrp.invincible");
element.setProofs(invincible, invincible, invincible, invincible, invincible); element.setProofs(invincible, invincible, invincible, invincible, invincible);
} }
if(doesEntityDataExist(vehicle, "vrr.panelStatus")) { if (doesEntityDataExist(vehicle, "agrp.panelStatus")) {
let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); let panelsStatus = getEntityData(vehicle, "agrp.panelStatus");
for(let i in panelsStatus) { for (let i in panelsStatus) {
vehicle.setPanelStatus(i, panelsStatus[i]); vehicle.setPanelStatus(i, panelsStatus[i]);
} }
} }
if(doesEntityDataExist(vehicle, "vrr.wheelStatus")) { if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) {
let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus");
for(let i in wheelsStatus) { for (let i in wheelsStatus) {
vehicle.setWheelStatus(i, wheelsStatus[i]); vehicle.setWheelStatus(i, wheelsStatus[i]);
} }
} }
if(doesEntityDataExist(vehicle, "vrr.lightStatus")) { if (doesEntityDataExist(vehicle, "agrp.lightStatus")) {
let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); let lightStatus = getEntityData(vehicle, "agrp.lightStatus");
for(let i in lightStatus) { for (let i in lightStatus) {
vehicle.setLightStatus(i, lightStatus[i]); vehicle.setLightStatus(i, lightStatus[i]);
} }
} }
if(doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) {
let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight");
vehicle.setSuspensionHeight(suspensionHeight); vehicle.setSuspensionHeight(suspensionHeight);
} }
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_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, "vrr.upgrades")) { if (doesEntityDataExist(vehicle, "agrp.upgrades")) {
let upgrades = getEntityData(vehicle, "vrr.upgrades"); let upgrades = getEntityData(vehicle, "agrp.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]);
} }
} }
} }
} }
if(getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
if(doesEntityDataExist(vehicle, "vrr.livery")) { if (doesEntityDataExist(vehicle, "agrp.livery")) {
let livery = getEntityData(vehicle, "vrr.livery"); let livery = getEntityData(vehicle, "agrp.livery");
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
vehicle.setPaintJob(livery); vehicle.setPaintJob(livery);
} else if(getGame() == VRR_GAME_GTA_IV) { } else if (getGame() == VRR_GAME_GTA_IV) {
vehicle.livery = livery; vehicle.livery = livery;
} }
} }
@@ -158,13 +158,13 @@ function syncVehicleProperties(vehicle) {
// =========================================================================== // ===========================================================================
function syncCivilianProperties(civilian) { function syncCivilianProperties(civilian) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return false; return false;
} }
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if(doesEntityDataExist(civilian, "vrr.scale")) { if (doesEntityDataExist(civilian, "agrp.scale")) {
let scaleFactor = getEntityData(civilian, "vrr.scale"); let scaleFactor = getEntityData(civilian, "agrp.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;
@@ -174,79 +174,79 @@ function syncCivilianProperties(civilian) {
} }
} }
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
if(doesEntityDataExist(civilian, "vrr.fightStyle")) { if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
let fightStyle = getEntityData(civilian, "vrr.fightStyle"); let fightStyle = getEntityData(civilian, "agrp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]); civilian.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if(doesEntityDataExist(civilian, "vrr.walkStyle")) { if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
let walkStyle = getEntityData(civilian, "vrr.walkStyle"); let walkStyle = getEntityData(civilian, "agrp.walkStyle");
civilian.walkStyle = walkStyle; civilian.walkStyle = walkStyle;
} }
} }
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if(doesEntityDataExist(civilian, "vrr.bodyPropHair")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair"); let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropHead")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) {
let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead"); let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead");
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropEyes")) { if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes"); let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes");
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand");
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand"); let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand");
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist");
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropHip")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) {
let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip"); let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip");
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot");
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if(doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot");
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
if(doesEntityDataExist(civilian, "vrr.anim")) { if (doesEntityDataExist(civilian, "agrp.anim")) {
let animationSlot = getEntityData(civilian, "vrr.anim"); let animationSlot = getEntityData(civilian, "agrp.anim");
let animationData = getAnimationData(animationSlot); let animationData = getAnimationData(animationSlot);
civilian.addAnimation(animationData.groupId, animationData.animId); civilian.addAnimation(animationData.groupId, animationData.animId);
} }
@@ -255,13 +255,13 @@ function syncCivilianProperties(civilian) {
// =========================================================================== // ===========================================================================
function syncPlayerProperties(player) { function syncPlayerProperties(player) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return false; return false;
} }
if(getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if(doesEntityDataExist(player, "vrr.scale")) { if (doesEntityDataExist(player, "agrp.scale")) {
let scaleFactor = getEntityData(player, "vrr.scale"); let scaleFactor = getEntityData(player, "agrp.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;
@@ -271,95 +271,95 @@ function syncPlayerProperties(player) {
} }
} }
if(getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
if(doesEntityDataExist(player, "vrr.fightStyle")) { if (doesEntityDataExist(player, "agrp.fightStyle")) {
let fightStyle = getEntityData(player, "vrr.fightStyle"); let fightStyle = getEntityData(player, "agrp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]); player.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
//if(getGame() == VRR_GAME_GTA_SA) { //if(getGame() == VRR_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "vrr.walkStyle")) { // if(doesEntityDataExist(player, "agrp.walkStyle")) {
// let walkStyle = getEntityData(player, "vrr.walkStyle"); // let walkStyle = getEntityData(player, "agrp.walkStyle");
// player.walkStyle = walkStyle; // player.walkStyle = walkStyle;
// } // }
//} //}
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if(doesEntityDataExist(player, "vrr.bodyPartHair")) { if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "vrr.bodyPartHair"); let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPartHead")) { if (doesEntityDataExist(player, "agrp.bodyPartHead")) {
let bodyPartHead = getEntityData(player, "vrr.bodyPartHead"); let bodyPartHead = getEntityData(player, "agrp.bodyPartHead");
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPartUpper")) { if (doesEntityDataExist(player, "agrp.bodyPartUpper")) {
let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper"); let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper");
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPartLower")) { if (doesEntityDataExist(player, "agrp.bodyPartLower")) {
let bodyPartLower = getEntityData(player, "vrr.bodyPartLower"); let bodyPartLower = getEntityData(player, "agrp.bodyPartLower");
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
} }
} }
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if(doesEntityDataExist(player, "vrr.bodyPropHair")) { if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "vrr.bodyPropHair"); let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropHead")) { if (doesEntityDataExist(player, "agrp.bodyPropHead")) {
let bodyPropHead = getEntityData(player, "vrr.bodyPropHead"); let bodyPropHead = getEntityData(player, "agrp.bodyPropHead");
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropEyes")) { if (doesEntityDataExist(player, "agrp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes"); let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes");
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropLeftHand")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand");
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropRightHand")) { if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand"); let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand");
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist");
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropHip")) { if (doesEntityDataExist(player, "agrp.bodyPropHip")) {
let bodyPropHip = getEntityData(player, "vrr.bodyPropHip"); let bodyPropHip = getEntityData(player, "agrp.bodyPropHip");
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot");
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if(doesEntityDataExist(player, "vrr.bodyPropRightFoot")) { if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot");
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
@@ -368,18 +368,18 @@ function syncPlayerProperties(player) {
// =========================================================================== // ===========================================================================
function syncElementProperties(element) { function syncElementProperties(element) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return false; return false;
} }
if(doesEntityDataExist(element, "vrr.interior")) { if (doesEntityDataExist(element, "agrp.interior")) {
if(typeof element.interior != "undefined") { if (typeof element.interior != "undefined") {
element.interior = getEntityData(element, "vrr.interior"); element.interior = getEntityData(element, "agrp.interior");
} }
} }
if(getGame() == VRR_GAME_MAFIA_ONE) { if (getGame() == VRR_GAME_MAFIA_ONE) {
switch(element.type) { switch (element.type) {
case ELEMENT_VEHICLE: case ELEMENT_VEHICLE:
syncVehicleProperties(element); syncVehicleProperties(element);
break; break;
@@ -396,7 +396,7 @@ function syncElementProperties(element) {
break; break;
} }
} else { } else {
switch(element.type) { switch (element.type) {
case ELEMENT_VEHICLE: case ELEMENT_VEHICLE:
syncVehicleProperties(element); syncVehicleProperties(element);
break; break;
@@ -419,7 +419,7 @@ function syncElementProperties(element) {
// =========================================================================== // ===========================================================================
function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) { function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
} }
} }
@@ -427,11 +427,11 @@ function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupMode
// =========================================================================== // ===========================================================================
function setLocalPlayerPedPartsAndProps(parts, props) { function setLocalPlayerPedPartsAndProps(parts, props) {
for(let i in parts) { for (let i in parts) {
localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]); localPlayer.changeBodyPart(parts[i][0], parts[i][1], parts[i][2]);
} }
for(let j in props) { for (let j in props) {
localPlayer.changeBodyProp(props[j][0], props[j][1]); localPlayer.changeBodyProp(props[j][0], props[j][1]);
} }
} }

View File

@@ -95,7 +95,7 @@ function runClientCode(code, returnTo) {
try { try {
returnValue = eval("(" + code + ")"); returnValue = eval("(" + code + ")");
} catch (error) { } catch (error) {
sendNetworkEventToServer("vrr.runCodeFail", returnTo, error.toString()); sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString());
return false; return false;
} }
let returnValueString = returnValue; let returnValueString = returnValue;
@@ -104,7 +104,7 @@ function runClientCode(code, returnTo) {
} else { } else {
returnValueString = "null/undefined"; returnValueString = "null/undefined";
} }
sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, returnValueString); sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString);
} }
// =========================================================================== // ===========================================================================
@@ -212,8 +212,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], "vrr.interior")) { if (getEntityData(vehicles[i], "agrp.interior")) {
vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior"); vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior");
} }
} }
} }
@@ -407,8 +407,8 @@ function processWantedLevelReset() {
function processLocalPlayerVehicleControlState() { function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
if (inVehicle && localPlayer.vehicle != null) { if (inVehicle && localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "vrr.engine")) { if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
if (getEntityData(localPlayer.vehicle, "vrr.engine") == false) { if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) {
localPlayer.vehicle.engine = false; localPlayer.vehicle.engine = false;
if (!localPlayer.vehicle.engine) { if (!localPlayer.vehicle.engine) {
if (typeof localPlayer.vehicle.velocity != "undefined") { if (typeof localPlayer.vehicle.velocity != "undefined") {
@@ -591,7 +591,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("vrr.pickup", pickups[i].id); sendNetworkEventToServer("agrp.pickup", pickups[i].id);
} }
//} //}
} }

View File

@@ -32,11 +32,11 @@ 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, `[VRR.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`); logToConsole(LOG_DEBUG, `[VRR.Vehicle] Received vehicle ${vehicleId} (${getVehicleNameFromModel(model, getGame())}) from server`);
if(getGame() != VRR_GAME_GTA_IV) { if (getGame() != VRR_GAME_GTA_IV) {
return false; return false;
} }
if(getVehicleData(vehicleId) != false) { if (getVehicleData(vehicleId) != false) {
let vehicleData = getVehicleData(vehicleId); let vehicleData = getVehicleData(vehicleId);
//vehicleData.position = position; //vehicleData.position = position;
//vehicleData.heading = heading; //vehicleData.heading = heading;
@@ -63,20 +63,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
// =========================================================================== // ===========================================================================
function processVehiclePurchasing() { function processVehiclePurchasing() {
if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) { if (vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
if(getLocalPlayerVehicle() == false) { if (getLocalPlayerVehicle() == false) {
vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH; vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH); sendNetworkEventToServer("agrp.vehBuyState", VRR_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 = VRR_VEHBUYSTATE_FARENOUGH; vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH); sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
} }
} else { } else {
vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH; vehiclePurchaseState = VRR_VEHBUYSTATE_WRONGVEH;
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH); sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_WRONGVEH);
} }
} }
} }
@@ -95,7 +95,7 @@ function processVehicleBurning() {
function setVehiclePurchaseState(state, vehicleId, position) { function setVehiclePurchaseState(state, vehicleId, position) {
vehiclePurchaseState = state; vehiclePurchaseState = state;
if(vehicleId != null) { if (vehicleId != null) {
vehiclePurchasing = getElementFromId(vehicleId); vehiclePurchasing = getElementFromId(vehicleId);
} else { } else {
vehiclePurchasing = null; vehiclePurchasing = null;
@@ -110,9 +110,9 @@ function setVehiclePurchaseState(state, vehicleId, position) {
* @param {number} vehicleId - The ID of the job (initially provided by server) * @param {number} vehicleId - The ID of the job (initially provided by server)
* @return {VehicleData} The vehicle's data (class instance) * @return {VehicleData} The vehicle's data (class instance)
*/ */
function getVehicleData(vehicleId) { function getVehicleData(vehicleId) {
for(let i in getServerData().vehicles) { for (let i in getServerData().vehicles) {
if(getServerData().vehicles[i].vehicleId == vehicleId) { if (getServerData().vehicles[i].vehicleId == vehicleId) {
return getServerData().vehicles[i]; return getServerData().vehicles[i];
} }
} }
@@ -123,7 +123,7 @@ function setVehiclePurchaseState(state, vehicleId, position) {
// =========================================================================== // ===========================================================================
function setAllVehicleDataIndexes() { function setAllVehicleDataIndexes() {
for(let i in getServerData().vehicles) { for (let i in getServerData().vehicles) {
getServerData().vehicles[i].index = i; getServerData().vehicles[i].index = i;
} }
} }

View File

@@ -15,10 +15,10 @@ function initAntiCheatScript() {
// =========================================================================== // ===========================================================================
function clearPlayerStateToEnterExitProperty(client) { function clearPlayerStateToEnterExitProperty(client) {
if(getPlayerData(client).pedState != VRR_PEDSTATE_READY) { if (getPlayerData(client).pedState != AGRP_PEDSTATE_READY) {
if(getPlayerData(client).pedState == VRR_PEDSTATE_ENTERINGVEHICLE) { if (getPlayerData(client).pedState == AGRP_PEDSTATE_ENTERINGVEHICLE) {
sendPlayerClearPedState(client); sendPlayerClearPedState(client);
getPlayerData(client).pedState = VRR_PEDSTATE_READY; getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
} else { } else {
return false; return false;
} }
@@ -28,7 +28,7 @@ function clearPlayerStateToEnterExitProperty(client) {
// =========================================================================== // ===========================================================================
function isPlayerExemptFromAntiCheat(client) { function isPlayerExemptFromAntiCheat(client) {
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) { if (hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
return true; return true;
} }
@@ -38,7 +38,7 @@ function isPlayerExemptFromAntiCheat(client) {
// =========================================================================== // ===========================================================================
function canPlayerUsePoliceJob(client) { function canPlayerUsePoliceJob(client) {
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.policeBanned) { if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.policeBanned) {
return false; return false;
} }
@@ -48,7 +48,7 @@ function canPlayerUsePoliceJob(client) {
// =========================================================================== // ===========================================================================
function canClientUseFireJob(client) { function canClientUseFireJob(client) {
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.fireBanned) { if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.fireBanned) {
return false; return false;
} }
@@ -58,7 +58,7 @@ function canClientUseFireJob(client) {
// =========================================================================== // ===========================================================================
function canClientUseAmmunations(client) { function canClientUseAmmunations(client) {
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.AmmuBanned) { if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.AmmuBanned) {
return false; return false;
} }
@@ -68,7 +68,7 @@ function canClientUseAmmunations(client) {
// =========================================================================== // ===========================================================================
function canClientUseGuns(client) { function canClientUseGuns(client) {
if(getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.GunBanned) { if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.GunBanned) {
return false; return false;
} }

View File

@@ -8,18 +8,18 @@
// =========================================================================== // ===========================================================================
// Ban Types // Ban Types
const VRR_BANTYPE_NONE = 0; const AGRP_BANTYPE_NONE = 0;
const VRR_BANTYPE_ACCOUNT = 1; const AGRP_BANTYPE_ACCOUNT = 1;
const VRR_BANTYPE_SUBACCOUNT = 2; const AGRP_BANTYPE_SUBACCOUNT = 2;
const VRR_BANTYPE_IPADDRESS = 3; const AGRP_BANTYPE_IPADDRESS = 3;
const VRR_BANTYPE_SUBNET = 4; const AGRP_BANTYPE_SUBNET = 4;
// =========================================================================== // ===========================================================================
class BanData { class BanData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0; this.databaseId = 0;
this.type = VRR_BANTYPE_NONE; this.type = AGRP_BANTYPE_NONE;
this.detail = ""; this.detail = "";
this.ipAddress = ""; this.ipAddress = "";
this.name = ""; this.name = "";
@@ -174,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 (${VRR_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_ACCOUNT}, ${accountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -189,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 (${VRR_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`); let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${AGRP_BANTYPE_SUBACCOUNT}, ${subAccountId}, ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -204,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 (${VRR_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 (${AGRP_BANTYPE_IPADDRESS}, INET_ATON(${ipAddress}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -219,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 (${VRR_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 (${AGRP_BANTYPE_SUBNET}, INET_ATON(${ipAddressStart}), INET_ATON(${ipAddressEnd}), ${adminAccountId}, '${safeReason}');`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -233,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=${VRR_BANTYPE_ACCOUNT} AND ban_detail=${accountId}`); 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}`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -247,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=${VRR_BANTYPE_SUBACCOUNT} AND ban_detail=${subAccountId}`); 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}`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -261,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=${VRR_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=${AGRP_BANTYPE_IPADDRESS} AND ban_detail=INET_ATON(${ipAddress})`);
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
dbConnection.close(); dbConnection.close();
return true; return true;
@@ -275,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=${VRR_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=${AGRP_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;
@@ -287,7 +287,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
// =========================================================================== // ===========================================================================
function isAccountBanned(accountId) { function isAccountBanned(accountId) {
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_ACCOUNT && ban.detail === accountId); let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_ACCOUNT && ban.detail === accountId);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }
@@ -298,7 +298,7 @@ function isAccountBanned(accountId) {
// =========================================================================== // ===========================================================================
function isSubAccountBanned(subAccountId) { function isSubAccountBanned(subAccountId) {
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_SUBACCOUNT && ban.detail === subAccountId); let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_SUBACCOUNT && ban.detail === subAccountId);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }
@@ -309,7 +309,7 @@ function isSubAccountBanned(subAccountId) {
// =========================================================================== // ===========================================================================
function isIpAddressBanned(ipAddress) { function isIpAddressBanned(ipAddress) {
let bans = getServerData().bans.filter(ban => ban.type === VRR_BANTYPE_IPADDRESS && ban.detail === ipAddress); let bans = getServerData().bans.filter(ban => ban.type === AGRP_BANTYPE_IPADDRESS && ban.detail === ipAddress);
if (bans.length > 0) { if (bans.length > 0) {
return true; return true;
} }

View File

@@ -14,7 +14,7 @@ function isPlayerAtBank(client) {
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
if (getBusinessData(client) != false) { if (getBusinessData(client) != false) {
if (getBusinessData(businessId).entranceType == VRR_BIZ_ENTRANCE_TYPE_BANK) { if (getBusinessData(businessId).entranceType == AGRP_BIZ_ENTRANCE_TYPE_BANK) {
return true; return true;
} }
} }

View File

@@ -452,7 +452,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, "vrr.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.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}`); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} renamed business {businessBlue}${oldBusinessName}{MAINCOLOUR} to {businessBlue}${newBusinessName}`);
} }
@@ -1442,7 +1442,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
} }
getBusinessData(businessId).buyPrice = amount; getBusinessData(businessId).buyPrice = amount;
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.price", getBusinessData(businessId).buyPrice, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.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}$${makeLargeNumberReadable(amount)}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s {MAINCOLOUR}for-sale price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`);
@@ -2860,50 +2860,50 @@ function updateBusinessPickupLabelData(businessId) {
} }
if (getBusinessData(businessId).exitPickup != null) { if (getBusinessData(businessId).exitPickup != null) {
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_EXIT, false); setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.id", businessId, false); setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true); setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
} }
if (getBusinessData(businessId).entrancePickup != null) { if (getBusinessData(businessId).entrancePickup != null) {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.owner.id", businessId, false); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.type", VRR_LABEL_BUSINESS, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", VRR_LABEL_BUSINESS, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.name", getBusinessData(businessId).name, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.locked", getBusinessData(businessId).locked, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.locked", getBusinessData(businessId).locked, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_NONE, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_NONE, true);
switch (getBusinessData(businessId).labelHelpType) { switch (getBusinessData(businessId).labelHelpType) {
case VRR_PROPLABEL_INFO_ENTERVEHICLE: { case VRR_PROPLABEL_INFO_ENTERVEHICLE: {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_ENTERVEHICLE, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTERVEHICLE, true);
break; break;
} }
case VRR_PROPLABEL_INFO_ENTER: { case VRR_PROPLABEL_INFO_ENTER: {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_ENTER, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true);
break; break;
} }
case VRR_PROPLABEL_INFO_REPAIR: { case VRR_PROPLABEL_INFO_REPAIR: {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_REPAIR, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_REPAIR, true);
break; break;
} }
default: { default: {
if (getBusinessData(businessId).hasInterior) { if (getBusinessData(businessId).hasInterior) {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_ENTER, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_ENTER, true);
} else { } else {
if (doesBusinessHaveAnyItemsToBuy(businessId)) { if (doesBusinessHaveAnyItemsToBuy(businessId)) {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUY, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUY, true);
} else { } else {
removeEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help"); removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help");
} }
} }
break; break;
} }
} }
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.price", getBusinessData(businessId).buyPrice, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
} }
} }

View File

@@ -363,7 +363,7 @@ function clanChat(client, messageText) {
// =========================================================================== // ===========================================================================
function canPlayerUseMegaphone(client) { function canPlayerUseMegaphone(client) {
if (getPlayerFirstItemSlotByUseType(client, VRR_ITEM_USE_TYPE_MEGAPHONE) != -1) { if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (isPlayerActiveItemEnabled(client)) { if (isPlayerActiveItemEnabled(client)) {
return true; return true;
} }

View File

@@ -8,9 +8,9 @@
// =========================================================================== // ===========================================================================
// Return-To types (for when a player is teleported) // Return-To types (for when a player is teleported)
const VRR_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid const AGRP_RETURNTO_TYPE_NONE = 0; // "Return to" data is invalid
const VRR_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting const AGRP_RETURNTO_TYPE_ADMINGET = 1; // "Return to" data is from admin teleporting
const VRR_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select const AGRP_RETURNTO_TYPE_SKINSELECT = 2; // "Return to" data is from skin select
// =========================================================================== // ===========================================================================
@@ -38,9 +38,9 @@ class ClientData {
this.sessionId = 0; this.sessionId = 0;
// Security // Security
this.passwordResetState = VRR_RESETPASS_STATE_NONE; this.passwordResetState = AGRP_RESETPASS_STATE_NONE;
this.passwordResetCode = ""; this.passwordResetCode = "";
this.twoFactorAuthenticationState = VRR_2FA_STATE_NONE; this.twoFactorAuthenticationState = AGRP_2FA_STATE_NONE;
this.twoFactorAuthenticationCode = 0; this.twoFactorAuthenticationCode = 0;
// Job Stuff // Job Stuff
@@ -64,11 +64,11 @@ class ClientData {
// Items // Items
this.tempLockerCache = new Array(9).fill(-1); this.tempLockerCache = new Array(9).fill(-1);
this.tempLockerType = VRR_TEMP_LOCKER_TYPE_NONE; this.tempLockerType = AGRP_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 = VRR_ITEM_ACTION_NONE; this.itemActionState = AGRP_ITEM_ACTION_NONE;
this.itemActionItem = -1; this.itemActionItem = -1;
this.paintBallItemCache = []; this.paintBallItemCache = [];
@@ -103,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 = VRR_RETURNTO_TYPE_NONE; this.returnToType = AGRP_RETURNTO_TYPE_NONE;
// Animation // Animation
this.currentAnimation = -1; this.currentAnimation = -1;
@@ -118,7 +118,7 @@ class ClientData {
this.usingSkinSelect = false; this.usingSkinSelect = false;
this.keyBinds = []; this.keyBinds = [];
this.incomingDamageMultiplier = 1; this.incomingDamageMultiplier = 1;
this.weaponDamageEvent = VRR_WEAPON_DAMAGE_EVENT_NORMAL; this.weaponDamageEvent = AGRP_WEAPON_DAMAGE_EVENT_NORMAL;
this.lastJobVehicle = null; this.lastJobVehicle = null;
this.health = 100; this.health = 100;
this.locale = 0; this.locale = 0;
@@ -127,8 +127,8 @@ class ClientData {
this.interiorCutscene = -1; this.interiorCutscene = -1;
this.playerBlip = null; this.playerBlip = null;
this.alcoholLevel = 0; this.alcoholLevel = 0;
this.pedState = VRR_PEDSTATE_NONE; this.pedState = AGRP_PEDSTATE_NONE;
this.promptType = VRR_PROMPT_NONE; this.promptType = AGRP_PROMPT_NONE;
this.privateMessageReplyTo = null; this.privateMessageReplyTo = null;
this.inPaintBall = false; this.inPaintBall = false;

View File

@@ -193,18 +193,18 @@ let globalConfig = {
geoIPCityDatabaseFilePath: "geoip-city.mmdb", geoIPCityDatabaseFilePath: "geoip-city.mmdb",
randomTipInterval: 600000, randomTipInterval: 600000,
weaponEquippableTypes: [ weaponEquippableTypes: [
VRR_ITEM_USE_TYPE_WEAPON, AGRP_ITEM_USE_TYPE_WEAPON,
VRR_ITEM_USE_TYPE_TAZER, AGRP_ITEM_USE_TYPE_TAZER,
VRR_ITEM_USE_TYPE_EXTINGUISHER, AGRP_ITEM_USE_TYPE_EXTINGUISHER,
VRR_ITEM_USE_TYPE_SPRAYPAINT, AGRP_ITEM_USE_TYPE_SPRAYPAINT,
VRR_ITEM_USE_TYPE_PEPPERSPRAY, AGRP_ITEM_USE_TYPE_PEPPERSPRAY,
], ],
onFootOnlyItems: [ onFootOnlyItems: [
VRR_ITEM_USE_TYPE_VEHREPAIR, AGRP_ITEM_USE_TYPE_VEHREPAIR,
VRR_ITEM_USE_TYPE_VEHCOLOUR, AGRP_ITEM_USE_TYPE_VEHCOLOUR,
VRR_ITEM_USE_TYPE_VEHUPGRADE_PART, AGRP_ITEM_USE_TYPE_VEHUPGRADE_PART,
VRR_ITEM_USE_TYPE_VEHLIVERY, AGRP_ITEM_USE_TYPE_VEHLIVERY,
VRR_ITEM_USE_TYPE_VEHTIRE, AGRP_ITEM_USE_TYPE_VEHTIRE,
], ],
vehicleInactiveRespawnDelay: 1800000, // 20 minutes vehicleInactiveRespawnDelay: 1800000, // 20 minutes
chatSectionHeaderLength: 96, chatSectionHeaderLength: 96,

View File

@@ -8,9 +8,9 @@
// =========================================================================== // ===========================================================================
// Discord Webhook Types // Discord Webhook Types
const VRR_DISCORD_WEBHOOK_NONE = 0; const AGRP_DISCORD_WEBHOOK_NONE = 0;
const VRR_DISCORD_WEBHOOK_LOG = 1; const AGRP_DISCORD_WEBHOOK_LOG = 1;
const VRR_DISCORD_WEBHOOK_ADMIN = 2; const AGRP_DISCORD_WEBHOOK_ADMIN = 2;
// =========================================================================== // ===========================================================================
@@ -109,7 +109,7 @@ function messageDiscordChatChannel(messageString) {
} }
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_LOG); triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
} }
// =========================================================================== // ===========================================================================
@@ -128,7 +128,7 @@ function messageDiscordEventChannel(messageString) {
} }
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_LOG); triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
} }
// =========================================================================== // ===========================================================================
@@ -147,12 +147,12 @@ function messageDiscordAdminChannel(messageString) {
} }
messageString = removeColoursInMessage(messageString); messageString = removeColoursInMessage(messageString);
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_ADMIN); triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_ADMIN);
} }
// =========================================================================== // ===========================================================================
function triggerDiscordWebHook(messageString, serverId = getServerId(), type = VRR_DISCORD_WEBHOOK_LOG) { function triggerDiscordWebHook(messageString, serverId = getServerId(), type = AGRP_DISCORD_WEBHOOK_LOG) {
if (!getGlobalConfig().discord.webhook.enabled) { if (!getGlobalConfig().discord.webhook.enabled) {
return false; return false;
} }

View File

@@ -187,19 +187,19 @@ function repossessFirstAsset(client) {
// =========================================================================== // ===========================================================================
function getAllVehiclesOwnedByPlayer(client) { function getAllVehiclesOwnedByPlayer(client) {
return getServerData().vehicles.filter((v) => v.ownerType == VRR_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().vehicles.filter((v) => v.ownerType == AGRP_VEHOWNER_PLAYER && v.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================
function getAllBusinessesOwnedByPlayer(client) { function getAllBusinessesOwnedByPlayer(client) {
return getServerData().businesses.filter((b) => b.ownerType == VRR_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().businesses.filter((b) => b.ownerType == AGRP_BIZ_OWNER_PLAYER && b.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================
function getAllHousesOwnedByPlayer(client) { function getAllHousesOwnedByPlayer(client) {
return getServerData().houses.filter((h) => h.ownerType == VRR_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId); return getServerData().houses.filter((h) => h.ownerType == AGRP_HOUSE_OWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
} }
// =========================================================================== // ===========================================================================

View File

@@ -8,37 +8,37 @@
// =========================================================================== // ===========================================================================
// 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 VRR_FISHING_CATCH_TYPE_NONE = 1; const AGRP_FISHING_CATCH_TYPE_NONE = 1;
const VRR_FISHING_CATCH_TYPE_FISH = 1; const AGRP_FISHING_CATCH_TYPE_FISH = 1;
const VRR_FISHING_CATCH_TYPE_JUNK = 2; const AGRP_FISHING_CATCH_TYPE_JUNK = 2;
// =========================================================================== // ===========================================================================
let fishingCollectables = [ let fishingCollectables = [
// Fish // Fish
["Salmon", VRR_FISHING_CATCH_TYPE_FISH], ["Salmon", AGRP_FISHING_CATCH_TYPE_FISH],
["Tuna", VRR_FISHING_CATCH_TYPE_FISH], ["Tuna", AGRP_FISHING_CATCH_TYPE_FISH],
["Crab", VRR_FISHING_CATCH_TYPE_FISH], ["Crab", AGRP_FISHING_CATCH_TYPE_FISH],
["Trout", VRR_FISHING_CATCH_TYPE_FISH], ["Trout", AGRP_FISHING_CATCH_TYPE_FISH],
["Sea Bass", VRR_FISHING_CATCH_TYPE_FISH], ["Sea Bass", AGRP_FISHING_CATCH_TYPE_FISH],
["Shark", VRR_FISHING_CATCH_TYPE_FISH], ["Shark", AGRP_FISHING_CATCH_TYPE_FISH],
["Turtle", VRR_FISHING_CATCH_TYPE_FISH], ["Turtle", AGRP_FISHING_CATCH_TYPE_FISH],
["Manta Ray", VRR_FISHING_CATCH_TYPE_FISH], ["Manta Ray", AGRP_FISHING_CATCH_TYPE_FISH],
["Cat Fish", VRR_FISHING_CATCH_TYPE_FISH], ["Cat Fish", AGRP_FISHING_CATCH_TYPE_FISH],
["Blue Marlin", VRR_FISHING_CATCH_TYPE_FISH], ["Blue Marlin", AGRP_FISHING_CATCH_TYPE_FISH],
// Junk // Junk
["Rusty Can", VRR_FISHING_CATCH_TYPE_JUNK], ["Rusty Can", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Pants", VRR_FISHING_CATCH_TYPE_JUNK], ["Old Pants", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Shoes", VRR_FISHING_CATCH_TYPE_JUNK], ["Old Shoes", AGRP_FISHING_CATCH_TYPE_JUNK],
["Garbage", VRR_FISHING_CATCH_TYPE_JUNK], ["Garbage", AGRP_FISHING_CATCH_TYPE_JUNK],
["Baby Diaper", VRR_FISHING_CATCH_TYPE_JUNK], ["Baby Diaper", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Tire", VRR_FISHING_CATCH_TYPE_JUNK], ["Old Tire", AGRP_FISHING_CATCH_TYPE_JUNK],
["Old Car Battery", VRR_FISHING_CATCH_TYPE_JUNK], ["Old Car Battery", AGRP_FISHING_CATCH_TYPE_JUNK],
["Horse Hoove", VRR_FISHING_CATCH_TYPE_JUNK], ["Horse Hoove", AGRP_FISHING_CATCH_TYPE_JUNK],
["Soggy Log", VRR_FISHING_CATCH_TYPE_JUNK], ["Soggy Log", AGRP_FISHING_CATCH_TYPE_JUNK],
["Soggy Dildo", VRR_FISHING_CATCH_TYPE_JUNK], ["Soggy Dildo", AGRP_FISHING_CATCH_TYPE_JUNK],
["Clump of Seaweed", VRR_FISHING_CATCH_TYPE_JUNK], ["Clump of Seaweed", AGRP_FISHING_CATCH_TYPE_JUNK],
]; ];
// =========================================================================== // ===========================================================================
@@ -56,7 +56,7 @@ function castFishingLineCommand(client) {
return false; return false;
} }
if (doesPlayerHaveItemOfUseTypeEquipped(client, VRR_ITEM_USE_TYPE_FISHINGROD)) { if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "NeedFishingRod")); messagePlayerError(client, getLocaleString(client, "NeedFishingRod"));
return false; return false;
} }
@@ -80,7 +80,7 @@ function resetFishingLineCommand(client) {
return false; return false;
} }
if (doesPlayerHaveItemOfUseTypeEquipped(client, VRR_ITEM_USE_TYPE_FISHINGROD)) { if (doesPlayerHaveItemOfUseTypeEquipped(client, AGRP_ITEM_USE_TYPE_FISHINGROD)) {
messagePlayerError(client, getLocaleString(client, "CantFishHere")); messagePlayerError(client, getLocaleString(client, "CantFishHere"));
return false; return false;
} }

View File

@@ -8,13 +8,13 @@
// =========================================================================== // ===========================================================================
// Forensic Types // Forensic Types
const VRR_FORENSICS_NONE = 0; const AGRP_FORENSICS_NONE = 0;
const VRR_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon. const AGRP_FORENSICS_BULLET = 1; // Bullet. The actual tip that hits a target. Has rifling and ballistics information of the weapon.
const VRR_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot const AGRP_FORENSICS_BLOOD = 2; // Blood. Automatically applied to ground and bullets that hit and outfit worn when somebody is shot
const VRR_FORENSICS_BODY = 3; // Body. A dead body lol const AGRP_FORENSICS_BODY = 3; // Body. A dead body lol
const VRR_FORENSICS_HAIR = 4; // Hair. const AGRP_FORENSICS_HAIR = 4; // Hair.
const VRR_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn const AGRP_FORENSICS_SWEAT = 5; // Sweat. Automatically applied to clothing when worn
const VRR_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten const AGRP_FORENSICS_SALIVA = 6; // Saliva. Automatically applied to drinks when drank and unfinished food items when eaten
const VRR_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby) const AGRP_FORENSICS_BULLETCASINGS = 7; // Bullet casings. Automatically dropped when fired from a weapon except when used in a vehicle (driveby)
// =========================================================================== // ===========================================================================

View File

@@ -8,14 +8,14 @@
// =========================================================================== // ===========================================================================
// Gate Owner Types // Gate Owner Types
const VRR_GATEOWNER_NONE = 0; // Not owned const AGRP_GATEOWNER_NONE = 0; // Not owned
const VRR_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount) const AGRP_GATEOWNER_PLAYER = 1; // Owner is a player (character/subaccount)
const VRR_GATEOWNER_JOB = 2; // Owned by a job const AGRP_GATEOWNER_JOB = 2; // Owned by a job
const VRR_GATEOWNER_CLAN = 3; // Owned by a clan const AGRP_GATEOWNER_CLAN = 3; // Owned by a clan
const VRR_GATEOWNER_FACTION = 4; // Owned by a faction const AGRP_GATEOWNER_FACTION = 4; // Owned by a faction
const VRR_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used. const AGRP_GATEOWNER_PUBLIC = 5; // Public gate. Technically not owned. This probably won't be used.
const VRR_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that const AGRP_GATEOWNER_BUSINESS = 6; // Owned by a business. Back lots, unloading areas, and other stuff like that
const VRR_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas. const AGRP_GATEOWNER_HOUSE = 7; // Owned by a house. Like for mansions with closed private areas.
// =========================================================================== // ===========================================================================
@@ -27,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 = VRR_GATEOWNER_NONE; this.ownerType = AGRP_GATEOWNER_NONE;
this.ownerId = 0; this.ownerId = 0;
if (dbAssoc) { if (dbAssoc) {
@@ -54,17 +54,17 @@ function initGateScript() {
function doesPlayerHaveGateKeys(client, vehicle) { function doesPlayerHaveGateKeys(client, vehicle) {
let gateData = getGateData(vehicle); let gateData = getGateData(vehicle);
if (gateData.ownerType == VRR_GATEOWNER_PUBLIC) { if (gateData.ownerType == AGRP_GATEOWNER_PUBLIC) {
return true; return true;
} }
if (gateData.ownerType == VRR_GATEOWNER_PLAYER) { if (gateData.ownerType == AGRP_GATEOWNER_PLAYER) {
if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) { if (gateData.ownerId == getPlayerCurrentSubAccount(client).databaseId) {
return true; return true;
} }
} }
if (gateData.ownerType == VRR_GATEOWNER_CLAN) { if (gateData.ownerType == AGRP_GATEOWNER_CLAN) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageClans"))) {
return true; return true;
} }
@@ -76,7 +76,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == VRR_GATEOWNER_FACTION) { if (gateData.ownerType == AGRP_GATEOWNER_FACTION) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageFactions"))) {
return true; return true;
} }
@@ -88,7 +88,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == VRR_GATEOWNER_JOB) { if (gateData.ownerType == AGRP_GATEOWNER_JOB) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageJobs"))) {
return true; return true;
} }
@@ -98,7 +98,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == VRR_GATEOWNER_BUSINESS) { if (gateData.ownerType == AGRP_GATEOWNER_BUSINESS) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
return true; return true;
} }
@@ -108,7 +108,7 @@ function doesPlayerHaveGateKeys(client, vehicle) {
} }
} }
if (gateData.ownerType == VRR_GATEOWNER_HOUSE) { if (gateData.ownerType == AGRP_GATEOWNER_HOUSE) {
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) { if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageHouses"))) {
return true; return true;
} }

View File

@@ -8,36 +8,36 @@
// =========================================================================== // ===========================================================================
// GPS State Types // GPS State Types
const VRR_GPS_TYPE_NONE = 0; // None (invalid) const AGRP_GPS_TYPE_NONE = 0; // None (invalid)
const VRR_GPS_TYPE_BUSINESS = 1; // Business const AGRP_GPS_TYPE_BUSINESS = 1; // Business
const VRR_GPS_TYPE_POLICE = 2; // Police Station const AGRP_GPS_TYPE_POLICE = 2; // Police Station
const VRR_GPS_TYPE_HOSPITAL = 3; // Hospital const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital
const VRR_GPS_TYPE_JOB = 4; // Job const AGRP_GPS_TYPE_JOB = 4; // Job
const VRR_GPS_TYPE_GAMELOC = 5; // Game Location const AGRP_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 = VRR_GPS_TYPE_NONE; let locationType = AGRP_GPS_TYPE_NONE;
let useType = VRR_ITEM_USE_TYPE_NONE; let useType = AGRP_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 = VRR_GPS_TYPE_POLICE; locationType = AGRP_GPS_TYPE_POLICE;
break; break;
case "hospital": case "hospital":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_HOSPITAL; locationType = AGRP_GPS_TYPE_HOSPITAL;
break; break;
case "job": case "job":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_JOB; locationType = AGRP_GPS_TYPE_JOB;
break; break;
case "skin": case "skin":
@@ -45,8 +45,8 @@ function gpsCommand(command, params, client) {
case "clothes": case "clothes":
case "player": case "player":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_SKIN; useType = AGRP_ITEM_USE_TYPE_SKIN;
break; break;
case "gun": case "gun":
@@ -56,29 +56,29 @@ function gpsCommand(command, params, client) {
case "wep": case "wep":
case "weps": case "weps":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_WEAPON; useType = AGRP_ITEM_USE_TYPE_WEAPON;
break; break;
case "food": case "food":
case "eat": case "eat":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_FOOD; useType = AGRP_ITEM_USE_TYPE_FOOD;
break; break;
case "drink": case "drink":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_DRINK; useType = AGRP_ITEM_USE_TYPE_DRINK;
break; break;
case "alcohol": case "alcohol":
case "booze": case "booze":
case "bar": case "bar":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_ALCOHOL; useType = AGRP_ITEM_USE_TYPE_ALCOHOL;
break; break;
case "repair": case "repair":
@@ -87,8 +87,8 @@ function gpsCommand(command, params, client) {
case "spray": case "spray":
case "fix": case "fix":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_VEHREPAIR; useType = AGRP_ITEM_USE_TYPE_VEHREPAIR;
break; break;
case "vehiclecolour": case "vehiclecolour":
@@ -96,14 +96,14 @@ function gpsCommand(command, params, client) {
case "carcolour": case "carcolour":
case "colour": case "colour":
blipColour = "businessBlue" blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_VEHCOLOUR; useType = AGRP_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 = VRR_GPS_TYPE_BUSINESS; locationType = AGRP_GPS_TYPE_BUSINESS;
blipColour = "businessBlue"; blipColour = "businessBlue";
useType = getItemTypeData(itemTypeId).useType; useType = getItemTypeData(itemTypeId).useType;
} else { } else {
@@ -115,12 +115,12 @@ function gpsCommand(command, params, client) {
} }
} }
if (locationType == VRR_GPS_TYPE_NONE) { if (locationType == AGRP_GPS_TYPE_NONE) {
messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation")); messagePlayerError(client, getLocaleString(client, "InvalidGPSLocation"));
return false; return false;
} }
if (locationType == VRR_GPS_TYPE_BUSINESS) { if (locationType == AGRP_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"));
@@ -137,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 == VRR_GPS_TYPE_GAMELOC) { if (locationType == AGRP_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

@@ -266,7 +266,7 @@ function playerToggledGUI(client) {
// =========================================================================== // ===========================================================================
function showPlayerTwoFactorAuthenticationGUI(client) { function showPlayerTwoFactorAuthenticationGUI(client) {
sendNetworkEventToPlayer("vrr.2fa", client); sendNetworkEventToPlayer("agrp.2fa", client);
} }
// =========================================================================== // ===========================================================================

View File

@@ -264,7 +264,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, "vrr.label.name", getHouseData(houseId).description, true); setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true);
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -1100,8 +1100,8 @@ function createHouseEntranceBlip(houseId) {
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setEntityData(entranceBlip, "vrr.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false); setEntityData(entranceBlip, "agrp.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
setEntityData(entranceBlip, "vrr.owner.id", houseId, false); setEntityData(entranceBlip, "agrp.owner.id", houseId, false);
houseData.entranceBlip = entranceBlip; houseData.entranceBlip = entranceBlip;
} }
@@ -1206,8 +1206,8 @@ function createHouseExitBlip(houseId) {
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setElementTransient(exitBlip, false); setElementTransient(exitBlip, false);
setEntityData(exitBlip, "vrr.owner.type", VRR_BLIP_HOUSE_EXIT, false); setEntityData(exitBlip, "agrp.owner.type", VRR_BLIP_HOUSE_EXIT, false);
setEntityData(exitBlip, "vrr.owner.id", houseId, false); setEntityData(exitBlip, "agrp.owner.id", houseId, false);
getHouseData(houseId).exitBlip = exitBlip; getHouseData(houseId).exitBlip = exitBlip;
} }
} }
@@ -1753,26 +1753,26 @@ function updateHousePickupLabelData(houseId) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
if (houseData.entrancePickup != null) { if (houseData.entrancePickup != null) {
setEntityData(houseData.entrancePickup, "vrr.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false); setEntityData(houseData.entrancePickup, "agrp.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false);
setEntityData(houseData.entrancePickup, "vrr.owner.id", houseId, false); setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false);
setEntityData(houseData.entrancePickup, "vrr.label.type", VRR_LABEL_HOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.type", VRR_LABEL_HOUSE, true);
setEntityData(houseData.entrancePickup, "vrr.label.name", houseData.description, true); setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
setEntityData(houseData.entrancePickup, "vrr.label.locked", houseData.locked, true); setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
if (houseData.buyPrice > 0) { if (houseData.buyPrice > 0) {
setEntityData(houseData.entrancePickup, "vrr.label.price", houseData.buyPrice, true); setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true);
} else { } else {
if (houseData.rentPrice > 0) { if (houseData.rentPrice > 0) {
setEntityData(houseData.entrancePickup, "vrr.label.rentprice", houseData.rentPrice, true); setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true);
} }
} }
} }
if (houseData.exitPickup != null) { if (houseData.exitPickup != null) {
setEntityData(houseData.exitPickup, "vrr.owner.type", VRR_PICKUP_HOUSE_EXIT, false); setEntityData(houseData.exitPickup, "agrp.owner.type", VRR_PICKUP_HOUSE_EXIT, false);
setEntityData(houseData.exitPickup, "vrr.owner.id", houseId, false); setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false);
setEntityData(houseData.exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true); setEntityData(houseData.exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
} }
} }

View File

@@ -8,33 +8,33 @@
// =========================================================================== // ===========================================================================
// Insurance Account Owner Types // Insurance Account Owner Types
const VRR_INS_ACCT_OWNER_NONE = 0; // None const AGRP_INS_ACCT_OWNER_NONE = 0; // None
const VRR_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company const AGRP_INS_ACCT_OWNER_PLAYER = 1; // Player owns insurance company
const VRR_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company const AGRP_INS_ACCT_OWNER_BIZ = 2; // Business owns insurance company
const VRR_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company const AGRP_INS_ACCT_OWNER_CLAN = 3; // Clan owns insurance company
// =========================================================================== // ===========================================================================
// Insurance Account Entity Types // Insurance Account Entity Types
const VRR_INS_ACCT_ENTITY_NONE = 0; // None const AGRP_INS_ACCT_ENTITY_NONE = 0; // None
const VRR_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance const AGRP_INS_ACCT_ENTITY_PLAYER_HEALTH = 1; // Health Insurance
const VRR_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance const AGRP_INS_ACCT_ENTITY_PLAYER_LIFE = 2; // Life Insurance
const VRR_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance const AGRP_INS_ACCT_ENTITY_VEH = 3; // Vehicle Insurance
const VRR_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance const AGRP_INS_ACCT_ENTITY_BIZ = 4; // Business Insurance
const VRR_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance const AGRP_INS_ACCT_ENTITY_HOUSE = 5; // House Insurance
// =========================================================================== // ===========================================================================
// Insurance Account History Types // Insurance Account History Types
const VRR_INS_ACCT_HISTORY_NONE = 0; // None const AGRP_INS_ACCT_HISTORY_NONE = 0; // None
const VRR_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury) const AGRP_INS_ACCT_HISTORY_PLAYER_MEDICAL = 1; // Medical insurance was used (player disease/injury)
const VRR_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death) const AGRP_INS_ACCT_HISTORY_PLAYER_DEATH = 2; // Life insurance was used (player death)
const VRR_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed const AGRP_INS_ACCT_HISTORY_VEH_DAMAGE = 3; // Vehicle was damaged, but not destroyed
const VRR_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed const AGRP_INS_ACCT_HISTORY_VEH_WRECKED = 4; // Vehicle was completely destroyed
const VRR_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen const AGRP_INS_ACCT_HISTORY_VEH_THEFT = 5; // Vehicle was stolen
const VRR_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door) const AGRP_INS_ACCT_HISTORY_BIZ_DAMAGE = 6; // Business was damaged (broken items/window/door)
const VRR_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from const AGRP_INS_ACCT_HISTORY_BIZ_THEFT = 7; // Business was stolen from
const VRR_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged const AGRP_INS_ACCT_HISTORY_HOUSE_DAMAGE = 8; // House was damaged
const VRR_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from const AGRP_INS_ACCT_HISTORY_HOUSE_THEFT = 9; // House was stolen from
// =========================================================================== // ===========================================================================

View File

@@ -10,27 +10,27 @@
// =========================================================================== // ===========================================================================
function isPlayerHandCuffed(client) { function isPlayerHandCuffed(client) {
return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
} }
// =========================================================================== // ===========================================================================
function handCuffPlayer(client) { function handCuffPlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
} }
// =========================================================================== // ===========================================================================
function unHandCuffPlayer(client) { function unHandCuffPlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_READY; getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
} }
// =========================================================================== // ===========================================================================
function isPlayerSurrendered(client) { function isPlayerSurrendered(client) {
return true; //(getPlayerData(client).pedState == VRR_PEDSTATE_TAZED || getPlayerData(client).pedState == VRR_PEDSTATE_HANDSUP); return true; //(getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED || getPlayerData(client).pedState == AGRP_PEDSTATE_HANDSUP);
} }
// =========================================================================== // ===========================================================================

View File

@@ -9,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 == VRR_ITEM_USE_TYPE_PHONE) { if (getItemTypeData(getItemData(i).itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_PHONE) {
if (getItemData(i).value == phoneNumber) { if (getItemData(i).value == phoneNumber) {
return i; return i;
} }
@@ -30,15 +30,15 @@ function ringPhoneForNearbyPlayers(itemIndex) {
/* /*
if(isPhoneItemEnabled(itemIndex)) { if(isPhoneItemEnabled(itemIndex)) {
switch(getItemData(itemIndex).ownerType) { switch(getItemData(itemIndex).ownerType) {
case VRR_ITEM_OWNER_GROUND: case AGRP_ITEM_OWNER_GROUND:
playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra); playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra);
break; break;
case VRR_ITEM_OWNER_VEHTRUNK: case AGRP_ITEM_OWNER_VEHTRUNK:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break; break;
case VRR_ITEM_OWNER_VEHDASH: case AGRP_ITEM_OWNER_VEHDASH:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra); playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break; break;
} }

View File

@@ -10,20 +10,20 @@
// =========================================================================== // ===========================================================================
function isPlayerTied(client) { function isPlayerTied(client) {
return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED); return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
} }
// =========================================================================== // ===========================================================================
function ropeTiePlayer(client) { function ropeTiePlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_BINDED; getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
} }
// =========================================================================== // ===========================================================================
function ropeUnTiePlayer(client) { function ropeUnTiePlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_READY; getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
} }

View File

@@ -10,21 +10,21 @@
// =========================================================================== // ===========================================================================
function isPlayerTazed(client) { function isPlayerTazed(client) {
return (getPlayerData(client).pedState == VRR_PEDSTATE_TAZED); return (getPlayerData(client).pedState == AGRP_PEDSTATE_TAZED);
} }
// =========================================================================== // ===========================================================================
function tazePlayer(client) { function tazePlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_TAZED; getPlayerData(client).pedState = AGRP_PEDSTATE_TAZED;
setPlayerControlState(client, false); setPlayerControlState(client, false);
let animationId = getAnimationFromParams("tazed"); let animationId = getAnimationFromParams("tazed");
if(animationId != false) { if (animationId != false) {
forcePlayerPlayAnimation(client, animationId); forcePlayerPlayAnimation(client, animationId);
} }
setTimeout(function() { setTimeout(function () {
unTazePlayer(client); unTazePlayer(client);
doActionToNearbyPlayers(client, `The tazer effect wears off`); doActionToNearbyPlayers(client, `The tazer effect wears off`);
}, getGlobalConfig().tazerEffectDuration); }, getGlobalConfig().tazerEffectDuration);
@@ -33,7 +33,7 @@ function tazePlayer(client) {
// =========================================================================== // ===========================================================================
function unTazePlayer(client) { function unTazePlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_READY; getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
setPlayerControlState(client, true); setPlayerControlState(client, true);
setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo); setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);

View File

@@ -8,7 +8,7 @@
// =========================================================================== // ===========================================================================
function getPlayerActiveWalkieTalkieFrequency(client) { function getPlayerActiveWalkieTalkieFrequency(client) {
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, VRR_ITEM_USE_TYPE_WALKIETALKIE); let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_WALKIETALKIE);
if (walkieTalkieSlot != -1) { if (walkieTalkieSlot != -1) {
if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) { if (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) {
@@ -31,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], VRR_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) { // if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], AGRP_ITEM_USE_TYPE_WALKIETALKIE)]).enabled) {
// walkieTalkieIncomingToNearbyPlayers(clients[i], messageText); // walkieTalkieIncomingToNearbyPlayers(clients[i], messageText);
// } // }
// } // }
@@ -42,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 == VRR_ITEM_USE_TYPE_WALKIETALKIE) { if (getItemTypeData(items[i].itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) {
if (items[i].value == radioFrequency) { if (items[i].value == radioFrequency) {
walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i)); walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i));
} }
@@ -125,7 +125,7 @@ function walkieTalkieChatCommand(command, params, client) {
return false; return false;
} }
let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, VRR_ITEM_USE_TYPE_WALKIETALKIE); let walkieTalkieSlot = getPlayerFirstItemSlotByUseType(client, AGRP_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

@@ -8,22 +8,22 @@
// =========================================================================== // ===========================================================================
function policeTazerCommand(command, params, client) { function policeTazerCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -34,22 +34,22 @@ function policeTazerCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function policeCuffCommand(command, params, client) { function policeCuffCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -60,22 +60,22 @@ function policeCuffCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function policeArrestCommand(command, params, client) { function policeArrestCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -86,22 +86,22 @@ function policeArrestCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function policeSearchCommand(command, params, client) { function policeSearchCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -112,22 +112,22 @@ function policeSearchCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function policeDragCommand(command, params, client) { function policeDragCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job."); messagePlayerError(client, "You don't have a police job.");
return false; return false;
} }
@@ -138,22 +138,22 @@ function policeDragCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function policeDetainCommand(command, params, client) { function policeDetainCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUsePoliceJob(client)) { if (!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job."); messagePlayerError(client, "You are not allowed to use the police job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) { if (!doesPlayerHaveJobType(client, AGRP_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

@@ -8,22 +8,22 @@
// =========================================================================== // ===========================================================================
function taxiSetFareCommand(command, params, client) { function taxiSetFareCommand(command, params, client) {
if(!canPlayerUseJobs(client)) { if (!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs."); messagePlayerError(client, "You are not allowed to use jobs.");
return false; return false;
} }
if(!canPlayerUseTaxiJob(client)) { if (!canPlayerUseTaxiJob(client)) {
messagePlayerError(client, "You are not allowed to use the taxi job."); messagePlayerError(client, "You are not allowed to use the taxi job.");
return false; return false;
} }
if(!isPlayerWorking(client)) { if (!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first."); messagePlayerError(client, "You are not working! Use /startwork first.");
return false; return false;
} }
if(!doesPlayerHaveJobType(client, VRR_JOB_TAXI)) { if (!doesPlayerHaveJobType(client, AGRP_JOB_TAXI)) {
messagePlayerError(client, "You don't have a taxi job."); messagePlayerError(client, "You don't have a taxi job.");
return false; return false;
} }

View File

@@ -9,7 +9,7 @@
// =========================================================================== // ===========================================================================
class KeyBindData { class KeyBindData {
constructor(dbAssoc = false, key = 0, commandString = "", keyState = VRR_KEYSTATE_UP) { constructor(dbAssoc = false, key = 0, commandString = "", keyState = AGRP_KEYSTATE_UP) {
this.databaseId = 0; this.databaseId = 0;
this.key = key; this.key = key;
this.account = 0; this.account = 0;
@@ -20,7 +20,7 @@ class KeyBindData {
this.index = -1; this.index = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["acct_hotkey_id"]; this.databaseId = dbAssoc["acct_hotkey_id"];
this.key = toInteger(dbAssoc["acct_hotkey_key"]); this.key = toInteger(dbAssoc["acct_hotkey_key"]);
this.account = toInteger(dbAssoc["acct_hotkey_acct"]); this.account = toInteger(dbAssoc["acct_hotkey_acct"]);
@@ -48,19 +48,19 @@ function addKeyBindCommand(command, params, client) {
let tempCommand = getParam(params, " ", 2); let tempCommand = getParam(params, " ", 2);
let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : ""; let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : "";
if(!keyId) { if (!keyId) {
messagePlayerError(client, "The key ID or name you input is invalid!"); messagePlayerError(client, "The key ID or name you input is invalid!");
messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces.");
messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`);
return false; return false;
} }
if(!keyId) { if (!keyId) {
messagePlayerError(client, "That key name/id is invalid!"); messagePlayerError(client, "That key name/id is invalid!");
return false; return false;
} }
if(areParamsEmpty(tempCommand)) { if (areParamsEmpty(tempCommand)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -74,14 +74,14 @@ function addKeyBindCommand(command, params, client) {
function removeKeyBindCommand(command, params, client) { function removeKeyBindCommand(command, params, client) {
let keyId = getKeyIdFromParams(getParam(params, " ", 1)); let keyId = getKeyIdFromParams(getParam(params, " ", 1));
if(!keyId) { if (!keyId) {
messagePlayerError(client, "The key ID or name you input is invalid!"); messagePlayerError(client, "The key ID or name you input is invalid!");
messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces."); messagePlayerTip(client, "Use simple key names, letters, or numbers. Don't add spaces.");
messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`); messagePlayerInfo(client, `Examples: {ALTCOLOUR}1, 2, a, b, numplus, num1, f1, f2, pageup, delete, insert, rightshift, leftctrl`);
return false; return false;
} }
if(!keyId) { if (!keyId) {
messagePlayerError(client, "That key name/id is invalid!"); messagePlayerError(client, "That key name/id is invalid!");
return false; return false;
} }
@@ -94,14 +94,14 @@ function removeKeyBindCommand(command, params, client) {
function addPlayerKeyBind(client, keys, command, params, tempKey = false) { function addPlayerKeyBind(client, keys, command, params, tempKey = false) {
let keyBindData = new KeyBindData(false, keys, `${command} ${params}`); let keyBindData = new KeyBindData(false, keys, `${command} ${params}`);
if(tempKey == true) { if (tempKey == true) {
keyBindData.databaseId = -1; keyBindData.databaseId = -1;
} }
getPlayerData(client).keyBinds.push(keyBindData); getPlayerData(client).keyBinds.push(keyBindData);
sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? VRR_KEYSTATE_COMBO : VRR_KEYSTATE_UP); sendAddAccountKeyBindToClient(client, keys, (keys.length > 1) ? AGRP_KEYSTATE_COMBO : AGRP_KEYSTATE_UP);
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
let keyId = getPlayerKeyBindForCommand(client, "enter"); let keyId = getPlayerKeyBindForCommand(client, "enter");
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
sendPlayerEnterPropertyKey(client, keyId.key); sendPlayerEnterPropertyKey(client, keyId.key);
@@ -125,7 +125,7 @@ function removePlayerKeyBind(client, keyId) {
getPlayerData(client).keyBinds = getPlayerData(client).keyBinds.filter(keyBind => keyBind.key != keyId); getPlayerData(client).keyBinds = getPlayerData(client).keyBinds.filter(keyBind => keyBind.key != keyId);
sendRemoveAccountKeyBindToClient(client, keyId); sendRemoveAccountKeyBindToClient(client, keyId);
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) { if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
let keyId = getPlayerKeyBindForCommand(client, "enter"); let keyId = getPlayerKeyBindForCommand(client, "enter");
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
sendPlayerEnterPropertyKey(client, keyId.key); sendPlayerEnterPropertyKey(client, keyId.key);
@@ -137,8 +137,8 @@ function removePlayerKeyBind(client, keyId) {
// =========================================================================== // ===========================================================================
function doesPlayerHaveKeyBindForCommand(client, command) { function doesPlayerHaveKeyBindForCommand(client, command) {
for(let i in getPlayerData(client).keyBinds) { for (let i in getPlayerData(client).keyBinds) {
if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { if (toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
return true; return true;
} }
} }
@@ -148,8 +148,8 @@ function doesPlayerHaveKeyBindForCommand(client, command) {
// =========================================================================== // ===========================================================================
function getPlayerKeyBindForCommand(client, command) { function getPlayerKeyBindForCommand(client, command) {
for(let i in getPlayerData(client).keyBinds) { for (let i in getPlayerData(client).keyBinds) {
if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) { if (toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
return getPlayerData(client).keyBinds[i]; return getPlayerData(client).keyBinds[i];
} }
} }
@@ -159,8 +159,8 @@ function getPlayerKeyBindForCommand(client, command) {
// =========================================================================== // ===========================================================================
function doesPlayerHaveKeyBindForKey(client, key) { function doesPlayerHaveKeyBindForKey(client, key) {
for(let i in getPlayerData(client).keyBinds) { for (let i in getPlayerData(client).keyBinds) {
if(getPlayerData(client).keyBinds[i].key == key) { if (getPlayerData(client).keyBinds[i].key == key) {
return true; return true;
} }
} }
@@ -176,8 +176,8 @@ function doesPlayerHaveKeyBindsDisabled(client) {
// =========================================================================== // ===========================================================================
function getPlayerKeyBindForKey(client, key) { function getPlayerKeyBindForKey(client, key) {
for(let i in getPlayerData(client).keyBinds) { for (let i in getPlayerData(client).keyBinds) {
if(getPlayerData(client).keyBinds[i].key == key) { if (getPlayerData(client).keyBinds[i].key == key) {
return getPlayerData(client).keyBinds[i]; return getPlayerData(client).keyBinds[i];
} }
} }
@@ -187,22 +187,22 @@ function getPlayerKeyBindForKey(client, key) {
// =========================================================================== // ===========================================================================
function playerUsedKeyBind(client, key) { function playerUsedKeyBind(client, key) {
if(!isPlayerLoggedIn(client)) { if (!isPlayerLoggedIn(client)) {
return false; return false;
} }
if(!isPlayerSpawned(client)) { if (!isPlayerSpawned(client)) {
return false; return false;
} }
logToConsole(LOG_DEBUG, `[VRR.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`); logToConsole(LOG_DEBUG, `[VRR.KeyBind] ${getPlayerDisplayForConsole(client)} used keybind ${toUpperCase(getKeyNameFromId(key))} (${key})`);
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) { if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForKey(client, key)) {
let keyBindData = getPlayerKeyBindForKey(client, key); let keyBindData = getPlayerKeyBindForKey(client, key);
if(keyBindData.enabled) { if (keyBindData.enabled) {
let splitCommandString = keyBindData.commandString.split(" "); let splitCommandString = keyBindData.commandString.split(" ");
let tempCommand = splitCommandString[0]; let tempCommand = splitCommandString[0];
let tempParams = ""; let tempParams = "";
if(splitCommandString.length > 1) { if (splitCommandString.length > 1) {
tempParams = splitCommandString.slice(1).join(" "); tempParams = splitCommandString.slice(1).join(" ");
} }
getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client); getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client);
@@ -215,7 +215,7 @@ function playerUsedKeyBind(client, key) {
function sendAccountKeyBindsToClient(client) { function sendAccountKeyBindsToClient(client) {
sendClearKeyBindsToClient(client); sendClearKeyBindsToClient(client);
for(let i in getPlayerData(client).keyBinds) { for (let i in getPlayerData(client).keyBinds) {
sendAddAccountKeyBindToClient(client, getPlayerData(client).keyBinds[i].key, getPlayerData(client).keyBinds[i].keyState); sendAddAccountKeyBindToClient(client, getPlayerData(client).keyBinds[i].key, getPlayerData(client).keyBinds[i].keyState);
} }
} }
@@ -223,13 +223,13 @@ function sendAccountKeyBindsToClient(client) {
// =========================================================================== // ===========================================================================
function showKeyBindListCommand(command, params, client) { function showKeyBindListCommand(command, params, client) {
let keybindList = getPlayerData(client).keyBinds.map(function(x) { return `{ALTCOLOUR}${toUpperCase(getKeyNameFromId(x.key))}: {MAINCOLOUR}${x.commandString}`; }); let keybindList = getPlayerData(client).keyBinds.map(function (x) { return `{ALTCOLOUR}${toUpperCase(getKeyNameFromId(x.key))}: {MAINCOLOUR}${x.commandString}`; });
let chunkedList = splitArrayIntoChunks(keybindList, 6); let chunkedList = splitArrayIntoChunks(keybindList, 6);
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderKeyBindsList"))); messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderKeyBindsList")));
for(let i in chunkedList) { for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", ")); messagePlayerInfo(client, chunkedList[i].join(", "));
} }
} }

View File

@@ -168,8 +168,8 @@ function enterExitPropertyCommand(command, params, client) {
return false; return false;
} }
let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type"); let ownerType = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.type");
let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id"); let ownerId = getEntityData(getPlayerData(client).currentPickup, "agrp.owner.id");
switch (ownerType) { switch (ownerType) {
case VRR_PICKUP_BUSINESS_ENTRANCE: case VRR_PICKUP_BUSINESS_ENTRANCE:

View File

@@ -181,7 +181,7 @@ function getVehicleHeading(vehicle) {
function setVehicleHeading(vehicle, heading) { function setVehicleHeading(vehicle, heading) {
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
} }
return vehicle.heading = heading; return vehicle.heading = heading;
} }
@@ -255,7 +255,7 @@ function removePlayerFromVehicle(client) {
function setPlayerSkin(client, skinIndex) { function setPlayerSkin(client, skinIndex) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else { } else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
} }
@@ -547,15 +547,15 @@ function repairVehicle(vehicle) {
// =========================================================================== // ===========================================================================
function setVehicleLights(vehicle, lights) { function setVehicleLights(vehicle, lights) {
setEntityData(vehicle, "vrr.lights", lights, true); setEntityData(vehicle, "agrp.lights", lights, true);
sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, lights); sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
} }
// =========================================================================== // ===========================================================================
function setVehicleEngine(vehicle, engine) { function setVehicleEngine(vehicle, engine) {
vehicle.engine = engine; vehicle.engine = engine;
setEntityData(vehicle, "vrr.engine", engine, true); setEntityData(vehicle, "agrp.engine", engine, true);
} }
// =========================================================================== // ===========================================================================
@@ -688,7 +688,7 @@ function setPlayerFightStyle(client, fightStyleId) {
return false; return false;
} }
setEntityData(getPlayerElement(client), "vrr.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]); setEntityData(getPlayerElement(client), "agrp.fightStyle", [getGameConfig().fightStyles[getGame()][fightStyleId][1][0], getGameConfig().fightStyles[getGame()][fightStyleId][1][1]]);
forcePlayerToSyncElementProperties(null, getPlayerElement(client)); forcePlayerToSyncElementProperties(null, getPlayerElement(client));
} }
@@ -707,7 +707,7 @@ function getPlayerElement(client) {
// =========================================================================== // ===========================================================================
function setElementPosition(element, position) { function setElementPosition(element, position) {
sendNetworkEventToPlayer("vrr.elementPosition", null, element.id, position); sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position);
} }
// =========================================================================== // ===========================================================================
@@ -725,14 +725,14 @@ function getElementHeading(element) {
// =========================================================================== // ===========================================================================
function setElementInterior(element, interior) { function setElementInterior(element, interior) {
setEntityData(element, "vrr.interior", interior, true); setEntityData(element, "agrp.interior", interior, true);
forcePlayerToSyncElementProperties(null, element); forcePlayerToSyncElementProperties(null, element);
} }
// =========================================================================== // ===========================================================================
function setElementCollisionsEnabled(element, state) { function setElementCollisionsEnabled(element, state) {
sendNetworkEventToPlayer("vrr.elementCollisions", null, element.id, state); sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state);
} }
// =========================================================================== // ===========================================================================
@@ -1142,13 +1142,13 @@ function setVehicleHealth(vehicle, health) {
function givePlayerWeapon(client, weaponId, ammo, active = true) { function givePlayerWeapon(client, weaponId, ammo, active = true) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active); sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
} }
// =========================================================================== // ===========================================================================
function setPlayerWantedLevel(client, wantedLevel) { function setPlayerWantedLevel(client, wantedLevel) {
sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel); sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel);
return true; return true;
} }
@@ -1287,7 +1287,7 @@ function serverBanIP(ip) {
// =========================================================================== // ===========================================================================
function setVehicleTrunkState(vehicle, trunkState) { function setVehicleTrunkState(vehicle, trunkState) {
sendNetworkEventToPlayer("vrr.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
} }
// =========================================================================== // ===========================================================================
@@ -1388,7 +1388,7 @@ function deletePlayerPed(client) {
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
destroyElement(client.player); destroyElement(client.player);
} else { } else {
sendNetworkEventToPlayer("vrr.deleteLocalPlayerPed", client); sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
} }
} }

View File

@@ -12,7 +12,7 @@ let paintBallItems = [];
// =========================================================================== // ===========================================================================
let paintBallItemNames = { let paintBallItemNames = {
[VRR_GAME_GTA_III]: [ [AGRP_GAME_GTA_III]: [
"Colt 45", "Colt 45",
"Uzi", "Uzi",
"Shotgun", "Shotgun",
@@ -20,7 +20,7 @@ let paintBallItemNames = {
"Sniper Rifle", "Sniper Rifle",
], ],
[VRR_GAME_GTA_VC]: [ [AGRP_GAME_GTA_VC]: [
"Colt 45", "Colt 45",
"Pump Shotgun", "Pump Shotgun",
"Ingram", "Ingram",
@@ -29,7 +29,7 @@ let paintBallItemNames = {
"Sniper Rifle", "Sniper Rifle",
], ],
[VRR_GAME_GTA_SA]: [ [AGRP_GAME_GTA_SA]: [
"Desert Eagle", "Desert Eagle",
"Shotgun", "Shotgun",
"MP5", "MP5",
@@ -37,7 +37,7 @@ let paintBallItemNames = {
"Sniper Rifle", "Sniper Rifle",
], ],
[VRR_GAME_GTA_IV]: [ [AGRP_GAME_GTA_IV]: [
"Glock 9mm", "Glock 9mm",
"Micro Uzi", "Micro Uzi",
"Stubby Shotgun", "Stubby Shotgun",
@@ -62,7 +62,7 @@ function startPaintBall(client) {
} }
storePlayerItemsInTempLocker(client); storePlayerItemsInTempLocker(client);
getPlayerData(client).tempLockerType = VRR_TEMP_LOCKER_TYPE_PAINTBALL; getPlayerData(client).tempLockerType = AGRP_TEMP_LOCKER_TYPE_PAINTBALL;
getPlayerData(client).inPaintBall = true; getPlayerData(client).inPaintBall = true;
getPlayerData(client).paintBallBusiness = getPlayerBusiness(client); getPlayerData(client).paintBallBusiness = getPlayerBusiness(client);
@@ -85,7 +85,7 @@ function stopPaintBall(client) {
function givePlayerPaintBallItems(client) { function givePlayerPaintBallItems(client) {
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`); logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
for (let i in paintBallItems) { for (let i in paintBallItems) {
let itemId = createItem(paintBallItems[i], value, VRR_ITEM_OWNER_PLAYER, getPlayerCurrentSubAccount(client).databaseId); let itemId = createItem(paintBallItems[i], value, AGRP_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);

View File

@@ -117,8 +117,8 @@ function playStreamingRadioCommand(command, params, client) {
} }
} }
} else { } else {
if (doesEntityDataExist(client, "vrr.inHouse")) { if (doesEntityDataExist(client, "agrp.inHouse")) {
let houseId = getEntityData(client, "vrr.inHouse"); let houseId = getEntityData(client, "agrp.inHouse");
if (radioStationId == 0) { if (radioStationId == 0) {
getHouseData(houseId).streamingRadioStation = -1; getHouseData(houseId).streamingRadioStation = -1;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -127,7 +127,7 @@ function playStreamingRadioCommand(command, params, client) {
let clients = getClients(); let clients = getClients();
for (let i in clients) { for (let i in clients) {
if (getEntityData(clients[i], "vrr.inHouse") == houseId) { if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], ""); playRadioStreamForPlayer(clients[i], "");
} }
} }
@@ -139,7 +139,7 @@ function playStreamingRadioCommand(command, params, client) {
let clients = getClients(); let clients = getClients();
for (let i in clients) { for (let i in clients) {
if (getEntityData(clients[i], "vrr.inHouse") == houseId) { if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i])); playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i]));
} }
} }

View File

@@ -880,7 +880,7 @@ function getPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToHeading = getPlayerPosition(targetClient); getPlayerData(targetClient).returnToHeading = getPlayerPosition(targetClient);
getPlayerData(targetClient).returnToDimension = getPlayerDimension(targetClient); getPlayerData(targetClient).returnToDimension = getPlayerDimension(targetClient);
getPlayerData(targetClient).returnToInterior = getPlayerInterior(targetClient); getPlayerData(targetClient).returnToInterior = getPlayerInterior(targetClient);
getPlayerData(targetClient).returnToType = VRR_RETURNTO_TYPE_ADMINGET; getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_ADMINGET;
setPlayerPosition(targetClient, getPosBehindPos(getPlayerPosition(client), getPlayerHeading(client), 2)); setPlayerPosition(targetClient, getPosBehindPos(getPlayerPosition(client), getPlayerHeading(client), 2));
setPlayerHeading(targetClient, getPlayerHeading(client)); setPlayerHeading(targetClient, getPlayerHeading(client));
@@ -932,7 +932,7 @@ function returnPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToInterior = null; getPlayerData(targetClient).returnToInterior = null;
getPlayerData(targetClient).returnToHouse = null; getPlayerData(targetClient).returnToHouse = null;
getPlayerData(targetClient).returnToBusiness = null; getPlayerData(targetClient).returnToBusiness = null;
getPlayerData(targetClient).returnToType = VRR_RETURNTO_TYPE_NONE; getPlayerData(targetClient).returnToType = AGRP_RETURNTO_TYPE_NONE;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} returned {ALTCOLOUR}${getPlayerName(targetClient)}{MAINCOLOUR} to their previous position.`);
messagePlayerAlert(targetClient, `An admin has returned you to your previous location`); messagePlayerAlert(targetClient, `An admin has returned you to your previous location`);

View File

@@ -474,11 +474,11 @@ function selectCharacter(client, characterId = -1) {
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`); logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`);
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition); //setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING; getPlayerData(client).pedState = AGRP_PEDSTATE_SPAWNING;
if (getGame() <= VRR_GAME_GTA_SA) { if (getGame() <= AGRP_GAME_GTA_SA) {
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
} else if (getGame() == VRR_GAME_GTA_IV) { } else if (getGame() == AGRP_GAME_GTA_IV) {
spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0], spawnInterior, spawnDimension);
//clearPlayerWeapons(client); //clearPlayerWeapons(client);
//setPlayerSkin(client, skin); //setPlayerSkin(client, skin);
@@ -487,7 +487,7 @@ function selectCharacter(client, characterId = -1) {
//setPlayerInterior(client, spawnInterior); //setPlayerInterior(client, spawnInterior);
//setPlayerDimension(client, spawnDimension); //setPlayerDimension(client, spawnDimension);
//restorePlayerCamera(client); //restorePlayerCamera(client);
} else if (getGame() == VRR_GAME_MAFIA_ONE) { } else if (getGame() == AGRP_GAME_MAFIA_ONE) {
//spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); //spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]);
logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`); logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`);
spawnPlayer(client, getGameConfig().skins[getGame()][skin][0], spawnPosition, spawnHeading); spawnPlayer(client, getGameConfig().skins[getGame()][skin][0], spawnPosition, spawnHeading);

View File

@@ -244,7 +244,7 @@ function checkPayDays() {
} }
for (let i in getServerData().businesses) { for (let i in getServerData().businesses) {
if (getBusinessData(i).ownerType != VRR_BIZ_OWNER_NONE && getBusinessData(i).ownerType != VRR_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != VRR_BIZ_OWNER_FACTION) { if (getBusinessData(i).ownerType != AGRP_BIZ_OWNER_NONE && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_PUBLIC && getBusinessData(i).ownerType != AGRP_BIZ_OWNER_FACTION) {
getBusinessData(i).till += 1000; getBusinessData(i).till += 1000;
} }
} }

View File

@@ -260,8 +260,8 @@ function checkPlayerPedStates() {
if (getPlayerData(clients[i])) { if (getPlayerData(clients[i])) {
if (getPlayerData(clients[i]).pedState) { if (getPlayerData(clients[i]).pedState) {
if (isPlayerInAnyVehicle(clients[i])) { if (isPlayerInAnyVehicle(clients[i])) {
if (getPlayerData(clients[i]).pedState == VRR_PEDSTATE_EXITINGVEHICLE) { if (getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_EXITINGVEHICLE) {
getPlayerData(clients[i]).pedState == VRR_PEDSTATE_READY; getPlayerData(clients[i]).pedState == AGRP_PEDSTATE_READY;
} }
} }
} }
@@ -458,7 +458,7 @@ function isClientInitialized(client) {
// =========================================================================== // ===========================================================================
function getPedForNetworkEvent(ped) { function getPedForNetworkEvent(ped) {
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == AGRP_GAME_GTA_IV) {
return ped; return ped;
} else { } else {
return ped.id; return ped.id;

View File

@@ -8,10 +8,10 @@
// =========================================================================== // ===========================================================================
// Label Types // Label Types
const VRR_LABEL_JOB = 1; const AGRP_LABEL_JOB = 1;
const VRR_LABEL_BUSINESS = 2; const AGRP_LABEL_BUSINESS = 2;
const VRR_LABEL_HOUSE = 3; const AGRP_LABEL_HOUSE = 3;
const VRR_LABEL_EXIT = 4; const AGRP_LABEL_EXIT = 4;
// Log Levels // Log Levels
const LOG_ALL = -1; const LOG_ALL = -1;
@@ -23,115 +23,115 @@ const LOG_VERBOSE = 8;
const LOG_DEBUG = 16; const LOG_DEBUG = 16;
// Weapon Damage Event Types // Weapon Damage Event Types
const VRR_WEAPON_DAMAGE_EVENT_NONE = 0; const AGRP_WEAPON_DAMAGE_EVENT_NONE = 0;
const VRR_WEAPON_DAMAGE_EVENT_NORMAL = 1; const AGRP_WEAPON_DAMAGE_EVENT_NORMAL = 1;
const VRR_WEAPON_DAMAGE_EVENT_TAZER = 2; const AGRP_WEAPON_DAMAGE_EVENT_TAZER = 2;
const VRR_WEAPON_DAMAGE_EVENT_EXTINGUISH = 3; const AGRP_WEAPON_DAMAGE_EVENT_EXTINGUISH = 3;
const VRR_WEAPON_DAMAGE_EVENT_MACE = 4; const AGRP_WEAPON_DAMAGE_EVENT_MACE = 4;
// Games // Games
const VRR_GAME_GTA_III = 1; const AGRP_GAME_GTA_III = 1;
const VRR_GAME_GTA_VC = 2; const AGRP_GAME_GTA_VC = 2;
const VRR_GAME_GTA_SA = 3; const AGRP_GAME_GTA_SA = 3;
const VRR_GAME_GTA_IV = 5; const AGRP_GAME_GTA_IV = 5;
const VRR_GAME_GTA_IV_EFLC = 6; const AGRP_GAME_GTA_IV_EFLC = 6;
const VRR_GAME_GTA_V = 50; const AGRP_GAME_GTA_V = 50;
const VRR_GAME_MAFIA_ONE = 10; const AGRP_GAME_MAFIA_ONE = 10;
const VRR_GAME_MAFIA_TWO = 11; const AGRP_GAME_MAFIA_TWO = 11;
const VRR_GAME_MAFIA_THREE = 12; const AGRP_GAME_MAFIA_THREE = 12;
const VRR_GAME_MAFIA_ONE_DE = 13; const AGRP_GAME_MAFIA_ONE_DE = 13;
// Key States // Key States
const VRR_KEYSTATE_NONE = 0; const AGRP_KEYSTATE_NONE = 0;
const VRR_KEYSTATE_UP = 1; const AGRP_KEYSTATE_UP = 1;
const VRR_KEYSTATE_DOWN = 2; const AGRP_KEYSTATE_DOWN = 2;
const VRR_KEYSTATE_HOLDSHORT = 3; const AGRP_KEYSTATE_HOLDSHORT = 3;
const VRR_KEYSTATE_HOLDLONG = 4; const AGRP_KEYSTATE_HOLDLONG = 4;
const VRR_KEYSTATE_COMBO = 4; const AGRP_KEYSTATE_COMBO = 4;
// Business Label Info Types // Business Label Info Types
const VRR_PROPLABEL_INFO_NONE = 0; const AGRP_PROPLABEL_INFO_NONE = 0;
const VRR_PROPLABEL_INFO_BUY = 1; const AGRP_PROPLABEL_INFO_BUY = 1;
const VRR_PROPLABEL_INFO_ENTER = 2; const AGRP_PROPLABEL_INFO_ENTER = 2;
const VRR_PROPLABEL_INFO_ENTERVEHICLE = 3; const AGRP_PROPLABEL_INFO_ENTERVEHICLE = 3;
const VRR_PROPLABEL_INFO_REFUEL = 4; const AGRP_PROPLABEL_INFO_REFUEL = 4;
const VRR_PROPLABEL_INFO_REPAIR = 5; const AGRP_PROPLABEL_INFO_REPAIR = 5;
const VRR_PROPLABEL_INFO_BUYHOUSE = 6; const AGRP_PROPLABEL_INFO_BUYHOUSE = 6;
const VRR_PROPLABEL_INFO_RENTHOUSE = 7; const AGRP_PROPLABEL_INFO_RENTHOUSE = 7;
const VRR_PROPLABEL_INFO_BUYBIZ = 8; const AGRP_PROPLABEL_INFO_BUYBIZ = 8;
// Animation Types // Animation Types
const VRR_ANIMTYPE_NONE = 0; const AGRP_ANIMTYPE_NONE = 0;
const VRR_ANIMTYPE_NORMAL = 1; const AGRP_ANIMTYPE_NORMAL = 1;
const VRR_ANIMTYPE_BLEND = 2; const AGRP_ANIMTYPE_BLEND = 2;
const VRR_ANIMTYPE_SHARED = 3; // Forces this animation to play in sync with another ped's mirrored anim (handshake, kiss, gang signs, etc) const AGRP_ANIMTYPE_SHARED = 3; // Forces this animation to play in sync with another ped's mirrored anim (handshake, kiss, gang signs, etc)
const VRR_ANIMTYPE_SPECIALACTION = 4; // This animtype uses a special action (only in SA) const AGRP_ANIMTYPE_SPECIALACTION = 4; // This animtype uses a special action (only in SA)
const VRR_ANIMTYPE_SURRENDER = 5; // This animtype is used to surrender (like handsup or cower) const AGRP_ANIMTYPE_SURRENDER = 5; // This animtype is used to surrender (like handsup or cower)
const VRR_ANIMTYPE_FORCED = 6; // This animtype is forced (can't use stopanim to get out of it) const AGRP_ANIMTYPE_FORCED = 6; // This animtype is forced (can't use stopanim to get out of it)
const VRR_ANIMTYPE_FREEZE = 7; // This animtype is forced (can't use stopanim to get out of it) const AGRP_ANIMTYPE_FREEZE = 7; // This animtype is forced (can't use stopanim to get out of it)
// Animation Move Types // Animation Move Types
const VRR_ANIMMOVE_NONE = 0; const AGRP_ANIMMOVE_NONE = 0;
const VRR_ANIMMOVE_FORWARD = 1; const AGRP_ANIMMOVE_FORWARD = 1;
const VRR_ANIMMOVE_BACK = 2; const AGRP_ANIMMOVE_BACK = 2;
const VRR_ANIMMOVE_LEFT = 3; const AGRP_ANIMMOVE_LEFT = 3;
const VRR_ANIMMOVE_RIGHT = 4; const AGRP_ANIMMOVE_RIGHT = 4;
// Multiplayer Modifications // Multiplayer Modifications
const VRR_MPMOD_NONE = 0; const AGRP_MPMOD_NONE = 0;
const VRR_MPMOD_GTAC = 1; const AGRP_MPMOD_GTAC = 1;
const VRR_MPMOD_MAFIAC = 2; const AGRP_MPMOD_MAFIAC = 2;
const VRR_MPMOD_OAKWOOD = 3; const AGRP_MPMOD_OAKWOOD = 3;
const VRR_MPMOD_RAGEMP = 4; const AGRP_MPMOD_RAGEMP = 4;
// Business/House Game Script States // Business/House Game Script States
//const VRR_GAMESCRIPT_NONE = 0; //const AGRP_GAMESCRIPT_NONE = 0;
//const VRR_GAMESCRIPT_DENY = 1; //const AGRP_GAMESCRIPT_DENY = 1;
//const VRR_GAMESCRIPT_ALLOW = 2; //const AGRP_GAMESCRIPT_ALLOW = 2;
//const VRR_GAMESCRIPT_FORCE = 3; //const AGRP_GAMESCRIPT_FORCE = 3;
// Vehicle Purchase States // Vehicle Purchase States
const VRR_VEHBUYSTATE_NONE = 0; const AGRP_VEHBUYSTATE_NONE = 0;
const VRR_VEHBUYSTATE_TESTDRIVE = 1; const AGRP_VEHBUYSTATE_TESTDRIVE = 1;
const VRR_VEHBUYSTATE_EXITVEH = 2; const AGRP_VEHBUYSTATE_EXITVEH = 2;
const VRR_VEHBUYSTATE_FARENOUGH = 3; const AGRP_VEHBUYSTATE_FARENOUGH = 3;
const VRR_VEHBUYSTATE_WRONGVEH = 4; const AGRP_VEHBUYSTATE_WRONGVEH = 4;
// Islands // Islands
const VRR_ISLAND_NONE = 0; // None const AGRP_ISLAND_NONE = 0; // None
const VRR_ISLAND_PORTLAND = 0; // Portland Island const AGRP_ISLAND_PORTLAND = 0; // Portland Island
const VRR_ISLAND_STAUNTON = 1; // Staunton Island const AGRP_ISLAND_STAUNTON = 1; // Staunton Island
const VRR_ISLAND_SHORESIDEVALE = 2; // Shoreside Vale const AGRP_ISLAND_SHORESIDEVALE = 2; // Shoreside Vale
const VRR_ISLAND_VICEWEST = 0; // Western Island of VC const AGRP_ISLAND_VICEWEST = 0; // Western Island of VC
const VRR_ISLAND_VICEEAST = 1; // Eastern Island of VC const AGRP_ISLAND_VICEEAST = 1; // Eastern Island of VC
const VRR_ISLAND_LOSSANTOS = 0; // Los Santos const AGRP_ISLAND_LOSSANTOS = 0; // Los Santos
const VRR_ISLAND_LASVENTURAS = 1; // Las Venturas const AGRP_ISLAND_LASVENTURAS = 1; // Las Venturas
const VRR_ISLAND_SANFIERRO = 2; // San Fierro const AGRP_ISLAND_SANFIERRO = 2; // San Fierro
const VRR_ISLAND_REDCOUNTYNORTH = 4; // Red County North (spans all the way from Palamino/shore on the east east to border of Flint County on the west) const AGRP_ISLAND_REDCOUNTYNORTH = 4; // Red County North (spans all the way from Palamino/shore on the east east to border of Flint County on the west)
const VRR_ISLAND_BONECOUNTYNORTH = 5; // Bone County North (usually called Tierra Robada) const AGRP_ISLAND_BONECOUNTYNORTH = 5; // Bone County North (usually called Tierra Robada)
const VRR_ISLAND_BONECOUNTYSOUTH = 6; // Bone County South const AGRP_ISLAND_BONECOUNTYSOUTH = 6; // Bone County South
// Body Parts for Skin Select (IV for now, but might do other games when I can add accessory objects) // Body Parts for Skin Select (IV for now, but might do other games when I can add accessory objects)
const VRR_SKINSELECT_NONE = 0; const AGRP_SKINSELECT_NONE = 0;
const VRR_SKINSELECT_SKIN = 1; const AGRP_SKINSELECT_SKIN = 1;
const VRR_SKINSELECT_HAT = 2; const AGRP_SKINSELECT_HAT = 2;
const VRR_SKINSELECT_HAIR = 3; const AGRP_SKINSELECT_HAIR = 3;
const VRR_SKINSELECT_EYES = 5; const AGRP_SKINSELECT_EYES = 5;
const VRR_SKINSELECT_UPPER = 6; const AGRP_SKINSELECT_UPPER = 6;
const VRR_SKINSELECT_LOWER = 7; const AGRP_SKINSELECT_LOWER = 7;
const VRR_SKINSELECT_SHOES = 8; const AGRP_SKINSELECT_SHOES = 8;
const VRR_SKINSELECT_LEFTWRIST = 9; const AGRP_SKINSELECT_LEFTWRIST = 9;
const VRR_SKINSELECT_RIGHTWRIST = 10; const AGRP_SKINSELECT_RIGHTWRIST = 10;
const VRR_SKINSELECT_LEFTHAND = 11; const AGRP_SKINSELECT_LEFTHAND = 11;
const VRR_SKINSELECT_RIGHTHAND = 12; const AGRP_SKINSELECT_RIGHTHAND = 12;
const VRR_SKINSELECT_HEAD = 13; const AGRP_SKINSELECT_HEAD = 13;
// Action States for NPCs // Action States for NPCs
const VRR_NPC_ACTION_NONE = 0; const AGRP_NPC_ACTION_NONE = 0;
const VRR_NPC_ACTION_ANIM = 1; const AGRP_NPC_ACTION_ANIM = 1;
const VRR_NPC_ACTION_WALKTO = 2; const AGRP_NPC_ACTION_WALKTO = 2;
const VRR_NPC_ACTION_RUNTO = 3; const AGRP_NPC_ACTION_RUNTO = 3;
const VRR_NPC_ACTION_SPRINTTO = 4; const AGRP_NPC_ACTION_SPRINTTO = 4;
const VRR_NPC_ACTION_FOLLOW = 5; const AGRP_NPC_ACTION_FOLLOW = 5;
const VRR_NPC_ACTION_DEFEND = 6; const AGRP_NPC_ACTION_DEFEND = 6;
const VRR_NPC_ACTION_GUARD_AREA = 7; const AGRP_NPC_ACTION_GUARD_AREA = 7;

File diff suppressed because it is too large Load Diff

View File

@@ -1411,7 +1411,7 @@ function getPercentage(num, per) {
// =========================================================================== // ===========================================================================
function getMultiplayerMod() { function getMultiplayerMod() {
return (getGame() >= 10) ? VRR_MPMOD_MAFIAC : VRR_MPMOD_GTAC; return (getGame() >= 10) ? AGRP_MPMOD_MAFIAC : AGRP_MPMOD_GTAC;
} }
// =========================================================================== // ===========================================================================
@@ -1423,7 +1423,7 @@ function isSnowSupported(gameId) {
// =========================================================================== // ===========================================================================
function isGTAIV() { function isGTAIV() {
return (getGame() == VRR_GAME_GTA_IV); return (getGame() == AGRP_GAME_GTA_IV);
} }
// =========================================================================== // ===========================================================================
@@ -1758,7 +1758,7 @@ function getPosInFrontOfPos(pos, angle, distance) {
let y = pos.y; let y = pos.y;
let z = pos.z; let z = pos.z;
if (getGame() != VRR_GAME_MAFIA_ONE) { if (getGame() != AGRP_GAME_MAFIA_ONE) {
x = (pos.x + ((Math.cos(angle + (Math.PI / 2))) * distance)); x = (pos.x + ((Math.cos(angle + (Math.PI / 2))) * distance));
y = (pos.y + ((Math.sin(angle + (Math.PI / 2))) * distance)); y = (pos.y + ((Math.sin(angle + (Math.PI / 2))) * distance));
} else { } else {
@@ -1782,7 +1782,7 @@ function getPosBehindPos(pos, angle, distance) {
let y = pos.y; let y = pos.y;
let z = pos.z; let z = pos.z;
if (getGame() < VRR_GAME_MAFIA_ONE) { if (getGame() < AGRP_GAME_MAFIA_ONE) {
y = (pos.y + ((Math.sin(angle - (Math.PI / 2))) * distance)); y = (pos.y + ((Math.sin(angle - (Math.PI / 2))) * distance));
} else { } else {
angle = radToDeg(angle); angle = radToDeg(angle);
@@ -2286,7 +2286,7 @@ function ArrayBufferToString(buffer) {
// =========================================================================== // ===========================================================================
function getElementTypeName(typeId) { function getElementTypeName(typeId) {
if (getGame() == VRR_GAME_MAFIA_ONE) { if (getGame() == AGRP_GAME_MAFIA_ONE) {
switch (typeId) { switch (typeId) {
case ELEMENT_VEHICLE: case ELEMENT_VEHICLE:
return "Vehicle"; return "Vehicle";

View File

@@ -65,7 +65,7 @@ mexui.bindEvents = function () {
}); });
{ {
var eventName = (game.game == VRR_GAME_GTA_SA || game.game == VRR_GAME_MAFIA_ONE) ? 'onDrawnHUD' : 'onBeforeDrawHUD'; var eventName = (game.game == AGRP_GAME_GTA_SA || game.game == AGRP_GAME_MAFIA_ONE) ? 'onDrawnHUD' : 'onBeforeDrawHUD';
addEventHandler(eventName, function (event) { addEventHandler(eventName, function (event) {
mexui.render(); mexui.render();
}); });