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;
switch (animationData.moveType) {
case VRR_ANIMMOVE_FORWARD: {
case AGRP_ANIMMOVE_FORWARD: {
setElementCollisionsEnabled(ped, false);
if (ped.isSyncer) {
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -28,7 +28,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break;
}
case VRR_ANIMMOVE_BACK: {
case AGRP_ANIMMOVE_BACK: {
setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) {
setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -37,7 +37,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break;
}
case VRR_ANIMMOVE_LEFT: {
case AGRP_ANIMMOVE_LEFT: {
setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) {
setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
@@ -46,7 +46,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
break;
}
case VRR_ANIMMOVE_RIGHT: {
case AGRP_ANIMMOVE_RIGHT: {
setElementCollisionsEnabled(pedId, false);
if (ped.isSyncer) {
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 (animationData.animType == VRR_ANIMTYPE_NORMAL || animationData.animType == VRR_ANIMTYPE_SURRENDER) {
if (getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
if (getGame() < AGRP_GAME_GTA_IV) {
if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) {
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations();
} else {
ped.clearObjective();
@@ -74,7 +74,7 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
setLocalPlayerControlState(false, false);
localPlayer.collisionsEnabled = false;
}
} else if (animationData.animType == VRR_ANIMTYPE_BLEND) {
} else if (animationData.animType == AGRP_ANIMTYPE_BLEND) {
ped.position = ped.position;
ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
}
@@ -95,7 +95,7 @@ function forcePedAnimation(pedId, animSlot) {
let animationData = getAnimationData(animSlot);
if (getGame() < VRR_GAME_GTA_IV) {
if (getGame() < AGRP_GAME_GTA_IV) {
ped.position = ped.position;
ped.addAnimation(animationData.groupId, animationData.animId);
@@ -119,8 +119,8 @@ function makePedStopAnimation(pedId) {
return false;
}
if (getGame() != VRR_GAME_GTA_IV) {
if (getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
if (getGame() != AGRP_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations();
} else {
ped.clearObjective();
@@ -128,7 +128,7 @@ function makePedStopAnimation(pedId) {
}
if (ped == localPlayer) {
if (getGame() != VRR_GAME_GTA_IV) {
if (getGame() != AGRP_GAME_GTA_IV) {
localPlayer.collisionsEnabled = true;
}
setLocalPlayerControlState(true, false);

View File

@@ -41,7 +41,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
if (blipModel == -1) {
if (businessData.blipId != -1) {
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);
} else {
destroyElement(getElementFromId(blipId));
@@ -55,7 +55,7 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
} else {
if (businessData.blipId != -1) {
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.changeBlipSprite(businessData.blipId, businessData.blipModel);
natives.setBlipMarkerLongDistance(businessData.blipId, false);

View File

@@ -151,7 +151,7 @@ function onElementStreamIn(event, element) {
function onLocalPlayerExitedVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (inVehicleSeat) {
parkedVehiclePosition = false;
@@ -164,7 +164,7 @@ function onLocalPlayerExitedVehicle(event, vehicle, seat) {
function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (areServerElementsSupported()) {
//if(inVehicleSeat == 0) {
@@ -188,7 +188,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
if (damagedEntity == localPlayer) {
//if(!weaponDamageEnabled[damagerEntity.name]) {
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) {
logToConsole(LOG_DEBUG, `[VRR.GPS] Showing gps location`);
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_SA) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason.
gpsSphere = game.createPickup(1318, position, 1);
} else {
@@ -26,7 +26,7 @@ function showGPSLocation(position, colour) {
gpsSphere.colour = colour;
}
if(gpsBlip != null) {
if (gpsBlip != null) {
destroyElement(gpsBlip);
}
@@ -40,16 +40,16 @@ function showGPSLocation(position, colour) {
function blinkGPSBlip(times, position, colour) {
gpsBlipBlinkTimes = times;
gpsBlipBlinkTimer = setInterval(function() {
if(gpsBlip != null) {
gpsBlipBlinkTimer = setInterval(function () {
if (gpsBlip != null) {
destroyElement(gpsBlip);
gpsBlip = null;
} else {
gpsBlip = game.createBlip(position, 0, 2, colour);
}
if(gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
if(gpsBlip != null) {
if (gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
if (gpsBlip != null) {
destroyElement(gpsBlip);
gpsBlip = null;
}

View File

@@ -25,8 +25,8 @@ class HouseData {
function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
logToConsole(LOG_DEBUG, `[VRR.House] Received house ${houseId} (${name}) from server`);
if(!areServerElementsSupported()) {
if(getHouseData(houseId) != false) {
if (!areServerElementsSupported()) {
if (getHouseData(houseId) != false) {
let houseData = getHouseData(houseId);
houseData.description = description;
houseData.entrancePosition = entrancePosition;
@@ -35,10 +35,10 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
houseData.hasInterior = hasInterior;
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} already exists. Checking blip ...`);
if(blipModel == -1) {
if(houseData.blipId != -1) {
if (blipModel == -1) {
if (houseData.blipId != -1) {
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);
} else {
destroyElement(getElementFromId(blipId));
@@ -48,18 +48,18 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId}'s blip is unchanged`);
}
} else {
if(houseData.blipId != -1) {
if (houseData.blipId != -1) {
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.changeBlipSprite(houseData.blipId, houseData.blipModel);
natives.setBlipMarkerLongDistance(houseData.blipId, false);
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 {
let blipId = createGameBlip(houseData.blipModel, houseData.entrancePosition, houseData.name);
if(blipId != -1) {
if (blipId != -1) {
houseData.blipId = 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 {
logToConsole(LOG_DEBUG, `[VRR.House] House ${houseId} doesn't exist. Adding ...`);
let tempHouseData = new HouseData(houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
if(blipModel != -1) {
if (blipModel != -1) {
let blipId = createGameBlip(tempHouseData.blipModel, tempHouseData.entrancePosition, "House");
if(blipId != -1) {
if (blipId != -1) {
tempHouseData.blipId = 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)
* @return {HouseData} The house's data (class instance)
*/
function getHouseData(houseId) {
function getHouseData(houseId) {
let houses = getServerData().houses;
for(let i in houses) {
if(houses[i].houseId == houseId) {
for (let i in houses) {
if (houses[i].houseId == houseId) {
return houses[i];
}
}
@@ -103,7 +103,7 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode
// ===========================================================================
function setAllHouseDataIndexes() {
for(let i in getServerData().houses) {
for (let i in getServerData().houses) {
getServerData().houses[i].index = i;
}
}

View File

@@ -57,8 +57,8 @@ function setLocalPlayerWorkingState(tempWorking) {
function showJobRouteLocation(position, colour) {
logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`);
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_SA) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason.
jobRouteLocationSphere = game.createPickup(1318, position, 1);
} else {
@@ -66,7 +66,7 @@ function showJobRouteLocation(position, colour) {
jobRouteLocationSphere.colour = colour;
}
if(jobRouteLocationBlip != null) {
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
}
@@ -85,12 +85,12 @@ function enteredJobRouteSphere() {
jobBlipBlinkAmount = 0;
jobBlipBlinkTimes = 0;
if(jobRouteLocationBlip != null) {
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null;
}
if(jobRouteLocationSphere != null) {
if (jobRouteLocationSphere != null) {
destroyElement(jobRouteLocationSphere);
jobRouteLocationSphere = null;
}
@@ -102,16 +102,16 @@ function enteredJobRouteSphere() {
function blinkJobRouteLocationBlip(times, position, colour) {
jobBlipBlinkTimes = times;
jobBlipBlinkTimer = setInterval(function() {
if(jobRouteLocationBlip != null) {
jobBlipBlinkTimer = setInterval(function () {
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null;
} else {
jobRouteLocationBlip = game.createBlip(position, 0, 2, colour);
}
if(jobBlipBlinkAmount >= jobBlipBlinkTimes) {
if(jobRouteLocationBlip != null) {
if (jobBlipBlinkAmount >= jobBlipBlinkTimes) {
if (jobRouteLocationBlip != null) {
destroyElement(jobRouteLocationBlip);
jobRouteLocationBlip = null;
}
@@ -138,8 +138,8 @@ function hideJobRouteLocation() {
function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, pickupModel) {
logToConsole(LOG_DEBUG, `[VRR.Job] Received job ${jobId} (${name}) from server`);
if(getGame() == VRR_GAME_GTA_IV) {
if(getJobData(jobId) != false) {
if (getGame() == AGRP_GAME_GTA_IV) {
if (getJobData(jobId) != false) {
let jobData = getJobData(jobId);
jobData.jobLocationId = jobLocationId;
jobData.name = name;
@@ -148,10 +148,10 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
jobData.pickupModel = pickupModel;
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} already exists. Checking blip ...`);
if(blipModel == -1) {
if(jobData.blipId != -1) {
if (blipModel == -1) {
if (jobData.blipId != -1) {
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);
} else {
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`);
}
} else {
if(jobData.blipId != -1) {
if (jobData.blipId != -1) {
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.changeBlipSprite(jobData.blipId, jobData.blipModel);
natives.setBlipMarkerLongDistance(jobData.blipId, false);
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 {
let blipId = createGameBlip(jobData.blipModel, jobData.position, jobData.name);
if(blipId != -1) {
if (blipId != -1) {
jobData.blipId = 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 {
logToConsole(LOG_DEBUG, `[VRR.Job] Job ${jobId} doesn't exist. Adding ...`);
let tempJobData = new JobData(jobId, jobLocationId, name, position, blipModel, pickupModel);
if(blipModel != -1) {
if (blipModel != -1) {
let blipId = createGameBlip(blipModel, tempJobData.position, tempJobData.name);
if(blipId != -1) {
if (blipId != -1) {
tempJobData.blipId = 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)
* @return {JobData} The job's data (class instance)
*/
function getJobData(jobId) {
for(let i in getServerData().jobs) {
if(getServerData().jobs[i].jobId == jobId) {
function getJobData(jobId) {
for (let i in getServerData().jobs) {
if (getServerData().jobs[i].jobId == jobId) {
return getServerData().jobs[i];
}
}
@@ -215,7 +215,7 @@ function receiveJobFromServer(jobId, jobLocationId, name, position, blipModel, p
// ===========================================================================
function setAllJobDataIndexes() {
for(let i in getServerData().jobs) {
for (let i in getServerData().jobs) {
jobs[i].index = i;
}
}

View File

@@ -333,37 +333,37 @@ function processLabelRendering() {
if (localPlayer != null) {
let pickups = getElementsByType(ELEMENT_PICKUP);
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 (!pickups[i].isOnScreen) {
let price = "0";
let rentPrice = "0";
let labelInfoType = VRR_PROPLABEL_INFO_NONE;
if (pickups[i].getData("vrr.label.price") != null) {
price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
if (pickups[i].getData("agrp.label.price") != null) {
price = makeLargeNumberReadable(pickups[i].getData("agrp.label.price"));
}
if (pickups[i].getData("vrr.label.rentprice") != null) {
rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
if (pickups[i].getData("agrp.label.rentprice") != null) {
rentPrice = makeLargeNumberReadable(pickups[i].getData("agrp.label.rentprice"));
}
if (pickups[i].getData("vrr.label.help") != null) {
labelInfoType = pickups[i].getData("vrr.label.help");
if (pickups[i].getData("agrp.label.help") != null) {
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: {
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;
}
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;
}
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;
}

View File

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

View File

@@ -48,10 +48,10 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) {
playerPaused[clientName] = paused;
playerPing[clientName] = ping;
if(getGame() == VRR_GAME_GTA_IV) {
if (getGame() == AGRP_GAME_GTA_IV) {
let client = getPlayerFromParams(clientName);
if(client != false) {
if(getPlayerPed(client) != null) {
if (client != false) {
if (getPlayerPed(client) != null) {
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) {
if(nametagFont == null) {
if (nametagFont == null) {
return false;
}
@@ -80,10 +80,10 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
// -------------------------------------------
// Health Bar
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
if(getGame() == VRR_GAME_GTA_III) {
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
if (getGame() == AGRP_GAME_GTA_III) {
// Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit
if(skin == 109) {
if (skin == 109) {
y -= 20;
} else {
y -= 5;
@@ -95,44 +95,43 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
y -= 5;
}
if(health > 0.0) {
let hx = x-width/2;
let hy = y-10/2;
let colourB = toColour(0, 0, 0, Math.floor(255.0*alpha)); // Background colour (black)
if (health > 0.0) {
let hx = x - width / 2;
let hy = y - 10 / 2;
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);
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);
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);
}
// Armour Bar
if (armour > 0.0)
{
if (armour > 0.0) {
// Go up 10 pixels to draw the next part
y -= 10;
let hx = x-width/2;
let hy = y-10/2;
let hx = x - width / 2;
let hy = y - 10 / 2;
let colourB = toColour(255, 0, 0, 0); // Background colour (black)
graphics.drawRectangle(null, [hx, hy], [width, 8], colourB, colourB, colourB, colourB);
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;
// Nametag
if(nametagFont != null) {
if (nametagFont != null) {
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
y -= 20;
// AFK Status
if(afkStatusFont != null) {
if(afk) {
if (afkStatusFont != null) {
if (afk) {
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) {
if(!areWorldLabelsSupported()) {
if (!areWorldLabelsSupported()) {
return false;
}
if(localPlayer != null) {
if (localPlayer != null) {
let playerPos = localPlayer.position;
let elementPos = element.position;
@@ -154,50 +153,50 @@ function updateNametag(element) {
let screenPos = getScreenFromWorldPosition(elementPos);
if (screenPos[2] >= 0.0) {
let health = element.health/100.0;
if(health > 1.0) {
let health = element.health / 100.0;
if (health > 1.0) {
health = 1.0;
}
let armour = element.armour/100.0;
if(armour > 1.0) {
let armour = element.armour / 100.0;
if (armour > 1.0) {
armour = 1.0;
}
let distance = playerPos.distance(elementPos);
if(distance <= nametagDistance) {
if(typeof game.processLineOfSight != "undefined") {
if (distance <= nametagDistance) {
if (typeof game.processLineOfSight != "undefined") {
let losCheck = game.processLineOfSight(playerPos, elementPos, true, false, false, true, true, false, true, true);
if(losCheck != null) {
if (losCheck != null) {
return false;
}
}
if(element.type == ELEMENT_PLAYER) {
if (element.type == ELEMENT_PLAYER) {
let name = element.name;
let colour = COLOUR_WHITE;
let paused = false;
let ping = -1;
if(element.isType(ELEMENT_PLAYER)) {
if(typeof playerNames[element.name] != "undefined") {
if (element.isType(ELEMENT_PLAYER)) {
if (typeof playerNames[element.name] != "undefined") {
name = playerNames[element.name];
}
if(typeof playerPaused[element.name] != "undefined") {
if (typeof playerPaused[element.name] != "undefined") {
paused = playerPaused[element.name];
}
if(typeof playerColours[element.name] != "undefined") {
if (typeof playerColours[element.name] != "undefined") {
colour = playerColours[element.name];
}
if(typeof playerPing[element.name] != "undefined") {
if (typeof playerPing[element.name] != "undefined") {
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) {
getClients().forEach(function(client) {
if(getPlayerPed(client) == player) {
getClients().forEach(function (client) {
if (getPlayerPed(client) == player) {
return client;
}
});
@@ -221,8 +220,8 @@ function processNameTagRendering(event) {
// return false;
//}
getElementsByType(ELEMENT_PED).forEach(function(ped) {
if(ped != localPlayer) {
getElementsByType(ELEMENT_PED).forEach(function (ped) {
if (ped != localPlayer) {
updateNametag(ped);
}
});

View File

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

View File

@@ -9,10 +9,10 @@
function processNPCMovement(npc) {
//if(npc.isSyncer == true) {
if(getEntityData(npc, "vrr.lookAtClosestPlayer") == true) {
let closestPlayer = getClosestPlayer(getElementPosition(npc.id));
setPedLookAt(npc, getElementPosition(closestPlayer.id));
}
if (getEntityData(npc, "agrp.lookAtClosestPlayer") == true) {
let closestPlayer = getClosestPlayer(getElementPosition(npc.id));
setPedLookAt(npc, getElementPosition(closestPlayer.id));
}
//}
}

View File

@@ -25,8 +25,8 @@ function initClientScripts() {
// ===========================================================================
function setUpInitialGame() {
if(getGame() == VRR_GAME_GTA_III) {
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA III ...");
if (getGame() == AGRP_GAME_GTA_III) {
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA III ...");
// Turn off unlimited sprint
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
@@ -44,8 +44,8 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true);
} else if(getGame() == VRR_GAME_GTA_VC) {
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA Vice City ...");
} else if (getGame() == AGRP_GAME_GTA_VC) {
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA Vice City ...");
// Turn off unlimited sprint
game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
@@ -87,8 +87,8 @@ function setUpInitialGame() {
// Provided by mouse camera script (mousecam.js)
SetStandardControlsEnabled(true);
} else if(getGame() == VRR_GAME_GTA_SA) {
logToConsole(LOG_DEBUG|LOG_WARN, "Setting up initial game stuff for GTA San Andreas ...");
} else if (getGame() == AGRP_GAME_GTA_SA) {
logToConsole(LOG_DEBUG | LOG_WARN, "Setting up initial game stuff for GTA San Andreas ...");
// Turn weapon skills down a bit
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
@@ -124,7 +124,7 @@ function setUpInitialGame() {
// Disables taxi/vigilante/etc and other start mission triggers
game.onMission = true;
} else if(getGame() == VRR_GAME_GTA_IV) {
} else if (getGame() == AGRP_GAME_GTA_IV) {
natives.allowEmergencyServices(false);
natives.setCreateRandomCops(true);
natives.setMaxWantedLevel(0);
@@ -186,7 +186,7 @@ function setUpInitialGame() {
// Some last steps
//natives.loadAllObjectsNow();
} else if(getGame() == VRR_GAME_MAFIA_ONE) {
} else if (getGame() == AGRP_GAME_MAFIA_ONE) {
game.mapEnabled = false;
game.setTrafficEnabled(false);
}

View File

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

View File

@@ -95,7 +95,7 @@ function runClientCode(code, returnTo) {
try {
returnValue = eval("(" + code + ")");
} catch (error) {
sendNetworkEventToServer("vrr.runCodeFail", returnTo, error.toString());
sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString());
return false;
}
let returnValueString = returnValue;
@@ -104,7 +104,7 @@ function runClientCode(code, returnTo) {
} else {
returnValueString = "null/undefined";
}
sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, returnValueString);
sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString);
}
// ===========================================================================
@@ -212,8 +212,8 @@ function setLocalPlayerInterior(interior) {
if (areServerElementsSupported() && isGameFeatureSupported("interior")) {
let vehicles = getElementsByType(ELEMENT_VEHICLE);
for (let i in vehicles) {
if (getEntityData(vehicles[i], "vrr.interior")) {
vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior");
if (getEntityData(vehicles[i], "agrp.interior")) {
vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior");
}
}
}
@@ -407,8 +407,8 @@ function processWantedLevelReset() {
function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) {
if (inVehicle && localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "vrr.engine")) {
if (getEntityData(localPlayer.vehicle, "vrr.engine") == false) {
if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) {
localPlayer.vehicle.engine = false;
if (!localPlayer.vehicle.engine) {
if (typeof localPlayer.vehicle.velocity != "undefined") {
@@ -591,7 +591,7 @@ function processNearbyPickups() {
//if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
if (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 = "") {
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;
}
if(getVehicleData(vehicleId) != false) {
if (getVehicleData(vehicleId) != false) {
let vehicleData = getVehicleData(vehicleId);
//vehicleData.position = position;
//vehicleData.heading = heading;
@@ -63,20 +63,20 @@ function receiveVehicleFromServer(vehicleId, position, model, colour1, colour2,
// ===========================================================================
function processVehiclePurchasing() {
if(vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
if(getLocalPlayerVehicle() == false) {
if (vehiclePurchaseState == VRR_VEHBUYSTATE_TESTDRIVE) {
if (getLocalPlayerVehicle() == false) {
vehiclePurchaseState = VRR_VEHBUYSTATE_EXITVEH;
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_EXITVEH);
return false;
} else {
if(vehiclePurchasing == getLocalPlayerVehicle()) {
if(getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
if (vehiclePurchasing == getLocalPlayerVehicle()) {
if (getDistance(getLocalPlayerVehicle().position, vehiclePurchasePosition) >= 25) {
vehiclePurchaseState = VRR_VEHBUYSTATE_FARENOUGH;
sendNetworkEventToServer("vrr.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
sendNetworkEventToServer("agrp.vehBuyState", VRR_VEHBUYSTATE_FARENOUGH);
}
} else {
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) {
vehiclePurchaseState = state;
if(vehicleId != null) {
if (vehicleId != null) {
vehiclePurchasing = getElementFromId(vehicleId);
} else {
vehiclePurchasing = null;
@@ -110,9 +110,9 @@ function setVehiclePurchaseState(state, vehicleId, position) {
* @param {number} vehicleId - The ID of the job (initially provided by server)
* @return {VehicleData} The vehicle's data (class instance)
*/
function getVehicleData(vehicleId) {
for(let i in getServerData().vehicles) {
if(getServerData().vehicles[i].vehicleId == vehicleId) {
function getVehicleData(vehicleId) {
for (let i in getServerData().vehicles) {
if (getServerData().vehicles[i].vehicleId == vehicleId) {
return getServerData().vehicles[i];
}
}
@@ -123,7 +123,7 @@ function setVehiclePurchaseState(state, vehicleId, position) {
// ===========================================================================
function setAllVehicleDataIndexes() {
for(let i in getServerData().vehicles) {
for (let i in getServerData().vehicles) {
getServerData().vehicles[i].index = i;
}
}

View File

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

View File

@@ -8,18 +8,18 @@
// ===========================================================================
// Ban Types
const VRR_BANTYPE_NONE = 0;
const VRR_BANTYPE_ACCOUNT = 1;
const VRR_BANTYPE_SUBACCOUNT = 2;
const VRR_BANTYPE_IPADDRESS = 3;
const VRR_BANTYPE_SUBNET = 4;
const AGRP_BANTYPE_NONE = 0;
const AGRP_BANTYPE_ACCOUNT = 1;
const AGRP_BANTYPE_SUBACCOUNT = 2;
const AGRP_BANTYPE_IPADDRESS = 3;
const AGRP_BANTYPE_SUBNET = 4;
// ===========================================================================
class BanData {
constructor(dbAssoc = false) {
this.databaseId = 0;
this.type = VRR_BANTYPE_NONE;
this.type = AGRP_BANTYPE_NONE;
this.detail = "";
this.ipAddress = "";
this.name = "";
@@ -174,7 +174,7 @@ function banAccount(accountId, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${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);
dbConnection.close();
return true;
@@ -189,7 +189,7 @@ function banSubAccount(subAccountId, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${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);
dbConnection.close();
return true;
@@ -204,7 +204,7 @@ function banIPAddress(ipAddress, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_detail, ban_who_banned, ban_reason) VALUES (${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);
dbConnection.close();
return true;
@@ -219,7 +219,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let safeReason = dbConnection.escapetoString(reason);
let dbQuery = queryDatabase(dbConnection, `INSERT INTO ban_main (ban_type, ban_ip_start, ban_ip_end, ban_who_banned, ban_reason) VALUES (${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);
dbConnection.close();
return true;
@@ -233,7 +233,7 @@ function banSubNet(ipAddressStart, ipAddressEnd, adminAccountId, reason) {
function unbanAccount(accountId, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${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);
dbConnection.close();
return true;
@@ -247,7 +247,7 @@ function unbanAccount(accountId, adminAccountId) {
function unbanSubAccount(subAccountId, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${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);
dbConnection.close();
return true;
@@ -261,7 +261,7 @@ function unbanSubAccount(subAccountId, adminAccountId) {
function unbanIPAddress(ipAddress, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${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);
dbConnection.close();
return true;
@@ -275,7 +275,7 @@ function unbanIPAddress(ipAddress, adminAccountId) {
function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
let dbConnection = connectToDatabase();
if (dbConnection) {
let dbQuery = queryDatabase(dbConnection, `UPDATE ban_main SET ban_who_removed=${adminAccountId}, ban_removed=1 WHERE ban_type=${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);
dbConnection.close();
return true;
@@ -287,7 +287,7 @@ function unbanSubNet(ipAddressStart, ipAddressEnd, adminAccountId) {
// ===========================================================================
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) {
return true;
}
@@ -298,7 +298,7 @@ function isAccountBanned(accountId) {
// ===========================================================================
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) {
return true;
}
@@ -309,7 +309,7 @@ function isSubAccountBanned(subAccountId) {
// ===========================================================================
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) {
return true;
}

View File

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

View File

@@ -452,7 +452,7 @@ function setBusinessNameCommand(command, params, client) {
let oldBusinessName = getBusinessData(businessId).name;
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;
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;
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;
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) {
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "vrr.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true);
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_EXIT, false);
setEntityData(getBusinessData(businessId).exitPickup, "agrp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
}
if (getBusinessData(businessId).entrancePickup != null) {
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.type", VRR_LABEL_BUSINESS, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.locked", getBusinessData(businessId).locked, true);
setEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_NONE, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.type", VRR_PICKUP_BUSINESS_ENTRANCE, false);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.owner.id", businessId, false);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.type", VRR_LABEL_BUSINESS, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.name", getBusinessData(businessId).name, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.locked", getBusinessData(businessId).locked, true);
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_NONE, true);
switch (getBusinessData(businessId).labelHelpType) {
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;
}
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;
}
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;
}
default: {
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 {
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 {
removeEntityData(getBusinessData(businessId).entrancePickup, "vrr.label.help");
removeEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.help");
}
}
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) {
if (getPlayerFirstItemSlotByUseType(client, VRR_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (getPlayerFirstItemSlotByUseType(client, AGRP_ITEM_USE_TYPE_MEGAPHONE) != -1) {
if (isPlayerActiveItemEnabled(client)) {
return true;
}

View File

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

View File

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

View File

@@ -8,9 +8,9 @@
// ===========================================================================
// Discord Webhook Types
const VRR_DISCORD_WEBHOOK_NONE = 0;
const VRR_DISCORD_WEBHOOK_LOG = 1;
const VRR_DISCORD_WEBHOOK_ADMIN = 2;
const AGRP_DISCORD_WEBHOOK_NONE = 0;
const AGRP_DISCORD_WEBHOOK_LOG = 1;
const AGRP_DISCORD_WEBHOOK_ADMIN = 2;
// ===========================================================================
@@ -109,7 +109,7 @@ function messageDiscordChatChannel(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);
triggerDiscordWebHook(messageString, getServerId(), VRR_DISCORD_WEBHOOK_LOG);
triggerDiscordWebHook(messageString, getServerId(), AGRP_DISCORD_WEBHOOK_LOG);
}
// ===========================================================================
@@ -147,12 +147,12 @@ function messageDiscordAdminChannel(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) {
return false;
}

View File

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

View File

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

View File

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

View File

@@ -8,36 +8,36 @@
// ===========================================================================
// GPS State Types
const VRR_GPS_TYPE_NONE = 0; // None (invalid)
const VRR_GPS_TYPE_BUSINESS = 1; // Business
const VRR_GPS_TYPE_POLICE = 2; // Police Station
const VRR_GPS_TYPE_HOSPITAL = 3; // Hospital
const VRR_GPS_TYPE_JOB = 4; // Job
const VRR_GPS_TYPE_GAMELOC = 5; // Game Location
const AGRP_GPS_TYPE_NONE = 0; // None (invalid)
const AGRP_GPS_TYPE_BUSINESS = 1; // Business
const AGRP_GPS_TYPE_POLICE = 2; // Police Station
const AGRP_GPS_TYPE_HOSPITAL = 3; // Hospital
const AGRP_GPS_TYPE_JOB = 4; // Job
const AGRP_GPS_TYPE_GAMELOC = 5; // Game Location
// ===========================================================================
function gpsCommand(command, params, client) {
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderBusinessList")));
let locationType = VRR_GPS_TYPE_NONE;
let useType = VRR_ITEM_USE_TYPE_NONE;
let locationType = AGRP_GPS_TYPE_NONE;
let useType = AGRP_ITEM_USE_TYPE_NONE;
let blipColour = "white";
switch (toLowerCase(params)) {
case "police":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_POLICE;
locationType = AGRP_GPS_TYPE_POLICE;
break;
case "hospital":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_HOSPITAL;
locationType = AGRP_GPS_TYPE_HOSPITAL;
break;
case "job":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_JOB;
locationType = AGRP_GPS_TYPE_JOB;
break;
case "skin":
@@ -45,8 +45,8 @@ function gpsCommand(command, params, client) {
case "clothes":
case "player":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_SKIN;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_SKIN;
break;
case "gun":
@@ -56,29 +56,29 @@ function gpsCommand(command, params, client) {
case "wep":
case "weps":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_WEAPON;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_WEAPON;
break;
case "food":
case "eat":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_FOOD;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_FOOD;
break;
case "drink":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_DRINK;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_DRINK;
break;
case "alcohol":
case "booze":
case "bar":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_ALCOHOL;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_ALCOHOL;
break;
case "repair":
@@ -87,8 +87,8 @@ function gpsCommand(command, params, client) {
case "spray":
case "fix":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_VEHREPAIR;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHREPAIR;
break;
case "vehiclecolour":
@@ -96,14 +96,14 @@ function gpsCommand(command, params, client) {
case "carcolour":
case "colour":
blipColour = "businessBlue"
locationType = VRR_GPS_TYPE_BUSINESS;
useType = VRR_ITEM_USE_TYPE_VEHCOLOUR;
locationType = AGRP_GPS_TYPE_BUSINESS;
useType = AGRP_ITEM_USE_TYPE_VEHCOLOUR;
break;
default: {
let itemTypeId = getItemTypeFromParams(params);
if (getItemTypeData(itemTypeId) != false) {
locationType = VRR_GPS_TYPE_BUSINESS;
locationType = AGRP_GPS_TYPE_BUSINESS;
blipColour = "businessBlue";
useType = getItemTypeData(itemTypeId).useType;
} 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"));
return false;
}
if (locationType == VRR_GPS_TYPE_BUSINESS) {
if (locationType == AGRP_GPS_TYPE_BUSINESS) {
let businessId = getClosestBusinessWithBuyableItemOfUseType(useType);
if (!businessId) {
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");
}
if (locationType == VRR_GPS_TYPE_GAMELOC) {
if (locationType == AGRP_GPS_TYPE_GAMELOC) {
hideAllBlipsForPlayerGPS(client);
blinkGenericGPSBlipForPlayer(client, position, 0, getColourByType(blipColour), 10);
messagePlayerSuccess(client, "Look for the blinking icon on your mini map");

View File

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

View File

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

View File

@@ -10,27 +10,27 @@
// ===========================================================================
function isPlayerHandCuffed(client) {
return (getPlayerData(client).pedState == VRR_PEDSTATE_BINDED);
return (getPlayerData(client).pedState == AGRP_PEDSTATE_BINDED);
}
// ===========================================================================
function handCuffPlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_BINDED;
getPlayerData(client).pedState = AGRP_PEDSTATE_BINDED;
setPlayerControlState(client, false);
}
// ===========================================================================
function unHandCuffPlayer(client) {
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
getPlayerData(client).pedState = AGRP_PEDSTATE_READY;
setPlayerControlState(client, true);
}
// ===========================================================================
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) {
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) {
return i;
}
@@ -30,15 +30,15 @@ function ringPhoneForNearbyPlayers(itemIndex) {
/*
if(isPhoneItemEnabled(itemIndex)) {
switch(getItemData(itemIndex).ownerType) {
case VRR_ITEM_OWNER_GROUND:
case AGRP_ITEM_OWNER_GROUND:
playRingtoneForPlayersInRange(getItemData(itemIndex).position, getItemData(i).extra);
break;
case VRR_ITEM_OWNER_VEHTRUNK:
case AGRP_ITEM_OWNER_VEHTRUNK:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break;
case VRR_ITEM_OWNER_VEHDASH:
case AGRP_ITEM_OWNER_VEHDASH:
playRingtoneForPlayersInRange(getVehiclePosition(getItemData(itemIndex).ownerId), getItemData(i).extra);
break;
}

View File

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

View File

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

View File

@@ -8,7 +8,7 @@
// ===========================================================================
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 (getItemData(getPlayerData(client).hotBarItems[walkieTalkieSlot])) {
@@ -31,7 +31,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
// if(isPlayerSpawned(clients[i])) {
// if(!isSamePlayer(transmittingPlayer, clients[i])) {
// if(getPlayerActiveWalkieTalkieFrequency(clients[i]) == radioFrequency) {
// if(getItemData(getPlayerData(clients[i]).hotBarItems[getPlayerFirstItemSlotByUseType(clients[i], 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);
// }
// }
@@ -42,7 +42,7 @@ function walkieTalkieTransmit(radioFrequency, messageText, transmittingPlayer) {
let items = getServerData().items;
for (let i in items) {
if (items[i].enabled) {
if (getItemTypeData(items[i].itemTypeIndex).useType == VRR_ITEM_USE_TYPE_WALKIETALKIE) {
if (getItemTypeData(items[i].itemTypeIndex).useType == AGRP_ITEM_USE_TYPE_WALKIETALKIE) {
if (items[i].value == radioFrequency) {
walkieTalkieIncomingToNearbyPlayers(null, messageText, getItemPosition(i));
}
@@ -125,7 +125,7 @@ function walkieTalkieChatCommand(command, params, client) {
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) {
messagePlayerError(client, "Please turn on a walkie talkie first!");
return false;

View File

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

View File

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

View File

@@ -9,7 +9,7 @@
// ===========================================================================
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.key = key;
this.account = 0;
@@ -20,7 +20,7 @@ class KeyBindData {
this.index = -1;
this.needsSaved = false;
if(dbAssoc) {
if (dbAssoc) {
this.databaseId = dbAssoc["acct_hotkey_id"];
this.key = toInteger(dbAssoc["acct_hotkey_key"]);
this.account = toInteger(dbAssoc["acct_hotkey_acct"]);
@@ -48,19 +48,19 @@ function addKeyBindCommand(command, params, client) {
let tempCommand = getParam(params, " ", 2);
let tempParams = (splitParams.length > 2) ? splitParams.slice(2).join(" ") : "";
if(!keyId) {
if (!keyId) {
messagePlayerError(client, "The key ID or name you input is invalid!");
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`);
return false;
}
if(!keyId) {
if (!keyId) {
messagePlayerError(client, "That key name/id is invalid!");
return false;
}
if(areParamsEmpty(tempCommand)) {
if (areParamsEmpty(tempCommand)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
@@ -74,14 +74,14 @@ function addKeyBindCommand(command, params, client) {
function removeKeyBindCommand(command, params, client) {
let keyId = getKeyIdFromParams(getParam(params, " ", 1));
if(!keyId) {
if (!keyId) {
messagePlayerError(client, "The key ID or name you input is invalid!");
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`);
return false;
}
if(!keyId) {
if (!keyId) {
messagePlayerError(client, "That key name/id is invalid!");
return false;
}
@@ -94,14 +94,14 @@ function removeKeyBindCommand(command, params, client) {
function addPlayerKeyBind(client, keys, command, params, tempKey = false) {
let keyBindData = new KeyBindData(false, keys, `${command} ${params}`);
if(tempKey == true) {
if (tempKey == true) {
keyBindData.databaseId = -1;
}
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");
logToConsole(LOG_DEBUG, `[VRR.Event] Sending custom enter property key ID (${keyId.key}, ${toUpperCase(getKeyNameFromId(keyId.key))}) to ${getPlayerDisplayForConsole(client)}`);
sendPlayerEnterPropertyKey(client, keyId.key);
@@ -125,7 +125,7 @@ function removePlayerKeyBind(client, keyId) {
getPlayerData(client).keyBinds = getPlayerData(client).keyBinds.filter(keyBind => keyBind.key != keyId);
sendRemoveAccountKeyBindToClient(client, keyId);
if(!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(client, "enter")) {
if (!doesPlayerHaveKeyBindsDisabled(client) && doesPlayerHaveKeyBindForCommand(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)}`);
sendPlayerEnterPropertyKey(client, keyId.key);
@@ -137,8 +137,8 @@ function removePlayerKeyBind(client, keyId) {
// ===========================================================================
function doesPlayerHaveKeyBindForCommand(client, command) {
for(let i in getPlayerData(client).keyBinds) {
if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
for (let i in getPlayerData(client).keyBinds) {
if (toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
return true;
}
}
@@ -148,8 +148,8 @@ function doesPlayerHaveKeyBindForCommand(client, command) {
// ===========================================================================
function getPlayerKeyBindForCommand(client, command) {
for(let i in getPlayerData(client).keyBinds) {
if(toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
for (let i in getPlayerData(client).keyBinds) {
if (toLowerCase(getPlayerData(client).keyBinds[i].commandString.split(" ")[0]) == toLowerCase(command)) {
return getPlayerData(client).keyBinds[i];
}
}
@@ -159,8 +159,8 @@ function getPlayerKeyBindForCommand(client, command) {
// ===========================================================================
function doesPlayerHaveKeyBindForKey(client, key) {
for(let i in getPlayerData(client).keyBinds) {
if(getPlayerData(client).keyBinds[i].key == key) {
for (let i in getPlayerData(client).keyBinds) {
if (getPlayerData(client).keyBinds[i].key == key) {
return true;
}
}
@@ -176,8 +176,8 @@ function doesPlayerHaveKeyBindsDisabled(client) {
// ===========================================================================
function getPlayerKeyBindForKey(client, key) {
for(let i in getPlayerData(client).keyBinds) {
if(getPlayerData(client).keyBinds[i].key == key) {
for (let i in getPlayerData(client).keyBinds) {
if (getPlayerData(client).keyBinds[i].key == key) {
return getPlayerData(client).keyBinds[i];
}
}
@@ -187,22 +187,22 @@ function getPlayerKeyBindForKey(client, key) {
// ===========================================================================
function playerUsedKeyBind(client, key) {
if(!isPlayerLoggedIn(client)) {
if (!isPlayerLoggedIn(client)) {
return false;
}
if(!isPlayerSpawned(client)) {
if (!isPlayerSpawned(client)) {
return false;
}
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);
if(keyBindData.enabled) {
if (keyBindData.enabled) {
let splitCommandString = keyBindData.commandString.split(" ");
let tempCommand = splitCommandString[0];
let tempParams = "";
if(splitCommandString.length > 1) {
if (splitCommandString.length > 1) {
tempParams = splitCommandString.slice(1).join(" ");
}
getCommand(toLowerCase(tempCommand)).handlerFunction(tempCommand, tempParams, client);
@@ -215,7 +215,7 @@ function playerUsedKeyBind(client, key) {
function sendAccountKeyBindsToClient(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);
}
}
@@ -223,13 +223,13 @@ function sendAccountKeyBindsToClient(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);
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderKeyBindsList")));
for(let i in chunkedList) {
for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
}

View File

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

View File

@@ -181,7 +181,7 @@ function getVehicleHeading(vehicle) {
function setVehicleHeading(vehicle, heading) {
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;
}
@@ -255,7 +255,7 @@ function removePlayerFromVehicle(client) {
function setPlayerSkin(client, skinIndex) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
if (getGame() == VRR_GAME_GTA_IV) {
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
}
@@ -547,15 +547,15 @@ function repairVehicle(vehicle) {
// ===========================================================================
function setVehicleLights(vehicle, lights) {
setEntityData(vehicle, "vrr.lights", lights, true);
sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, lights);
setEntityData(vehicle, "agrp.lights", lights, true);
sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
}
// ===========================================================================
function setVehicleEngine(vehicle, 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;
}
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));
}
@@ -707,7 +707,7 @@ function getPlayerElement(client) {
// ===========================================================================
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) {
setEntityData(element, "vrr.interior", interior, true);
setEntityData(element, "agrp.interior", interior, true);
forcePlayerToSyncElementProperties(null, element);
}
// ===========================================================================
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) {
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) {
sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel);
sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel);
return true;
}
@@ -1287,7 +1287,7 @@ function serverBanIP(ip) {
// ===========================================================================
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()) {
destroyElement(client.player);
} else {
sendNetworkEventToPlayer("vrr.deleteLocalPlayerPed", client);
sendNetworkEventToPlayer("agrp.deleteLocalPlayerPed", client);
}
}

View File

@@ -12,7 +12,7 @@ let paintBallItems = [];
// ===========================================================================
let paintBallItemNames = {
[VRR_GAME_GTA_III]: [
[AGRP_GAME_GTA_III]: [
"Colt 45",
"Uzi",
"Shotgun",
@@ -20,7 +20,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[VRR_GAME_GTA_VC]: [
[AGRP_GAME_GTA_VC]: [
"Colt 45",
"Pump Shotgun",
"Ingram",
@@ -29,7 +29,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[VRR_GAME_GTA_SA]: [
[AGRP_GAME_GTA_SA]: [
"Desert Eagle",
"Shotgun",
"MP5",
@@ -37,7 +37,7 @@ let paintBallItemNames = {
"Sniper Rifle",
],
[VRR_GAME_GTA_IV]: [
[AGRP_GAME_GTA_IV]: [
"Glock 9mm",
"Micro Uzi",
"Stubby Shotgun",
@@ -62,7 +62,7 @@ function startPaintBall(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).paintBallBusiness = getPlayerBusiness(client);
@@ -85,7 +85,7 @@ function stopPaintBall(client) {
function givePlayerPaintBallItems(client) {
logToConsole(LOG_DEBUG, `[VRR.PaintBall]: Giving ${getPlayerDisplayForConsole(client)} paintball items ...`);
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).databaseId = -1; // Make sure it doesnt save
let freeSlot = getPlayerFirstEmptyHotBarSlot(client);

View File

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

View File

@@ -880,7 +880,7 @@ function getPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToHeading = getPlayerPosition(targetClient);
getPlayerData(targetClient).returnToDimension = getPlayerDimension(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));
setPlayerHeading(targetClient, getPlayerHeading(client));
@@ -932,7 +932,7 @@ function returnPlayerCommand(command, params, client) {
getPlayerData(targetClient).returnToInterior = null;
getPlayerData(targetClient).returnToHouse = 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.`);
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})`);
//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);
} 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);
//clearPlayerWeapons(client);
//setPlayerSkin(client, skin);
@@ -487,7 +487,7 @@ function selectCharacter(client, characterId = -1) {
//setPlayerInterior(client, spawnInterior);
//setPlayerDimension(client, spawnDimension);
//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]);
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);

View File

@@ -244,7 +244,7 @@ function checkPayDays() {
}
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;
}
}

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1411,7 +1411,7 @@ function getPercentage(num, per) {
// ===========================================================================
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() {
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 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));
y = (pos.y + ((Math.sin(angle + (Math.PI / 2))) * distance));
} else {
@@ -1782,7 +1782,7 @@ function getPosBehindPos(pos, angle, distance) {
let y = pos.y;
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));
} else {
angle = radToDeg(angle);
@@ -2286,7 +2286,7 @@ function ArrayBufferToString(buffer) {
// ===========================================================================
function getElementTypeName(typeId) {
if (getGame() == VRR_GAME_MAFIA_ONE) {
if (getGame() == AGRP_GAME_MAFIA_ONE) {
switch (typeId) {
case ELEMENT_VEHICLE:
return "Vehicle";