Rename all net event prefixes to agrp

This commit is contained in:
Vortrex
2022-06-14 08:53:33 -05:00
parent 48c9af3f52
commit d1b8b9524f
25 changed files with 824 additions and 841 deletions

View File

@@ -109,8 +109,6 @@ function onProcess(event, deltaTime) {
function onKeyUp(event, keyCode, scanCode, keyModifiers) { function onKeyUp(event, keyCode, scanCode, keyModifiers) {
processSkinSelectKeyPress(keyCode); processSkinSelectKeyPress(keyCode);
//processKeyDuringAnimation(); //processKeyDuringAnimation();
processGUIKeyPress(keyCode);
processToggleGUIKeyPress(keyCode);
} }
// =========================================================================== // ===========================================================================
@@ -125,12 +123,8 @@ function onDrawnHUD(event) {
} }
processSmallGameMessageRendering(); processSmallGameMessageRendering();
//processScoreBoardRendering();
processLabelRendering();
//processLogoRendering();
processItemActionRendering(); processItemActionRendering();
processSkinSelectRendering(); processSkinSelectRendering();
//processNameTagRendering();
processInteriorLightsRendering(); processInteriorLightsRendering();
} }
@@ -151,7 +145,7 @@ function onElementStreamIn(event, element) {
function onLocalPlayerExitedVehicle(event, vehicle, seat) { function onLocalPlayerExitedVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`); logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat); sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
if (inVehicleSeat) { if (inVehicleSeat) {
parkedVehiclePosition = false; parkedVehiclePosition = false;
@@ -164,7 +158,7 @@ function onLocalPlayerExitedVehicle(event, vehicle, seat) {
function onLocalPlayerEnteredVehicle(event, vehicle, seat) { function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`); logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat); sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
//if (areServerElementsSupported()) { //if (areServerElementsSupported()) {
//if(inVehicleSeat == 0) { //if(inVehicleSeat == 0) {
@@ -188,7 +182,7 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
if (damagedEntity == localPlayer) { if (damagedEntity == localPlayer) {
//if(!weaponDamageEnabled[damagerEntity.name]) { //if(!weaponDamageEnabled[damagerEntity.name]) {
preventDefaultEventAction(event); preventDefaultEventAction(event);
sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss); sendNetworkEventToServer("agrp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
//} //}
} }
} }

View File

@@ -30,7 +30,7 @@ let renderHotBar = true;
let renderItemActionDelay = true; let renderItemActionDelay = true;
let renderInteriorLights = true; let renderInteriorLights = true;
let logLevel = LOG_INFO|LOG_DEBUG|LOG_VERBOSE; let logLevel = LOG_INFO | LOG_DEBUG | LOG_VERBOSE;
let weaponDamageEnabled = {}; let weaponDamageEnabled = {};
let weaponDamageEvent = {}; let weaponDamageEvent = {};
@@ -48,9 +48,6 @@ let streamingRadio = null;
let streamingRadioVolume = 50; let streamingRadioVolume = 50;
let streamingRadioElement = false; let streamingRadioElement = false;
let enterPropertyKey = null;
let disableGUIKey = getKeyIdFromParams("insert");
let inAnimation = false; let inAnimation = false;
let forcedAnimation = null; let forcedAnimation = null;
@@ -59,8 +56,6 @@ let calledDeathEvent = false;
let interiorLightsEnabled = true; let interiorLightsEnabled = true;
let interiorLightsColour = toColour(0, 0, 0, 150); let interiorLightsColour = toColour(0, 0, 0, 150);
let mouseCameraEnabled = false;
let currentPickup = false; let currentPickup = false;
let vehiclePurchaseState = VRR_VEHBUYSTATE_NONE; let vehiclePurchaseState = VRR_VEHBUYSTATE_NONE;
@@ -69,12 +64,6 @@ let vehiclePurchasePosition = null;
let forceWantedLevel = 0; let forceWantedLevel = 0;
let guiSubmitKey = false;
let guiLeftKey = false;
let guiRightKey = false;
let guiUpKey = false;
let guiDownKey = false;
// Pre-cache all allowed skins // Pre-cache all allowed skins
let allowedSkins = getAllowedSkins(getGame()); let allowedSkins = getAllowedSkins(getGame());

View File

@@ -224,39 +224,39 @@ function repairVehicle(syncId) {
// =========================================================================== // ===========================================================================
function syncVehicleProperties(vehicle) { function syncVehicleProperties(vehicle) {
if (doesEntityDataExist(vehicle, "vrr.lights")) { if (doesEntityDataExist(vehicle, "agrp.lights")) {
let lightStatus = getEntityData(vehicle, "vrr.lights"); let lightStatus = getEntityData(vehicle, "agrp.lights");
vehicle.lights = lightStatus; vehicle.lights = lightStatus;
} }
if (doesEntityDataExist(vehicle, "vrr.invincible")) { if (doesEntityDataExist(vehicle, "agrp.invincible")) {
let invincible = getEntityData(vehicle, "vrr.invincible"); let invincible = getEntityData(vehicle, "agrp.invincible");
element.setProofs(invincible, invincible, invincible, invincible, invincible); element.setProofs(invincible, invincible, invincible, invincible, invincible);
} }
if (doesEntityDataExist(vehicle, "vrr.panelStatus")) { if (doesEntityDataExist(vehicle, "agrp.panelStatus")) {
let panelsStatus = getEntityData(vehicle, "vrr.panelStatus"); let panelsStatus = getEntityData(vehicle, "agrp.panelStatus");
for (let i in panelsStatus) { for (let i in panelsStatus) {
vehicle.setPanelStatus(i, panelsStatus[i]); vehicle.setPanelStatus(i, panelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "vrr.wheelStatus")) { if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) {
let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus"); let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus");
for (let i in wheelsStatus) { for (let i in wheelsStatus) {
vehicle.setWheelStatus(i, wheelsStatus[i]); vehicle.setWheelStatus(i, wheelsStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "vrr.lightStatus")) { if (doesEntityDataExist(vehicle, "agrp.lightStatus")) {
let lightStatus = getEntityData(vehicle, "vrr.lightStatus"); let lightStatus = getEntityData(vehicle, "agrp.lightStatus");
for (let i in lightStatus) { for (let i in lightStatus) {
vehicle.setLightStatus(i, lightStatus[i]); vehicle.setLightStatus(i, lightStatus[i]);
} }
} }
if (doesEntityDataExist(vehicle, "vrr.suspensionHeight")) { if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) {
let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight"); let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight");
vehicle.setSuspensionHeight(suspensionHeight); vehicle.setSuspensionHeight(suspensionHeight);
} }
@@ -266,8 +266,8 @@ function syncVehicleProperties(vehicle) {
vehicle.removeUpgrade(i); vehicle.removeUpgrade(i);
} }
if (doesEntityDataExist(vehicle, "vrr.upgrades")) { if (doesEntityDataExist(vehicle, "agrp.upgrades")) {
let upgrades = getEntityData(vehicle, "vrr.upgrades"); let upgrades = getEntityData(vehicle, "agrp.upgrades");
for (let i in upgrades) { for (let i in upgrades) {
if (upgrades[i] != 0) { if (upgrades[i] != 0) {
vehicle.addUpgrade(upgrades[i]); vehicle.addUpgrade(upgrades[i]);
@@ -277,8 +277,8 @@ function syncVehicleProperties(vehicle) {
} }
if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
if (doesEntityDataExist(vehicle, "vrr.livery")) { if (doesEntityDataExist(vehicle, "agrp.livery")) {
let livery = getEntityData(vehicle, "vrr.livery"); let livery = getEntityData(vehicle, "agrp.livery");
if (getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
vehicle.setPaintJob(livery); vehicle.setPaintJob(livery);
} else if (getGame() == VRR_GAME_GTA_IV) { } else if (getGame() == VRR_GAME_GTA_IV) {
@@ -310,8 +310,8 @@ function doesEntityDataExist(entity, dataName) {
function syncCivilianProperties(civilian) { function syncCivilianProperties(civilian) {
if (getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "vrr.scale")) { if (doesEntityDataExist(civilian, "agrp.scale")) {
let scaleFactor = getEntityData(civilian, "vrr.scale"); let scaleFactor = getEntityData(civilian, "agrp.scale");
let tempMatrix = civilian.matrix; let tempMatrix = civilian.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = civilian.position; let tempPosition = civilian.position;
@@ -322,78 +322,78 @@ function syncCivilianProperties(civilian) {
} }
if (getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
if (doesEntityDataExist(civilian, "vrr.fightStyle")) { if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
let fightStyle = getEntityData(civilian, "vrr.fightStyle"); let fightStyle = getEntityData(civilian, "agrp.fightStyle");
civilian.setFightStyle(fightStyle[0], fightStyle[1]); civilian.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
if (getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if (doesEntityDataExist(civilian, "vrr.walkStyle")) { if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
let walkStyle = getEntityData(civilian, "vrr.walkStyle"); let walkStyle = getEntityData(civilian, "agrp.walkStyle");
civilian.walkStyle = walkStyle; civilian.walkStyle = walkStyle;
} }
} }
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if (doesEntityDataExist(civilian, "vrr.bodyPropHair")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair"); let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropHead")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) {
let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead"); let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead");
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropEyes")) { if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes"); let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes");
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand");
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand"); let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand");
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist");
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropHip")) { if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) {
let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip"); let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip");
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) { if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot");
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) { if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot");
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
if (doesEntityDataExist(civilian, "vrr.anim")) { if (doesEntityDataExist(civilian, "agrp.anim")) {
let animData = getEntityData(vehicle, "vrr.anim"); let animData = getEntityData(vehicle, "agrp.anim");
civilian.addAnimation(animData[0], animData[1]); civilian.addAnimation(animData[0], animData[1]);
} }
} }
@@ -408,8 +408,8 @@ function preventDefaultEventAction(event) {
function syncPlayerProperties(player) { function syncPlayerProperties(player) {
if (getGame() == VRR_GAME_GTA_III) { if (getGame() == VRR_GAME_GTA_III) {
if (doesEntityDataExist(player, "vrr.scale")) { if (doesEntityDataExist(player, "agrp.scale")) {
let scaleFactor = getEntityData(player, "vrr.scale"); let scaleFactor = getEntityData(player, "agrp.scale");
let tempMatrix = player.matrix; let tempMatrix = player.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = player.position; let tempPosition = player.position;
@@ -420,94 +420,94 @@ function syncPlayerProperties(player) {
} }
if (getGame() == VRR_GAME_GTA_SA) { if (getGame() == VRR_GAME_GTA_SA) {
if (doesEntityDataExist(player, "vrr.fightStyle")) { if (doesEntityDataExist(player, "agrp.fightStyle")) {
let fightStyle = getEntityData(player, "vrr.fightStyle"); let fightStyle = getEntityData(player, "agrp.fightStyle");
player.setFightStyle(fightStyle[0], fightStyle[1]); player.setFightStyle(fightStyle[0], fightStyle[1]);
} }
} }
//if(getGame() == VRR_GAME_GTA_SA) { //if(getGame() == VRR_GAME_GTA_SA) {
// if(doesEntityDataExist(player, "vrr.walkStyle")) { // if(doesEntityDataExist(player, "agrp.walkStyle")) {
// let walkStyle = getEntityData(player, "vrr.walkStyle"); // let walkStyle = getEntityData(player, "agrp.walkStyle");
// player.walkStyle = walkStyle; // player.walkStyle = walkStyle;
// } // }
//} //}
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if (doesEntityDataExist(player, "vrr.bodyPartHair")) { if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
let bodyPartHead = getEntityData(player, "vrr.bodyPartHair"); let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]); player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPartHead")) { if (doesEntityDataExist(player, "agrp.bodyPartHead")) {
let bodyPartHead = getEntityData(player, "vrr.bodyPartHead"); let bodyPartHead = getEntityData(player, "agrp.bodyPartHead");
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]); player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPartUpper")) { if (doesEntityDataExist(player, "agrp.bodyPartUpper")) {
let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper"); let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper");
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]); player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPartLower")) { if (doesEntityDataExist(player, "agrp.bodyPartLower")) {
let bodyPartLower = getEntityData(player, "vrr.bodyPartLower"); let bodyPartLower = getEntityData(player, "agrp.bodyPartLower");
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]); player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
} }
} }
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if (doesEntityDataExist(player, "vrr.bodyPropHair")) { if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
let bodyPropHair = getEntityData(player, "vrr.bodyPropHair"); let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]); player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropHead")) { if (doesEntityDataExist(player, "agrp.bodyPropHead")) {
let bodyPropHead = getEntityData(player, "vrr.bodyPropHead"); let bodyPropHead = getEntityData(player, "agrp.bodyPropHead");
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]); player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropEyes")) { if (doesEntityDataExist(player, "agrp.bodyPropEyes")) {
let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes"); let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes");
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]); player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropLeftHand")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) {
let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand"); let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand");
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]); player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropRightHand")) { if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) {
let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand"); let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand");
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]); player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) {
let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist"); let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist");
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]); player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropRightWrist")) { if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist"); let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]); player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropHip")) { if (doesEntityDataExist(player, "agrp.bodyPropHip")) {
let bodyPropHip = getEntityData(player, "vrr.bodyPropHip"); let bodyPropHip = getEntityData(player, "agrp.bodyPropHip");
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]); player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) { if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) {
let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot"); let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot");
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]); player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
} }
if (doesEntityDataExist(player, "vrr.bodyPropRightFoot")) { if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) {
let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot"); let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot");
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]); player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
} }
} }
@@ -517,8 +517,8 @@ function syncPlayerProperties(player) {
function syncObjectProperties(object) { function syncObjectProperties(object) {
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
if (doesEntityDataExist(object, "vrr.scale")) { if (doesEntityDataExist(object, "agrp.scale")) {
let scaleFactor = getEntityData(object, "vrr.scale"); let scaleFactor = getEntityData(object, "agrp.scale");
let tempMatrix = object.matrix; let tempMatrix = object.matrix;
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z)); tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
let tempPosition = object.position; let tempPosition = object.position;
@@ -568,9 +568,9 @@ function getPlayerId(client) {
// =========================================================================== // ===========================================================================
function syncElementProperties(element) { function syncElementProperties(element) {
if (doesEntityDataExist(element, "vrr.interior")) { if (doesEntityDataExist(element, "agrp.interior")) {
if (typeof element.interior != "undefined") { if (typeof element.interior != "undefined") {
element.interior = getEntityData(element, "vrr.interior"); element.interior = getEntityData(element, "agrp.interior");
} }
} }

View File

@@ -20,126 +20,123 @@ function addAllNetworkEventHandlers() {
// Chat history // Chat history
addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible addNetworkEventHandler("m", receiveChatBoxMessageFromServer); // Not prefixed with VRR to make it as small as possible
addNetworkEventHandler("vrr.chatScrollLines", setChatScrollLines); addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines);
addNetworkEventHandler("vrr.chatAutoHideDelay", setChatAutoHideDelay); addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay);
// Messaging (like textdraws and stuff) // Messaging (like textdraws and stuff)
addNetworkEventHandler("vrr.smallGameMessage", showSmallGameMessage); addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage);
// Job // Job
addNetworkEventHandler("vrr.job", receiveJobFromServer); addNetworkEventHandler("agrp.job", receiveJobFromServer);
addNetworkEventHandler("vrr.working", setLocalPlayerWorkingState); addNetworkEventHandler("agrp.working", setLocalPlayerWorkingState);
addNetworkEventHandler("vrr.jobType", setLocalPlayerJobType); addNetworkEventHandler("agrp.jobType", setLocalPlayerJobType);
addNetworkEventHandler("vrr.showJobRouteLocation", showJobRouteLocation); addNetworkEventHandler("agrp.showJobRouteLocation", showJobRouteLocation);
addNetworkEventHandler("vrr.hideJobRouteLocation", hideJobRouteLocation); addNetworkEventHandler("agrp.hideJobRouteLocation", hideJobRouteLocation);
// Local player states and values // Local player states and values
addNetworkEventHandler("vrr.restoreCamera", restoreLocalCamera); addNetworkEventHandler("agrp.restoreCamera", restoreLocalCamera);
addNetworkEventHandler("vrr.cameraLookAt", setLocalCameraLookAt); addNetworkEventHandler("agrp.cameraLookAt", setLocalCameraLookAt);
addNetworkEventHandler("vrr.freeze", setLocalPlayerFrozenState); addNetworkEventHandler("agrp.freeze", setLocalPlayerFrozenState);
addNetworkEventHandler("vrr.control", setLocalPlayerControlState); addNetworkEventHandler("agrp.control", setLocalPlayerControlState);
addNetworkEventHandler("vrr.fadeCamera", fadeLocalCamera); addNetworkEventHandler("agrp.fadeCamera", fadeLocalCamera);
addNetworkEventHandler("vrr.removeFromVehicle", removeLocalPlayerFromVehicle); addNetworkEventHandler("agrp.removeFromVehicle", removeLocalPlayerFromVehicle);
addNetworkEventHandler("vrr.clearWeapons", clearLocalPlayerWeapons); addNetworkEventHandler("agrp.clearWeapons", clearLocalPlayerWeapons);
addNetworkEventHandler("vrr.giveWeapon", giveLocalPlayerWeapon); addNetworkEventHandler("agrp.giveWeapon", giveLocalPlayerWeapon);
addNetworkEventHandler("vrr.position", setLocalPlayerPosition); addNetworkEventHandler("agrp.position", setLocalPlayerPosition);
addNetworkEventHandler("vrr.heading", setLocalPlayerHeading); addNetworkEventHandler("agrp.heading", setLocalPlayerHeading);
addNetworkEventHandler("vrr.interior", setLocalPlayerInterior); addNetworkEventHandler("agrp.interior", setLocalPlayerInterior);
addNetworkEventHandler("vrr.spawned", onServerSpawnedLocalPlayer); addNetworkEventHandler("agrp.spawned", onServerSpawnedLocalPlayer);
addNetworkEventHandler("vrr.money", setLocalPlayerCash); addNetworkEventHandler("agrp.money", setLocalPlayerCash);
addNetworkEventHandler("vrr.armour", setLocalPlayerArmour); addNetworkEventHandler("agrp.armour", setLocalPlayerArmour);
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin); addNetworkEventHandler("agrp.localPlayerSkin", setLocalPlayerSkin);
addNetworkEventHandler("vrr.pedSpeak", makeLocalPlayerPedSpeak); addNetworkEventHandler("agrp.pedSpeak", makeLocalPlayerPedSpeak);
addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun); addNetworkEventHandler("agrp.infiniteRun", setLocalPlayerInfiniteRun);
addNetworkEventHandler("vrr.playerCop", setLocalPlayerAsCopState); addNetworkEventHandler("agrp.playerCop", setLocalPlayerAsCopState);
addNetworkEventHandler("vrr.health", setLocalPlayerHealth); addNetworkEventHandler("agrp.health", setLocalPlayerHealth);
addNetworkEventHandler("vrr.wantedLevel", setLocalPlayerWantedLevel); addNetworkEventHandler("agrp.wantedLevel", setLocalPlayerWantedLevel);
addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer); addNetworkEventHandler("agrp.playerPedId", sendLocalPlayerNetworkIdToServer);
addNetworkEventHandler("vrr.ped", setLocalPlayerPedPartsAndProps); addNetworkEventHandler("agrp.ped", setLocalPlayerPedPartsAndProps);
addNetworkEventHandler("vrr.spawn", serverRequestedLocalPlayerSpawn); addNetworkEventHandler("agrp.spawn", serverRequestedLocalPlayerSpawn);
addNetworkEventHandler("vrr.clearPedState", clearLocalPedState); addNetworkEventHandler("agrp.clearPedState", clearLocalPedState);
addNetworkEventHandler("vrr.drunkEffect", setLocalPlayerDrunkEffect); addNetworkEventHandler("agrp.drunkEffect", setLocalPlayerDrunkEffect);
// Vehicle // Vehicle
addNetworkEventHandler("vrr.vehicle", receiveVehicleFromServer); addNetworkEventHandler("agrp.vehicle", receiveVehicleFromServer);
addNetworkEventHandler("vrr.veh.lights", setVehicleLights); addNetworkEventHandler("agrp.veh.lights", setVehicleLights);
addNetworkEventHandler("vrr.veh.engine", setVehicleEngine); addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
addNetworkEventHandler("vrr.veh.repair", repairVehicle); addNetworkEventHandler("agrp.veh.repair", repairVehicle);
// Radio // Radio
addNetworkEventHandler("vrr.radioStream", playStreamingRadio); addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
addNetworkEventHandler("vrr.audioFileStream", playAudioFile); addNetworkEventHandler("agrp.audioFileStream", playAudioFile);
addNetworkEventHandler("vrr.stopRadioStream", stopStreamingRadio); addNetworkEventHandler("agrp.stopRadioStream", stopStreamingRadio);
addNetworkEventHandler("vrr.radioVolume", setStreamingRadioVolume); addNetworkEventHandler("agrp.radioVolume", setStreamingRadioVolume);
// Key Bindings // Key Bindings
addNetworkEventHandler("vrr.delKeyBind", unBindAccountKey); addNetworkEventHandler("agrp.delKeyBind", unBindAccountKey);
addNetworkEventHandler("vrr.addKeyBind", bindAccountKey); addNetworkEventHandler("agrp.addKeyBind", bindAccountKey);
addNetworkEventHandler("vrr.clearKeyBinds", clearKeyBinds); addNetworkEventHandler("agrp.clearKeyBinds", clearKeyBinds);
// Weapon Damage // Weapon Damage
addNetworkEventHandler("vrr.weaponDamageEnabled", setPlayerWeaponDamageEnabled); addNetworkEventHandler("agrp.weaponDamageEnabled", setPlayerWeaponDamageEnabled);
addNetworkEventHandler("vrr.weaponDamageEvent", setPlayerWeaponDamageEvent); addNetworkEventHandler("agrp.weaponDamageEvent", setPlayerWeaponDamageEvent);
// Business // Business
addNetworkEventHandler("vrr.business", receiveBusinessFromServer); addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
// House // House
addNetworkEventHandler("vrr.house", receiveHouseFromServer); addNetworkEventHandler("agrp.house", receiveHouseFromServer);
// GPS // GPS
addNetworkEventHandler("vrr.showGPSBlip", showGPSLocation); addNetworkEventHandler("agrp.showGPSBlip", showGPSLocation);
// Locale // Locale
addNetworkEventHandler("vrr.locale", setLocale); addNetworkEventHandler("agrp.locale", setLocale);
// Misc // Misc
addNetworkEventHandler("vrr.mouseCursor", toggleMouseCursor); addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
addNetworkEventHandler("vrr.clearPeds", clearLocalPlayerOwnedPeds); addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
addNetworkEventHandler("vrr.passenger", enterVehicleAsPassenger); addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
addNetworkEventHandler("vrr.ambience", setCityAmbienceState); addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
addNetworkEventHandler("vrr.runCode", runClientCode); addNetworkEventHandler("agrp.runCode", runClientCode);
addNetworkEventHandler("vrr.minuteDuration", setMinuteDuration); addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
addNetworkEventHandler("vrr.snow", setSnowState); addNetworkEventHandler("agrp.snow", setSnowState);
addNetworkEventHandler("vrr.enterPropertyKey", setEnterPropertyKey); addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
addNetworkEventHandler("vrr.skinSelect", toggleSkinSelect); addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
addNetworkEventHandler("vrr.hotbar", updatePlayerHotBar); addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
addNetworkEventHandler("vrr.showItemActionDelay", showItemActionDelay); addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
addNetworkEventHandler("vrr.set2DRendering", set2DRendering); addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
addNetworkEventHandler("vrr.mouseCameraForce", setMouseCameraState); addNetworkEventHandler("agrp.logLevel", setLogLevel);
addNetworkEventHandler("vrr.logLevel", setLogLevel); addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI); addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
addNetworkEventHandler("vrr.anim", makePedPlayAnimation); addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
addNetworkEventHandler("vrr.stopAnim", makePedStopAnimation); addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("vrr.forceAnim", forcePedAnimation); addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior);
addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState); addNetworkEventHandler("agrp.syncElement", forceSyncElementProperties);
addNetworkEventHandler("vrr.cutsceneInterior", setCutsceneInterior); addNetworkEventHandler("agrp.elementPosition", setElementPosition);
addNetworkEventHandler("vrr.syncElement", forceSyncElementProperties); addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
addNetworkEventHandler("vrr.elementPosition", setElementPosition); addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
addNetworkEventHandler("vrr.elementCollisions", setElementCollisionsEnabled); addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
addNetworkEventHandler("vrr.vehBuyState", setVehiclePurchaseState);
addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
} }
// =========================================================================== // ===========================================================================
function sendResourceReadySignalToServer() { function sendResourceReadySignalToServer() {
sendNetworkEventToServer("vrr.clientReady"); sendNetworkEventToServer("agrp.clientReady");
} }
// =========================================================================== // ===========================================================================
function sendResourceStartedSignalToServer() { function sendResourceStartedSignalToServer() {
sendNetworkEventToServer("vrr.clientStarted"); sendNetworkEventToServer("agrp.clientStarted");
} }
// =========================================================================== // ===========================================================================
function sendResourceStoppedSignalToServer() { function sendResourceStoppedSignalToServer() {
if (isConnected) { if (isConnected) {
sendNetworkEventToServer("vrr.clientStopped"); sendNetworkEventToServer("agrp.clientStopped");
} }
} }
@@ -196,19 +193,19 @@ function onServerSpawnedLocalPlayer(state) {
// =========================================================================== // ===========================================================================
function tellServerPlayerUsedKeyBind(key) { function tellServerPlayerUsedKeyBind(key) {
sendNetworkEventToServer("vrr.useKeyBind", key); sendNetworkEventToServer("agrp.useKeyBind", key);
} }
// =========================================================================== // ===========================================================================
function tellServerPlayerArrivedAtJobRouteLocation() { function tellServerPlayerArrivedAtJobRouteLocation() {
sendNetworkEventToServer("vrr.arrivedAtJobRouteLocation"); sendNetworkEventToServer("agrp.arrivedAtJobRouteLocation");
} }
// =========================================================================== // ===========================================================================
function tellServerItemActionDelayComplete() { function tellServerItemActionDelayComplete() {
sendNetworkEventToServer("vrr.itemActionDelayComplete"); sendNetworkEventToServer("agrp.itemActionDelayComplete");
} }
// =========================================================================== // ===========================================================================
@@ -218,13 +215,13 @@ function sendServerClientInfo() {
if (typeof CLIENT_VERSION_MAJOR != "undefined") { if (typeof CLIENT_VERSION_MAJOR != "undefined") {
clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`; clientVersion = `${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_PATCH}.${CLIENT_VERSION_BUILD}`;
} }
sendNetworkEventToServer("vrr.clientInfo", clientVersion, game.width, game.height); sendNetworkEventToServer("agrp.clientInfo", clientVersion, game.width, game.height);
} }
// =========================================================================== // ===========================================================================
function sendServerNewAFKStatus(state) { function sendServerNewAFKStatus(state) {
sendNetworkEventToServer("vrr.afk", state); sendNetworkEventToServer("agrp.afk", state);
} }
// =========================================================================== // ===========================================================================
@@ -323,7 +320,7 @@ function makePedHoldObject(pedId, modelIndex) {
// =========================================================================== // ===========================================================================
function sendLocalPlayerNetworkIdToServer() { function sendLocalPlayerNetworkIdToServer() {
sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer)); sendNetworkEventToServer("agrp.playerPedId", natives.getNetworkIdFromPed(localPlayer));
} }
// =========================================================================== // ===========================================================================
@@ -382,7 +379,7 @@ function serverRequestedLocalPlayerSpawn(skinId, position) {
// =========================================================================== // ===========================================================================
function sendLocaleSelectToServer(localeId) { function sendLocaleSelectToServer(localeId) {
sendNetworkEventToServer("vrr.localeSelect", localeId); sendNetworkEventToServer("agrp.localeSelect", localeId);
} }
// =========================================================================== // ===========================================================================

View File

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

View File

@@ -44,53 +44,53 @@ function loadSkinSelectMessageFontBottom() {
// =========================================================================== // ===========================================================================
function processSkinSelectKeyPress(keyCode) { function processSkinSelectKeyPress(keyCode) {
if(usingSkinSelector) { if (usingSkinSelector) {
if(keyCode == SDLK_PAGEUP) { if (keyCode == SDLK_PAGEUP) {
if(skinSelectorIndex >= allowedSkins.length-1) { if (skinSelectorIndex >= allowedSkins.length - 1) {
skinSelectorIndex = 1; skinSelectorIndex = 1;
} else { } else {
skinSelectorIndex = skinSelectorIndex + 1; skinSelectorIndex = skinSelectorIndex + 1;
} }
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0]; let skinId = allowedSkins[skinSelectorIndex][0];
if(natives.isModelInCdimage(skinId)) { if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId); natives.requestModel(skinId);
natives.loadAllObjectsNow(); natives.loadAllObjectsNow();
if(natives.hasModelLoaded(skinId)) { if (natives.hasModelLoaded(skinId)) {
natives.changePlayerModel(natives.getPlayerId(), skinId); natives.changePlayerModel(natives.getPlayerId(), skinId);
} }
} }
} else { } else {
localPlayer.skin = allowedSkins[skinSelectorIndex][0]; localPlayer.skin = allowedSkins[skinSelectorIndex][0];
} }
} else if(keyCode == SDLK_PAGEDOWN) { } else if (keyCode == SDLK_PAGEDOWN) {
if(skinSelectorIndex <= 0) { if (skinSelectorIndex <= 0) {
skinSelectorIndex = allowedSkins.length-1; skinSelectorIndex = allowedSkins.length - 1;
} else { } else {
skinSelectorIndex = skinSelectorIndex - 1; skinSelectorIndex = skinSelectorIndex - 1;
} }
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`); logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0]; let skinId = allowedSkins[skinSelectorIndex][0];
if(natives.isModelInCdimage(skinId)) { if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId); natives.requestModel(skinId);
natives.loadAllObjectsNow(); natives.loadAllObjectsNow();
if(natives.hasModelLoaded(skinId)) { if (natives.hasModelLoaded(skinId)) {
natives.changePlayerModel(natives.getPlayerId(), skinId); natives.changePlayerModel(natives.getPlayerId(), skinId);
} }
} }
} else { } else {
localPlayer.skin = allowedSkins[skinSelectorIndex][0]; localPlayer.skin = allowedSkins[skinSelectorIndex][0];
} }
} else if(keyCode == SDLK_RETURN) { } else if (keyCode == SDLK_RETURN) {
sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex); sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex);
toggleSkinSelect(false); toggleSkinSelect(false);
return true; return true;
} else if(keyCode == SDLK_BACKSPACE) { } else if (keyCode == SDLK_BACKSPACE) {
sendNetworkEventToServer("vrr.skinSelected", -1); sendNetworkEventToServer("agrp.skinSelected", -1);
toggleSkinSelect(false); toggleSkinSelect(false);
return true; return true;
} }
@@ -101,11 +101,11 @@ function processSkinSelectKeyPress(keyCode) {
// =========================================================================== // ===========================================================================
function processSkinSelectRendering() { function processSkinSelectRendering() {
if(usingSkinSelector) { if (usingSkinSelector) {
if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) { if (skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") { if (skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true); skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height - 100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true); skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height - 65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
} }
} }
} }
@@ -114,9 +114,9 @@ function processSkinSelectRendering() {
// =========================================================================== // ===========================================================================
function toggleSkinSelect(state) { function toggleSkinSelect(state) {
if(state) { if (state) {
skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin); skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
if(!skinSelectorIndex) { if (!skinSelectorIndex) {
skinSelectorIndex = 0; skinSelectorIndex = 0;
} }
@@ -124,19 +124,19 @@ function toggleSkinSelect(state) {
skinSelectPosition = localPlayer.position; skinSelectPosition = localPlayer.position;
skinSelectHeading = localPlayer.heading; skinSelectHeading = localPlayer.heading;
if(isCustomCameraSupported()) { if (isCustomCameraSupported()) {
let tempPosition = localPlayer.position; let tempPosition = localPlayer.position;
tempPosition.z += 0.5; tempPosition.z += 0.5;
let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3); let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true); game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
} }
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
let skinId = allowedSkins[skinSelectorIndex][0]; let skinId = allowedSkins[skinSelectorIndex][0];
if(natives.isModelInCdimage(skinId)) { if (natives.isModelInCdimage(skinId)) {
natives.requestModel(skinId); natives.requestModel(skinId);
natives.loadAllObjectsNow(); natives.loadAllObjectsNow();
if(natives.hasModelLoaded(skinId)) { if (natives.hasModelLoaded(skinId)) {
natives.changePlayerModel(natives.getPlayerId(), skinId); natives.changePlayerModel(natives.getPlayerId(), skinId);
} }
} }

View File

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

View File

@@ -95,7 +95,7 @@ function runClientCode(code, returnTo) {
try { try {
returnValue = eval("(" + code + ")"); returnValue = eval("(" + code + ")");
} catch (error) { } catch (error) {
sendNetworkEventToServer("vrr.runCodeFail", returnTo, error.toString()); sendNetworkEventToServer("agrp.runCodeFail", returnTo, error.toString());
return false; return false;
} }
let returnValueString = returnValue; let returnValueString = returnValue;
@@ -104,7 +104,7 @@ function runClientCode(code, returnTo) {
} else { } else {
returnValueString = "null/undefined"; returnValueString = "null/undefined";
} }
sendNetworkEventToServer("vrr.runCodeSuccess", returnTo, returnValueString); sendNetworkEventToServer("agrp.runCodeSuccess", returnTo, returnValueString);
} }
// =========================================================================== // ===========================================================================
@@ -211,8 +211,8 @@ function setLocalPlayerInterior(interior) {
if (areServerElementsSupported() && isGameFeatureSupported("interior")) { if (areServerElementsSupported() && isGameFeatureSupported("interior")) {
let vehicles = getElementsByType(ELEMENT_VEHICLE); let vehicles = getElementsByType(ELEMENT_VEHICLE);
for (let i in vehicles) { for (let i in vehicles) {
if (getEntityData(vehicles[i], "vrr.interior")) { if (getEntityData(vehicles[i], "agrp.interior")) {
vehicles[i].interior = getEntityData(vehicles[i], "vrr.interior"); vehicles[i].interior = getEntityData(vehicles[i], "agrp.interior");
} }
} }
} }
@@ -310,14 +310,6 @@ function clearSelfOwnedVehicles() {
// =========================================================================== // ===========================================================================
function setMouseCameraState(state) {
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(state) ? "Enabled" : "Disabled"} mouse camera`);
mouseCameraEnabled = state;
SetStandardControlsEnabled(!mouseCameraEnabled);
}
// ===========================================================================
function toggleMouseCursor() { function toggleMouseCursor() {
logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`); logToConsole(LOG_DEBUG, `[VRR.Utilities] ${(!gui.cursorEnabled) ? "Enabled" : "Disabled"} mouse cursor`);
gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled); gui.showCursor(!gui.cursorEnabled, gui.cursorEnabled);
@@ -406,8 +398,8 @@ function processWantedLevelReset() {
function processLocalPlayerVehicleControlState() { function processLocalPlayerVehicleControlState() {
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
if (inVehicle && localPlayer.vehicle != null) { if (inVehicle && localPlayer.vehicle != null) {
if (doesEntityDataExist(localPlayer.vehicle, "vrr.engine")) { if (doesEntityDataExist(localPlayer.vehicle, "agrp.engine")) {
if (getEntityData(localPlayer.vehicle, "vrr.engine") == false) { if (getEntityData(localPlayer.vehicle, "agrp.engine") == false) {
localPlayer.vehicle.engine = false; localPlayer.vehicle.engine = false;
if (!localPlayer.vehicle.engine) { if (!localPlayer.vehicle.engine) {
if (typeof localPlayer.vehicle.velocity != "undefined") { if (typeof localPlayer.vehicle.velocity != "undefined") {
@@ -590,7 +582,7 @@ function processNearbyPickups() {
//if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) { //if(pickups[i].interior == localPlayer.interior && pickups[i].dimension == localPlayer.dimension) {
if (currentPickup != pickups[i]) { if (currentPickup != pickups[i]) {
currentPickup = pickups[i]; currentPickup = pickups[i];
sendNetworkEventToServer("vrr.pickup", pickups[i].id); sendNetworkEventToServer("agrp.pickup", pickups[i].id);
} }
//} //}
} }

View File

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

View File

@@ -1374,7 +1374,7 @@ function initClient(client) {
return false; return false;
} }
setEntityData(client, "vrr.isInitialized", true, false); setEntityData(client, "agrp.isInitialized", true, false);
sendPlayerGUIColours(client); sendPlayerGUIColours(client);

View File

@@ -15,7 +15,7 @@ function initAnimationScript() {
// =========================================================================== // ===========================================================================
function playPlayerAnimationCommand(command, params, client) { function playPlayerAnimationCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
@@ -23,22 +23,22 @@ function playPlayerAnimationCommand(command, params, client) {
let animationSlot = getAnimationFromParams(getParam(params, " ", 1)); let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
let animationPositionOffset = 1; let animationPositionOffset = 1;
if(!animationSlot) { if (!animationSlot) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimation")); messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`)); messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`));
return false; return false;
} }
if(toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) { if (toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance")); messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
return false; return false;
} }
if(getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) { if (getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP; getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP;
} }
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) { if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
messagePlayerError(client, getLocaleString(client, "UnableToDoThat")); messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false; return false;
} }
@@ -50,7 +50,7 @@ function playPlayerAnimationCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function stopPlayerAnimationCommand(command, params, client) { function stopPlayerAnimationCommand(command, params, client) {
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) { if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
messagePlayerError(client, getLocaleString(client, "UnableToDoThat")); messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false; return false;
} }
@@ -70,13 +70,13 @@ function stopPlayerAnimationCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function showAnimationListCommand(command, params, client) { function showAnimationListCommand(command, params, client) {
let animList = getGameConfig().animations[getGame()].map(function(x) { return x.name; }); let animList = getGameConfig().animations[getGame()].map(function (x) { return x.name; });
let chunkedList = splitArrayIntoChunks(animList, 10); let chunkedList = splitArrayIntoChunks(animList, 10);
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList"))); messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
for(let i in chunkedList) { for (let i in chunkedList) {
messagePlayerNormal(client, chunkedList[i].join(", ")); messagePlayerNormal(client, chunkedList[i].join(", "));
} }
} }
@@ -107,7 +107,7 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
getPlayerData(client).animationForced = false; getPlayerData(client).animationForced = false;
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition); makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
setEntityData(getPlayerPed(client), "vrr.anim", animationSlot, true); setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) { //if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
// if(getGame() < VRR_GAME_GTA_SA) { // if(getGame() < VRR_GAME_GTA_SA) {
// setPlayerMouseCameraState(client, true); // setPlayerMouseCameraState(client, true);
@@ -145,14 +145,14 @@ function makePlayerStopAnimation(client) {
function getAnimationFromParams(params) { function getAnimationFromParams(params) {
let animations = getGameConfig().animations[getGame()]; let animations = getGameConfig().animations[getGame()];
if(isNaN(params)) { if (isNaN(params)) {
for(let i in animations) { for (let i in animations) {
if(toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) { if (toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) {
return i; return i;
} }
} }
} else { } else {
if(typeof getGameConfig().animations[getGame()][params] != "undefined") { if (typeof getGameConfig().animations[getGame()][params] != "undefined") {
return toInteger(params); return toInteger(params);
} }
} }

View File

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

View File

@@ -271,7 +271,7 @@ async function onPlayerEnteredVehicle(client, clientVehicle, seat) {
return false; return false;
} }
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} entered a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
getPlayerData(client).lastVehicle = vehicle; getPlayerData(client).lastVehicle = vehicle;
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
@@ -385,7 +385,7 @@ function onPlayerExitedVehicle(client, vehicle) {
getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp(); getVehicleData(vehicle).lastActiveTime = getCurrentUnixTimestamp();
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("vrr.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`); logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)} exited a ${getVehicleName(vehicle)} (ID: ${vehicle.getData("agrp.dataSlot")}, Database ID: ${getVehicleData(vehicle).databaseId})`);
} }
// =========================================================================== // ===========================================================================
@@ -395,6 +395,7 @@ function onPlayerDeath(client, position) {
getPlayerData(client).pedState = VRR_PEDSTATE_DEAD; getPlayerData(client).pedState = VRR_PEDSTATE_DEAD;
updatePlayerSpawnedState(client, false); updatePlayerSpawnedState(client, false);
setPlayerControlState(client, false); setPlayerControlState(client, false);
setPlayerRenderLabelsState(client, false);
setTimeout(function () { setTimeout(function () {
if (isFadeCameraSupported()) { if (isFadeCameraSupported()) {
fadeCamera(client, false, 1.0); fadeCamera(client, false, 1.0);
@@ -423,6 +424,7 @@ function onPlayerDeath(client, position) {
makePlayerStopAnimation(client); makePlayerStopAnimation(client);
setPlayerControlState(client, true); setPlayerControlState(client, true);
resetPlayerBlip(client); resetPlayerBlip(client);
setPlayerRenderLabelsState(client, true);
} else { } else {
let closestHospital = getClosestHospital(getPlayerPosition(client)); let closestHospital = getClosestHospital(getPlayerPosition(client));
despawnPlayer(client); despawnPlayer(client);
@@ -447,6 +449,7 @@ function onPlayerDeath(client, position) {
makePlayerStopAnimation(client); makePlayerStopAnimation(client);
setPlayerControlState(client, true); setPlayerControlState(client, true);
resetPlayerBlip(client); resetPlayerBlip(client);
setPlayerRenderLabelsState(client, true);
} }
}, 2000); }, 2000);
}, 1000); }, 1000);
@@ -515,12 +518,12 @@ async function onPlayerSpawn(client) {
if (getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped body parts and props`); logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped body parts and props`);
setEntityData(getPlayerPed(client), "vrr.bodyParts", getPlayerCurrentSubAccount(client).bodyParts, true); setEntityData(getPlayerPed(client), "agrp.bodyParts", getPlayerCurrentSubAccount(client).bodyParts, true);
setEntityData(getPlayerPed(client), "vrr.bodyProps", getPlayerCurrentSubAccount(client).bodyProps, true); setEntityData(getPlayerPed(client), "agrp.bodyProps", getPlayerCurrentSubAccount(client).bodyProps, true);
} }
logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`); logToConsole(LOG_DEBUG, `[VRR.Event] Setting ${getPlayerDisplayForConsole(client)}'s ped scale (${getPlayerCurrentSubAccount(client).pedScale})`);
setEntityData(getPlayerPed(client), "vrr.scale", getPlayerCurrentSubAccount(client).pedScale, true); setEntityData(getPlayerPed(client), "agrp.scale", getPlayerCurrentSubAccount(client).pedScale, true);
if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) { if (isPlayerSwitchingCharacter(client) || isPlayerCreatingCharacter(client)) {
logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`); logToConsole(LOG_DEBUG, `[VRR.Event] ${getPlayerDisplayForConsole(client)}'s ped is being used for character selection/creation. No further spawn processing needed'`);
@@ -576,7 +579,7 @@ async function onPlayerSpawn(client) {
if (areServerElementsSupported() && getGame() == VRR_GAME_GTA_SA) { if (areServerElementsSupported() && getGame() == VRR_GAME_GTA_SA) {
logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Event] Setting player walk and fightstyle for ${getPlayerDisplayForConsole(client)}`);
setEntityData(getPlayerPed(client), "vrr.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true); setEntityData(getPlayerPed(client), "agrp.walkStyle", getPlayerCurrentSubAccount(client).walkStyle, true);
setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle); setPlayerFightStyle(client, getPlayerCurrentSubAccount(client).fightStyle);
} }
@@ -602,20 +605,20 @@ async function onPlayerSpawn(client) {
} }
//if(isGTAIV()) { //if(isGTAIV()) {
// setEntityData(getPlayerPed(client), "vrr.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartHair", getPlayerCurrentSubAccount(client).bodyParts.hair, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyParts.head, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartUpper", getPlayerCurrentSubAccount(client).bodyParts.upper, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartLower", getPlayerCurrentSubAccount(client).bodyParts.lower, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true); // setEntityData(getPlayerPed(client), "agrp.bodyPropHair", getPlayerCurrentSubAccount(client).bodyProps.hair, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true); // setEntityData(getPlayerPed(client), "agrp.bodyPropEyes", getPlayerCurrentSubAccount(client).bodyProps.eyes, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartHead", getPlayerCurrentSubAccount(client).bodyProps.head, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftHand", getPlayerCurrentSubAccount(client).bodyProps.leftHand, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartRightHand", getPlayerCurrentSubAccount(client).bodyProps.rightHand, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftWrist", getPlayerCurrentSubAccount(client).bodyProps.leftWrist, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartRightWrist", getPlayerCurrentSubAccount(client).bodyProps.rightWrist, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartHip", getPlayerCurrentSubAccount(client).bodyProps.hip, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartLeftFoot", getPlayerCurrentSubAccount(client).bodyProps.leftFoot, true);
// setEntityData(getPlayerPed(client), "vrr.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true); // setEntityData(getPlayerPed(client), "agrp.bodyPartRightFoot", getPlayerCurrentSubAccount(client).bodyProps.rightFoot, true);
//} //}
if (isGTAIV()) { if (isGTAIV()) {
@@ -659,6 +662,8 @@ async function onPlayerSpawn(client) {
// Stop playing intro music and any other radio // Stop playing intro music and any other radio
stopRadioStreamForPlayer(client); stopRadioStreamForPlayer(client);
setPlayerRenderLabelsState(client, true);
// Start playing business/house radio if in one // Start playing business/house radio if in one
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
let houseId = getPlayerHouse(client); let houseId = getPlayerHouse(client);

View File

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

View File

@@ -27,7 +27,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
/** /**
* @class Representing a house's data. Loaded and saved in the database * @class Representing a house's data. Loaded and saved in the database
*/ */
class HouseData { class HouseData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0 this.databaseId = 0
this.description = ""; this.description = "";
@@ -66,7 +66,7 @@ const VRR_HOUSEOWNER_PUBLIC = 5; // Is a public house. Technical
this.streamingRadioStation = -1; this.streamingRadioStation = -1;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_id"]); this.databaseId = toInteger(dbAssoc["house_id"]);
this.description = toString(dbAssoc["house_description"]); this.description = toString(dbAssoc["house_description"]);
this.ownerType = toInteger(dbAssoc["house_owner_type"]); this.ownerType = toInteger(dbAssoc["house_owner_type"]);
@@ -115,7 +115,7 @@ class HouseLocationData {
this.interior = 0; this.interior = 0;
this.dimension = 0; this.dimension = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_loc_id"]); this.databaseId = toInteger(dbAssoc["house_loc_id"]);
this.name = toString(dbAssoc["house_loc_name"]); this.name = toString(dbAssoc["house_loc_name"]);
this.type = toInteger(dbAssoc["house_loc_type"]); this.type = toInteger(dbAssoc["house_loc_type"]);
@@ -149,7 +149,7 @@ class HouseGameScriptData {
this.houseIndex = -1; this.houseIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_script_id"]); this.databaseId = toInteger(dbAssoc["house_script_id"]);
this.name = toString(dbAssoc["house_script_name"]); this.name = toString(dbAssoc["house_script_name"]);
this.state = toInteger(dbAssoc["house_script_state"]); this.state = toInteger(dbAssoc["house_script_state"]);
@@ -264,7 +264,7 @@ function setHouseDescriptionCommand(command, params, client) {
let oldDescription = getHouseData(houseId).description; let oldDescription = getHouseData(houseId).description;
getHouseData(houseId).description = newHouseDescription; getHouseData(houseId).description = newHouseDescription;
setEntityData(getHouseData(houseId).entrancePickup, "vrr.label.name", getHouseData(houseId).description, true); setEntityData(getHouseData(houseId).entrancePickup, "agrp.label.name", getHouseData(houseId).description, true);
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
@@ -1098,8 +1098,8 @@ function createHouseEntranceBlip(houseId) {
setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(entranceBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setEntityData(entranceBlip, "vrr.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false); setEntityData(entranceBlip, "agrp.owner.type", VRR_BLIP_HOUSE_ENTRANCE, false);
setEntityData(entranceBlip, "vrr.owner.id", houseId, false); setEntityData(entranceBlip, "agrp.owner.id", houseId, false);
houseData.entranceBlip = entranceBlip; houseData.entranceBlip = entranceBlip;
} }
@@ -1204,8 +1204,8 @@ function createHouseExitBlip(houseId) {
setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance); setElementStreamOutDistance(exitBlip, getGlobalConfig().houseBlipStreamOutDistance);
} }
setElementTransient(exitBlip, false); setElementTransient(exitBlip, false);
setEntityData(exitBlip, "vrr.owner.type", VRR_BLIP_HOUSE_EXIT, false); setEntityData(exitBlip, "agrp.owner.type", VRR_BLIP_HOUSE_EXIT, false);
setEntityData(exitBlip, "vrr.owner.id", houseId, false); setEntityData(exitBlip, "agrp.owner.id", houseId, false);
getHouseData(houseId).exitBlip = exitBlip; getHouseData(houseId).exitBlip = exitBlip;
} }
} }
@@ -1747,26 +1747,26 @@ function updateHousePickupLabelData(houseId) {
let houseData = getHouseData(houseId); let houseData = getHouseData(houseId);
if (houseData.entrancePickup != null) { if (houseData.entrancePickup != null) {
setEntityData(houseData.entrancePickup, "vrr.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false); setEntityData(houseData.entrancePickup, "agrp.owner.type", VRR_PICKUP_HOUSE_ENTRANCE, false);
setEntityData(houseData.entrancePickup, "vrr.owner.id", houseId, false); setEntityData(houseData.entrancePickup, "agrp.owner.id", houseId, false);
setEntityData(houseData.entrancePickup, "vrr.label.type", VRR_LABEL_HOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.type", VRR_LABEL_HOUSE, true);
setEntityData(houseData.entrancePickup, "vrr.label.name", houseData.description, true); setEntityData(houseData.entrancePickup, "agrp.label.name", houseData.description, true);
setEntityData(houseData.entrancePickup, "vrr.label.locked", houseData.locked, true); setEntityData(houseData.entrancePickup, "agrp.label.locked", houseData.locked, true);
if (houseData.buyPrice > 0) { if (houseData.buyPrice > 0) {
setEntityData(houseData.entrancePickup, "vrr.label.price", houseData.buyPrice, true); setEntityData(houseData.entrancePickup, "agrp.label.price", houseData.buyPrice, true);
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_BUYHOUSE, true);
} else { } else {
if (houseData.rentPrice > 0) { if (houseData.rentPrice > 0) {
setEntityData(houseData.entrancePickup, "vrr.label.rentprice", houseData.rentPrice, true); setEntityData(houseData.entrancePickup, "agrp.label.rentprice", houseData.rentPrice, true);
setEntityData(houseData.entrancePickup, "vrr.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true); setEntityData(houseData.entrancePickup, "agrp.label.help", VRR_PROPLABEL_INFO_RENTHOUSE, true);
} }
} }
} }
if (houseData.exitPickup != null) { if (houseData.exitPickup != null) {
setEntityData(houseData.exitPickup, "vrr.owner.type", VRR_PICKUP_HOUSE_EXIT, false); setEntityData(houseData.exitPickup, "agrp.owner.type", VRR_PICKUP_HOUSE_EXIT, false);
setEntityData(houseData.exitPickup, "vrr.owner.id", houseId, false); setEntityData(houseData.exitPickup, "agrp.owner.id", houseId, false);
setEntityData(houseData.exitPickup, "vrr.label.type", VRR_LABEL_EXIT, true); setEntityData(houseData.exitPickup, "agrp.label.type", VRR_LABEL_EXIT, true);
} }
} }

View File

@@ -123,7 +123,7 @@ class ItemData {
this.enabled = false; this.enabled = false;
this.extra = false; this.extra = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["item_id"]); this.databaseId = toInteger(dbAssoc["item_id"]);
this.index = 0; this.index = 0;
this.itemTypeIndex = 0; this.itemTypeIndex = 0;
@@ -188,7 +188,7 @@ class ItemTypeData {
this.takeAnimationIndex = false; this.takeAnimationIndex = false;
this.switchAnimationIndex = false; this.switchAnimationIndex = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["item_type_id"]); this.databaseId = toInteger(dbAssoc["item_type_id"]);
this.serverId = toInteger(dbAssoc["item_type_server"]); this.serverId = toInteger(dbAssoc["item_type_server"]);
this.name = dbAssoc["item_type_name"]; this.name = dbAssoc["item_type_name"];
@@ -325,7 +325,7 @@ function createGroundItemObject(itemId) {
setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation); setElementRotation(getItemData(itemId).object, getItemTypeData(getItemData(itemId).itemTypeIndex).dropRotation);
setElementOnAllDimensions(getItemData(itemId).object, false); setElementOnAllDimensions(getItemData(itemId).object, false);
setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension); setElementDimension(getItemData(itemId).object, getItemData(itemId).dimension);
//setEntityData(getItemData(itemId).object, "vrr.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true); //setEntityData(getItemData(itemId).object, "agrp.scale", getItemTypeData(getItemData(itemId).itemTypeIndex).dropScale, true);
addToWorld(getItemData(itemId).object); addToWorld(getItemData(itemId).object);
} }

View File

@@ -34,7 +34,7 @@ const VRR_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that fre
/** /**
* @class Representing a job's data. Loaded and saved in the database * @class Representing a job's data. Loaded and saved in the database
*/ */
class JobData { class JobData {
constructor(dbAssoc = false) { constructor(dbAssoc = false) {
this.databaseId = 0; this.databaseId = 0;
this.serverId = 0; this.serverId = 0;
@@ -57,7 +57,7 @@ const VRR_JOBROUTESTATE_ATSTOP = 4; // For bus/trash stops that fre
this.blackList = []; this.blackList = [];
this.routes = []; this.routes = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_id"]; this.databaseId = dbAssoc["job_id"];
this.serverId = dbAssoc["job_server"]; this.serverId = dbAssoc["job_server"];
this.type = dbAssoc["job_type"]; this.type = dbAssoc["job_type"];
@@ -103,7 +103,7 @@ class JobRouteData {
this.locationNextMessage = ""; this.locationNextMessage = "";
this.locations = []; this.locations = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["job_route_id"]); this.databaseId = toInteger(dbAssoc["job_route_id"]);
this.name = toString(dbAssoc["job_route_name"]); this.name = toString(dbAssoc["job_route_name"]);
this.jobId = toInteger(dbAssoc["job_route_job"]); this.jobId = toInteger(dbAssoc["job_route_job"]);
@@ -137,7 +137,7 @@ class JobRouteLocationData {
this.stopDelay = 0; this.stopDelay = 0;
this.pay = 0; this.pay = 0;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["job_route_loc_id"]); this.databaseId = toInteger(dbAssoc["job_route_loc_id"]);
this.name = toString(dbAssoc["job_route_loc_name"]); this.name = toString(dbAssoc["job_route_loc_name"]);
this.routeId = toInteger(dbAssoc["job_route_loc_route"]); this.routeId = toInteger(dbAssoc["job_route_loc_route"]);
@@ -166,7 +166,7 @@ class JobEquipmentData {
this.needsSaved = false; this.needsSaved = false;
this.items = []; this.items = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_equip_id"]; this.databaseId = dbAssoc["job_equip_id"];
this.job = dbAssoc["job_equip_job"]; this.job = dbAssoc["job_equip_job"];
this.name = dbAssoc["job_equip_name"]; this.name = dbAssoc["job_equip_name"];
@@ -192,7 +192,7 @@ class JobEquipmentItemData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_equip_item_id"]; this.databaseId = dbAssoc["job_equip_item_id"];
this.equipmentId = dbAssoc["job_equip_item_equip"]; this.equipmentId = dbAssoc["job_equip_item_equip"];
this.itemType = dbAssoc["job_equip_item_type"]; this.itemType = dbAssoc["job_equip_item_type"];
@@ -220,26 +220,26 @@ class JobUniformData {
this.needsSaved = false; this.needsSaved = false;
this.bodyParts = { this.bodyParts = {
hair: [0,0], hair: [0, 0],
head: [0,0], head: [0, 0],
upper: [0,0], upper: [0, 0],
lower: [0,0], lower: [0, 0],
}; };
this.bodyProps = { this.bodyProps = {
hair: [0,0], hair: [0, 0],
eyes: [0,0], eyes: [0, 0],
head: [0,0], head: [0, 0],
leftHand: [0,0], leftHand: [0, 0],
rightHand: [0,0], rightHand: [0, 0],
leftWrist: [0,0], leftWrist: [0, 0],
rightWrist: [0,0], rightWrist: [0, 0],
hip: [0,0], hip: [0, 0],
leftFoot: [0,0], leftFoot: [0, 0],
rightFoot: [0,0], rightFoot: [0, 0],
}; };
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_uniform_id"]; this.databaseId = dbAssoc["job_uniform_id"];
this.job = dbAssoc["job_uniform_job"]; this.job = dbAssoc["job_uniform_job"];
this.name = dbAssoc["job_uniform_name"]; this.name = dbAssoc["job_uniform_name"];
@@ -290,7 +290,7 @@ class JobLocationData {
this.needsSaved = false; this.needsSaved = false;
this.routeCache = []; this.routeCache = [];
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_loc_id"]; this.databaseId = dbAssoc["job_loc_id"];
this.jobId = dbAssoc["job_loc_job"]; this.jobId = dbAssoc["job_loc_job"];
this.position = toVector3(dbAssoc["job_loc_pos_x"], dbAssoc["job_loc_pos_y"], dbAssoc["job_loc_pos_z"]); this.position = toVector3(dbAssoc["job_loc_pos_x"], dbAssoc["job_loc_pos_y"], dbAssoc["job_loc_pos_z"]);
@@ -315,7 +315,7 @@ class JobWhiteListData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_wl_id"]; this.databaseId = dbAssoc["job_wl_id"];
this.job = dbAssoc["job_wl_job"]; this.job = dbAssoc["job_wl_job"];
this.subAccount = dbAssoc["job_wl_sacct"] this.subAccount = dbAssoc["job_wl_sacct"]
@@ -336,7 +336,7 @@ class JobBlackListData {
this.jobIndex = -1; this.jobIndex = -1;
this.needsSaved = false; this.needsSaved = false;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["job_bl_id"]; this.databaseId = dbAssoc["job_bl_id"];
this.job = dbAssoc["job_bl_job"]; this.job = dbAssoc["job_bl_job"];
this.subAccount = dbAssoc["job_bl_sacct"] this.subAccount = dbAssoc["job_bl_sacct"]
@@ -624,11 +624,11 @@ function createAllJobPickups() {
for (let j in getServerData().jobs[i].locations) { for (let j in getServerData().jobs[i].locations) {
pickupCount++; pickupCount++;
getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position); getServerData().jobs[i].locations[j].pickup = game.createPickup(getServerData().jobs[i].pickupModel, getServerData().jobs[i].locations[j].position);
setEntityData(getServerData().jobs[i].locations[j].pickup, "vrr.owner.type", VRR_PICKUP_JOB, false); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.type", VRR_PICKUP_JOB, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "vrr.owner.id", j, false); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.owner.id", j, false);
setEntityData(getServerData().jobs[i].locations[j].pickup, "vrr.label.type", VRR_LABEL_JOB, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.type", VRR_LABEL_JOB, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "vrr.label.name", getServerData().jobs[i].name, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.name", getServerData().jobs[i].name, true);
setEntityData(getServerData().jobs[i].locations[j].pickup, "vrr.label.jobType", getServerData().jobs[i].databaseId, true); setEntityData(getServerData().jobs[i].locations[j].pickup, "agrp.label.jobType", getServerData().jobs[i].databaseId, true);
setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false); setElementOnAllDimensions(getServerData().jobs[i].locations[j].pickup, false);
setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension); setElementDimension(getServerData().jobs[i].locations[j].pickup, getServerData().jobs[i].locations[j].dimension);
addToWorld(getServerData().jobs[i].locations[j].pickup); addToWorld(getServerData().jobs[i].locations[j].pickup);
@@ -2742,11 +2742,11 @@ function createJobLocationPickup(jobId, locationId) {
tempJobData.locations[locationId].pickup = pickup; tempJobData.locations[locationId].pickup = pickup;
setElementDimension(pickup, tempJobData.locations[locationId].dimension); setElementDimension(pickup, tempJobData.locations[locationId].dimension);
setElementOnAllDimensions(pickup, false); setElementOnAllDimensions(pickup, false);
setEntityData(pickup, "vrr.owner.type", VRR_PICKUP_JOB, false); setEntityData(pickup, "agrp.owner.type", VRR_PICKUP_JOB, false);
setEntityData(pickup, "vrr.owner.id", locationId, false); setEntityData(pickup, "agrp.owner.id", locationId, false);
setEntityData(pickup, "vrr.label.type", VRR_LABEL_JOB, true); setEntityData(pickup, "agrp.label.type", VRR_LABEL_JOB, true);
setEntityData(pickup, "vrr.label.name", tempJobData.name, true); setEntityData(pickup, "agrp.label.name", tempJobData.name, true);
setEntityData(pickup, "vrr.label.jobType", tempJobData.databaseId, true); setEntityData(pickup, "agrp.label.jobType", tempJobData.databaseId, true);
addToWorld(pickup); addToWorld(pickup);
} }
} else { } else {

View File

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

View File

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

View File

@@ -40,10 +40,10 @@ let disconnectReasons = [
// =========================================================================== // ===========================================================================
function getPlayerPosition(client) { function getPlayerPosition(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncPosition; return getPlayerData(client).syncPosition;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).position; return getPlayerPed(client).position;
} }
} }
@@ -59,10 +59,10 @@ function setPlayerPosition(client, position) {
// =========================================================================== // ===========================================================================
function getPlayerHeading(client) { function getPlayerHeading(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncHeading; return getPlayerData(client).syncHeading;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).heading; return getPlayerPed(client).heading;
} }
} }
@@ -78,10 +78,10 @@ function setPlayerHeading(client, heading) {
// =========================================================================== // ===========================================================================
function getPlayerVehicle(client) { function getPlayerVehicle(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData().syncVehicle; return getPlayerData().syncVehicle;
} else { } else {
if(getPlayerPed(client).vehicle) { if (getPlayerPed(client).vehicle) {
return getPlayerPed(client).vehicle; return getPlayerPed(client).vehicle;
} }
} }
@@ -91,10 +91,10 @@ function getPlayerVehicle(client) {
// =========================================================================== // ===========================================================================
function getPlayerDimension(client) { function getPlayerDimension(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData(client).syncDimension; return getPlayerData(client).syncDimension;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
return getPlayerPed(client).dimension; return getPlayerPed(client).dimension;
} }
} }
@@ -110,10 +110,10 @@ function getPlayerInterior(client) {
function setPlayerDimension(client, dimension) { function setPlayerDimension(client, dimension) {
logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`); logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s dimension to ${dimension}`);
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
getPlayerData(client).syncDimension = dimension; getPlayerData(client).syncDimension = dimension;
} else { } else {
if(getPlayerPed(client) != null) { if (getPlayerPed(client) != null) {
getPlayerPed(client).dimension = dimension; getPlayerPed(client).dimension = dimension;
} }
} }
@@ -124,7 +124,7 @@ function setPlayerDimension(client, dimension) {
function setPlayerInterior(client, interior) { function setPlayerInterior(client, interior) {
logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`); logToConsole(LOG_VERBOSE, `Setting ${getPlayerDisplayForConsole(client)}'s interior to ${interior}`);
sendPlayerSetInterior(client, interior); sendPlayerSetInterior(client, interior);
if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) { if (isPlayerLoggedIn(client) && isPlayerSpawned(client)) {
getPlayerCurrentSubAccount(client).interior = interior; getPlayerCurrentSubAccount(client).interior = interior;
} }
} }
@@ -132,7 +132,7 @@ function setPlayerInterior(client, interior) {
// =========================================================================== // ===========================================================================
function isPlayerInAnyVehicle(client) { function isPlayerInAnyVehicle(client) {
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return (getPlayerData().syncVehicle != null); return (getPlayerData().syncVehicle != null);
} else { } else {
return (getPlayerPed(client).vehicle != null); return (getPlayerPed(client).vehicle != null);
@@ -142,15 +142,15 @@ function isPlayerInAnyVehicle(client) {
// =========================================================================== // ===========================================================================
function getPlayerVehicleSeat(client) { function getPlayerVehicleSeat(client) {
if(!isPlayerInAnyVehicle(client)) { if (!isPlayerInAnyVehicle(client)) {
return false; return false;
} }
if(!areServerElementsSupported()) { if (!areServerElementsSupported()) {
return getPlayerData().syncVehicleSeat; return getPlayerData().syncVehicleSeat;
} else { } else {
for(let i = 0 ; i <= 8 ; i++) { for (let i = 0; i <= 8; i++) {
if(getPlayerVehicle(client).getOccupant(i) == getPlayerPed(client)) { if (getPlayerVehicle(client).getOccupant(i) == getPlayerPed(client)) {
return i; return i;
} }
} }
@@ -180,8 +180,8 @@ function getVehicleHeading(vehicle) {
// =========================================================================== // ===========================================================================
function setVehicleHeading(vehicle, heading) { function setVehicleHeading(vehicle, heading) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return sendNetworkEventToPlayer("vrr.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading); return sendNetworkEventToPlayer("agrp.vehPosition", null, getVehicleForNetworkEvent(vehicle), heading);
} }
return vehicle.heading = heading; return vehicle.heading = heading;
} }
@@ -189,7 +189,7 @@ function setVehicleHeading(vehicle, heading) {
// =========================================================================== // ===========================================================================
function getElementTransient(element) { function getElementTransient(element) {
if(typeof element.transient != "undefined") { if (typeof element.transient != "undefined") {
return element.transient; return element.transient;
} }
return false; return false;
@@ -198,7 +198,7 @@ function getElementTransient(element) {
// =========================================================================== // ===========================================================================
function setElementTransient(element, state) { function setElementTransient(element, state) {
if(typeof element.transient != "undefined") { if (typeof element.transient != "undefined") {
element.transient = state; element.transient = state;
return true; return true;
} }
@@ -214,8 +214,8 @@ function getVehicleSyncer(vehicle) {
// =========================================================================== // ===========================================================================
function getVehicleForNetworkEvent(vehicle) { function getVehicleForNetworkEvent(vehicle) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
if(getVehicleData(vehicle).ivNetworkId != -1) { if (getVehicleData(vehicle).ivNetworkId != -1) {
return getVehicleData(vehicle).ivNetworkId; return getVehicleData(vehicle).ivNetworkId;
} }
return -1; return -1;
@@ -227,11 +227,11 @@ function getVehicleForNetworkEvent(vehicle) {
function deleteGameElement(element) { function deleteGameElement(element) {
try { try {
if(element != null) { if (element != null) {
destroyElement(element); destroyElement(element);
return true; return true;
} }
} catch(error) { } catch (error) {
return false; return false;
} }
} }
@@ -254,8 +254,8 @@ function removePlayerFromVehicle(client) {
function setPlayerSkin(client, skinIndex) { function setPlayerSkin(client, skinIndex) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameConfig().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameConfig().skins[getGame()][skinIndex][1]})`);
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]); triggerNetworkEvent("agrp.localPlayerSkin", client, getGameConfig().skins[getGame()][skinIndex][0]);
} else { } else {
getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0]; getPlayerPed(client).modelIndex = getGameConfig().skins[getGame()][skinIndex][0];
} }
@@ -292,7 +292,7 @@ function setPlayerArmour(client, armour) {
// =========================================================================== // ===========================================================================
function getPlayerArmour(client) { function getPlayerArmour(client) {
if(areServerElementsSupported(client)) { if (areServerElementsSupported(client)) {
return getPlayerPed(client).armour; return getPlayerPed(client).armour;
} else { } else {
return getPlayerData(client).syncArmour; return getPlayerData(client).syncArmour;
@@ -302,11 +302,11 @@ function getPlayerArmour(client) {
// =========================================================================== // ===========================================================================
function setPlayerCash(client, amount) { function setPlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -317,11 +317,11 @@ function setPlayerCash(client, amount) {
// =========================================================================== // ===========================================================================
function givePlayerCash(client, amount) { function givePlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -332,11 +332,11 @@ function givePlayerCash(client, amount) {
// =========================================================================== // ===========================================================================
function takePlayerCash(client, amount) { function takePlayerCash(client, amount) {
if(client == null) { if (client == null) {
return false; return false;
} }
if(isNaN(amount)) { if (isNaN(amount)) {
return false; return false;
} }
@@ -368,7 +368,7 @@ function getPlayerWeaponAmmo(client) {
function setPlayerVelocity(client, velocity) { function setPlayerVelocity(client, velocity) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s velocity to ${velocity.x}, ${velocity.y}, ${velocity.z}`);
if(typeof getPlayerPed(client).velocity != "undefined") { if (typeof getPlayerPed(client).velocity != "undefined") {
getPlayerPed(client).velocity = velocity; getPlayerPed(client).velocity = velocity;
} }
} }
@@ -376,7 +376,7 @@ function setPlayerVelocity(client, velocity) {
// =========================================================================== // ===========================================================================
function getPlayerVelocity(client) { function getPlayerVelocity(client) {
if(typeof getPlayerPed(client).velocity != "undefined") { if (typeof getPlayerPed(client).velocity != "undefined") {
return getPlayerPed(client).velocity; return getPlayerPed(client).velocity;
} }
return toVector3(0.0, 0.0, 0.0); return toVector3(0.0, 0.0, 0.0);
@@ -385,7 +385,7 @@ function getPlayerVelocity(client) {
// =========================================================================== // ===========================================================================
function getElementDimension(element) { function getElementDimension(element) {
if(typeof element.dimension != "undefined") { if (typeof element.dimension != "undefined") {
return element.dimension; return element.dimension;
} }
return 0; return 0;
@@ -394,7 +394,7 @@ function getElementDimension(element) {
// =========================================================================== // ===========================================================================
function setElementDimension(element, dimension) { function setElementDimension(element, dimension) {
if(typeof element.dimension != "undefined") { if (typeof element.dimension != "undefined") {
logToConsole(LOG_VERBOSE, `Setting element ${element} (${element.id}) dimension to ${dimension}`); logToConsole(LOG_VERBOSE, `Setting element ${element} (${element.id}) dimension to ${dimension}`);
element.dimension = dimension; element.dimension = dimension;
return true; return true;
@@ -405,7 +405,7 @@ function setElementDimension(element, dimension) {
// =========================================================================== // ===========================================================================
function setElementRotation(element, rotation) { function setElementRotation(element, rotation) {
if(typeof element.setRotation != "undefined") { if (typeof element.setRotation != "undefined") {
element.setRotation(rotation); element.setRotation(rotation);
} else { } else {
return element.rotation = rotation; return element.rotation = rotation;
@@ -415,24 +415,24 @@ function setElementRotation(element, rotation) {
// =========================================================================== // ===========================================================================
function givePlayerHealth(client, amount) { function givePlayerHealth(client, amount) {
if(getPlayerHealth(client)+amount > 100) { if (getPlayerHealth(client) + amount > 100) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to 100`);
setPlayerHealth(client, 100); setPlayerHealth(client, 100);
} else { } else {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client)+amount}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s health to ${getPlayerHealth(client) + amount}`);
setPlayerHealth(client, getPlayerHealth(client)+amount); setPlayerHealth(client, getPlayerHealth(client) + amount);
} }
} }
// =========================================================================== // ===========================================================================
function givePlayerArmour(client, amount) { function givePlayerArmour(client, amount) {
if(getPlayerArmour(client)+amount > 100) { if (getPlayerArmour(client) + amount > 100) {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to 100`);
setPlayerArmour(client, 100); setPlayerArmour(client, 100);
} else { } else {
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client)+amount}`); logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s armour to ${getPlayerArmour(client) + amount}`);
setPlayerArmour(client, getPlayerArmour(client)+amount); setPlayerArmour(client, getPlayerArmour(client) + amount);
} }
} }
@@ -469,7 +469,7 @@ function getServerName() {
// =========================================================================== // ===========================================================================
function createGamePickup(modelIndex, position, type) { function createGamePickup(modelIndex, position, type) {
if(!isGameFeatureSupported("pickups")) { if (!isGameFeatureSupported("pickups")) {
return false; return false;
} }
return game.createPickup(modelIndex, position, type); return game.createPickup(modelIndex, position, type);
@@ -478,7 +478,7 @@ function createGamePickup(modelIndex, position, type) {
// =========================================================================== // ===========================================================================
function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255)) { function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255)) {
if(!isGameFeatureSupported("blips")) { if (!isGameFeatureSupported("blips")) {
return false; return false;
} }
return game.createBlip(type, position, 1, colour); return game.createBlip(type, position, 1, colour);
@@ -487,7 +487,7 @@ function createGameBlip(position, type = 0, colour = toColour(255, 255, 255, 255
// =========================================================================== // ===========================================================================
function createGameObject(modelIndex, position) { function createGameObject(modelIndex, position) {
if(!isGameFeatureSupported("objects")) { if (!isGameFeatureSupported("objects")) {
return false; return false;
} }
return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position); return game.createObject(getGameConfig().objects[getGame()][modelIndex][0], position);
@@ -496,13 +496,13 @@ function createGameObject(modelIndex, position) {
// =========================================================================== // ===========================================================================
function setElementOnAllDimensions(element, state) { function setElementOnAllDimensions(element, state) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
if(typeof element.netFlags != "undefined") { if (typeof element.netFlags != "undefined") {
if(typeof element.netFlags.onAllDimensions != "undefined") { if (typeof element.netFlags.onAllDimensions != "undefined") {
element.netFlags.onAllDimensions = state; element.netFlags.onAllDimensions = state;
} }
} else { } else {
if(typeof element.onAllDimensions != "undefined") { if (typeof element.onAllDimensions != "undefined") {
element.onAllDimensions = state; element.onAllDimensions = state;
} }
} }
@@ -512,7 +512,7 @@ function setElementOnAllDimensions(element, state) {
// =========================================================================== // ===========================================================================
function destroyGameElement(element) { function destroyGameElement(element) {
if(!isNull(element) && element != false) { if (!isNull(element) && element != false) {
destroyElement(element); destroyElement(element);
} }
} }
@@ -532,7 +532,7 @@ function getPlayerLastVehicle(client) {
// =========================================================================== // ===========================================================================
function isVehicleObject(vehicle) { function isVehicleObject(vehicle) {
if(vehicle == null || vehicle == undefined) { if (vehicle == null || vehicle == undefined) {
return false; return false;
} }
return (vehicle.type == ELEMENT_VEHICLE); return (vehicle.type == ELEMENT_VEHICLE);
@@ -547,15 +547,15 @@ function repairVehicle(vehicle) {
// =========================================================================== // ===========================================================================
function setVehicleLights(vehicle, lights) { function setVehicleLights(vehicle, lights) {
setEntityData(vehicle, "vrr.lights", lights, true); setEntityData(vehicle, "agrp.lights", lights, true);
sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, lights); sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, lights);
} }
// =========================================================================== // ===========================================================================
function setVehicleEngine(vehicle, engine) { function setVehicleEngine(vehicle, engine) {
vehicle.engine = engine; vehicle.engine = engine;
setEntityData(vehicle, "vrr.engine", engine, true); setEntityData(vehicle, "agrp.engine", engine, true);
} }
// =========================================================================== // ===========================================================================
@@ -600,11 +600,11 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1
vehicle.colour1 = colour1; vehicle.colour1 = colour1;
vehicle.colour2 = colour2; vehicle.colour2 = colour2;
if(colour3 != -1) { if (colour3 != -1) {
vehicle.colour3 = colour3; vehicle.colour3 = colour3;
} }
if(colour4 != -1) { if (colour4 != -1) {
vehicle.colour4 = colour4; vehicle.colour4 = colour4;
} }
} }
@@ -612,7 +612,7 @@ function setVehicleColours(vehicle, colour1, colour2, colour3 = -1, colour4 = -1
// =========================================================================== // ===========================================================================
function createGameVehicle(modelIndex, position, heading) { function createGameVehicle(modelIndex, position, heading) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return mp.vehicles.new(getGameConfig().vehicles[getGame()][modelIndex][0], position, { return mp.vehicles.new(getGameConfig().vehicles[getGame()][modelIndex][0], position, {
heading: heading, heading: heading,
numberPlate: "", numberPlate: "",
@@ -628,7 +628,7 @@ function createGameVehicle(modelIndex, position, heading) {
// =========================================================================== // ===========================================================================
function createGameCivilian(modelIndex, position, heading) { function createGameCivilian(modelIndex, position, heading) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return mp.peds.new(getGameConfig().skins[getGame()][modelIndex][1], position, heading, 0); return mp.peds.new(getGameConfig().skins[getGame()][modelIndex][1], position, heading, 0);
} }
@@ -644,7 +644,7 @@ function getIsland(position) {
// =========================================================================== // ===========================================================================
function isValidVehicleModel(model) { function isValidVehicleModel(model) {
if(getVehicleModelIndexFromModel(model) != false) { if (getVehicleModelIndexFromModel(model) != false) {
return true; return true;
} }
@@ -654,7 +654,7 @@ function isValidVehicleModel(model) {
// =========================================================================== // ===========================================================================
function setGameTime(hour, minute, minuteDuration = 1000) { function setGameTime(hour, minute, minuteDuration = 1000) {
if(isTimeSupported()) { if (isTimeSupported()) {
game.time.hour = hour; game.time.hour = hour;
game.time.minute = minute; game.time.minute = minute;
game.time.minuteDuration = minuteDuration; game.time.minuteDuration = minuteDuration;
@@ -664,7 +664,7 @@ function setGameTime(hour, minute, minuteDuration = 1000) {
// =========================================================================== // ===========================================================================
function setGameWeather(weather) { function setGameWeather(weather) {
if(isWeatherSupported()) { if (isWeatherSupported()) {
mp.world.weather = weather; mp.world.weather = weather;
} }
} }
@@ -690,7 +690,7 @@ function getPlayerElement(client) {
// =========================================================================== // ===========================================================================
function setElementPosition(element, position) { function setElementPosition(element, position) {
sendNetworkEventToPlayer("vrr.elementPosition", null, element.id, position); sendNetworkEventToPlayer("agrp.elementPosition", null, element.id, position);
} }
// =========================================================================== // ===========================================================================
@@ -714,13 +714,13 @@ function setElementInterior(element, interior) {
// =========================================================================== // ===========================================================================
function setElementCollisionsEnabled(element, state) { function setElementCollisionsEnabled(element, state) {
//sendNetworkEventToPlayer("vrr.elementCollisions", null, element.id, state); //sendNetworkEventToPlayer("agrp.elementCollisions", null, element.id, state);
} }
// =========================================================================== // ===========================================================================
function isTaxiVehicle(vehicle) { function isTaxiVehicle(vehicle) {
if(getGameConfig().taxiModels[getGame()].indexOf(vehicle.modelIndex) != -1) { if (getGameConfig().taxiModels[getGame()].indexOf(vehicle.modelIndex) != -1) {
return true; return true;
} }
@@ -737,7 +737,7 @@ function getVehicleName(vehicle) {
// =========================================================================== // ===========================================================================
function getElementModel(element) { function getElementModel(element) {
if(typeof element.model != "undefined") { if (typeof element.model != "undefined") {
return element.model; return element.model;
} }
} }
@@ -757,11 +757,11 @@ function getPlayerWeapon(client) {
// =========================================================================== // ===========================================================================
function connectToDatabase() { function connectToDatabase() {
if(getDatabaseConfig().usePersistentConnection) { if (getDatabaseConfig().usePersistentConnection) {
if(persistentDatabaseConnection == null) { if (persistentDatabaseConnection == null) {
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`); logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port); persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
if(persistentDatabaseConnection.error) { if (persistentDatabaseConnection.error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
persistentDatabaseConnection = null; persistentDatabaseConnection = null;
return false; return false;
@@ -775,7 +775,7 @@ function connectToDatabase() {
} }
} else { } else {
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port); let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
if(databaseConnection.error) { if (databaseConnection.error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
return false; return false;
} else { } else {
@@ -787,11 +787,11 @@ function connectToDatabase() {
// =========================================================================== // ===========================================================================
function disconnectFromDatabase(dbConnection) { function disconnectFromDatabase(dbConnection) {
if(!getDatabaseConfig().usePersistentConnection) { if (!getDatabaseConfig().usePersistentConnection) {
try { try {
dbConnection.close(); dbConnection.close();
logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`); logToConsole(LOG_DEBUG, `[VRR.Database] Database connection closed successfully`);
} catch(error) { } catch (error) {
logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`); logToConsole(LOG_ERROR, `[VRR.Database] Database connection could not be closed! (Error: ${error})`);
} }
} }
@@ -802,7 +802,7 @@ function disconnectFromDatabase(dbConnection) {
function queryDatabase(dbConnection, queryString, useThread = false) { function queryDatabase(dbConnection, queryString, useThread = false) {
logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`); logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
if(useThread == true) { if (useThread == true) {
Promise.resolve().then(() => { Promise.resolve().then(() => {
let queryResult = dbConnection.query(queryString); let queryResult = dbConnection.query(queryString);
return queryResult; return queryResult;
@@ -815,11 +815,11 @@ function queryDatabase(dbConnection, queryString, useThread = false) {
// =========================================================================== // ===========================================================================
function escapeDatabaseString(dbConnection, unsafeString = "") { function escapeDatabaseString(dbConnection, unsafeString = "") {
if(!dbConnection) { if (!dbConnection) {
dbConnection = connectToDatabase(); dbConnection = connectToDatabase();
} }
if(typeof unsafeString == "string") { if (typeof unsafeString == "string") {
return dbConnection.escapeString(unsafeString); return dbConnection.escapeString(unsafeString);
} }
return unsafeString; return unsafeString;
@@ -846,7 +846,7 @@ function getDatabaseError(dbConnection) {
// =========================================================================== // ===========================================================================
function freeDatabaseQuery(dbQuery) { function freeDatabaseQuery(dbQuery) {
if(dbQuery != null) { if (dbQuery != null) {
dbQuery.free(); dbQuery.free();
} }
return; return;
@@ -863,26 +863,26 @@ function fetchQueryAssoc(dbQuery) {
function quickDatabaseQuery(queryString) { function quickDatabaseQuery(queryString) {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
let insertId = 0; let insertId = 0;
if(dbConnection) { if (dbConnection) {
//logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`); //logToConsole(LOG_DEBUG, `[VRR.Database] Query string: ${queryString}`);
let dbQuery = queryDatabase(dbConnection, queryString); let dbQuery = queryDatabase(dbConnection, queryString);
if(getDatabaseInsertId(dbConnection)) { if (getDatabaseInsertId(dbConnection)) {
insertId = getDatabaseInsertId(dbConnection); insertId = getDatabaseInsertId(dbConnection);
logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`); logToConsole(LOG_DEBUG, `[VRR.Database] Query returned insert id ${insertId}`);
} }
if(dbQuery) { if (dbQuery) {
try { try {
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`); logToConsole(LOG_DEBUG, `[VRR.Database] Query result free'd successfully`);
} catch(error) { } catch (error) {
logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`); logToConsole(LOG_ERROR, `[VRR.Database] Query result could not be free'd! (Error: ${error})`);
} }
} }
disconnectFromDatabase(dbConnection); disconnectFromDatabase(dbConnection);
if(insertId != 0) { if (insertId != 0) {
return insertId; return insertId;
} }
@@ -915,8 +915,8 @@ function getElementId(element) {
function getClientFromIndex(index) { function getClientFromIndex(index) {
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(clients[i].index == index) { if (clients[i].index == index) {
return clients[i]; return clients[i];
} }
} }
@@ -955,7 +955,7 @@ function getClosestCivilian(position) {
// =========================================================================== // ===========================================================================
function getVehiclesInRange(position, range) { function getVehiclesInRange(position, range) {
if(getGame() == VRR_GAME_GTA_IV) { if (getGame() == VRR_GAME_GTA_IV) {
return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j); return getServerData().vehicles.reduce((i, j) => (getDistance(position, i.syncPosition) <= getDistance(position, j.syncPosition)) ? i : j);
} }
return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range); return getElementsByTypeInRange(ELEMENT_VEHICLE, position, range);
@@ -976,8 +976,8 @@ function getClosestElementByType(elementType, position) {
// =========================================================================== // ===========================================================================
function getVehicleFirstEmptySeat(vehicle) { function getVehicleFirstEmptySeat(vehicle) {
for(let i = 0; i <= 4; i++) { for (let i = 0; i <= 4; i++) {
if(vehicle.getOccupant(i) == null) { if (vehicle.getOccupant(i) == null) {
return i; return i;
} }
} }
@@ -1014,14 +1014,14 @@ function setVehicleHealth(vehicle, health) {
function givePlayerWeapon(client, weaponId, ammo, active = true) { function givePlayerWeapon(client, weaponId, ammo, active = true) {
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); //logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`);
//sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active); //sendNetworkEventToPlayer("agrp.giveWeapon", client, weaponId, ammo, active);
client.giveWeapon(weaponId, ammo); client.giveWeapon(weaponId, ammo);
} }
// =========================================================================== // ===========================================================================
function setPlayerWantedLevel(client, wantedLevel) { function setPlayerWantedLevel(client, wantedLevel) {
//sendNetworkEventToPlayer("vrr.wantedLevel", client, wantedLevel); //sendNetworkEventToPlayer("agrp.wantedLevel", client, wantedLevel);
return true; return true;
} }
@@ -1046,9 +1046,9 @@ function getPlayerPed(client) {
// =========================================================================== // ===========================================================================
function setEntityData(entity, dataName, dataValue, syncToClients = true) { function setEntityData(entity, dataName, dataValue, syncToClients = true) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
if(syncToClients) { if (syncToClients) {
return entity.setVariable(dataName, dataValue); return entity.setVariable(dataName, dataValue);
} else { } else {
return entity.setOwnVariable(dataName, dataValue); return entity.setOwnVariable(dataName, dataValue);
@@ -1061,8 +1061,8 @@ function setEntityData(entity, dataName, dataValue, syncToClients = true) {
// =========================================================================== // ===========================================================================
function removeEntityData(entity, dataName) { function removeEntityData(entity, dataName) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return entity.setVariable(dataName, null); return entity.setVariable(dataName, null);
} }
} }
@@ -1072,8 +1072,8 @@ function removeEntityData(entity, dataName) {
// =========================================================================== // ===========================================================================
function doesEntityDataExist(entity, dataName) { function doesEntityDataExist(entity, dataName) {
if(entity != null) { if (entity != null) {
if(areServerElementsSupported()) { if (areServerElementsSupported()) {
return (entity.getVariable(dataName) != null); return (entity.getVariable(dataName) != null);
} else { } else {
return false; return false;
@@ -1169,7 +1169,7 @@ function serverBanIP(ip) {
// =========================================================================== // ===========================================================================
function setVehicleTrunkState(vehicle, trunkState) { function setVehicleTrunkState(vehicle, trunkState) {
//sendNetworkEventToPlayer("vrr.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState); //sendNetworkEventToPlayer("agrp.veh.trunk", null, getVehicleForNetworkEvent(vehicle), trunkState);
} }
// =========================================================================== // ===========================================================================
@@ -1201,7 +1201,7 @@ function addAllEventHandlers() {
// =========================================================================== // ===========================================================================
function addServerCommandHandler(command, handlerFunction) { function addServerCommandHandler(command, handlerFunction) {
mp.events.addCommand(command, function(client, ...args) { mp.events.addCommand(command, function (client, ...args) {
handlerFunction.call(command, args.join(" "), client); handlerFunction.call(command, args.join(" "), client);
}); });
} }
@@ -1209,7 +1209,7 @@ function addServerCommandHandler(command, handlerFunction) {
// =========================================================================== // ===========================================================================
function addServerEventHandler(eventName, handlerFunction) { function addServerEventHandler(eventName, handlerFunction) {
mp.events.add(eventName, function(event, ...args) { mp.events.add(eventName, function (event, ...args) {
let result = handlerFunction.apply(this, args); let result = handlerFunction.apply(this, args);
}); });
} }
@@ -1217,7 +1217,7 @@ function addServerEventHandler(eventName, handlerFunction) {
// =========================================================================== // ===========================================================================
function bindServerEventHandler(eventName, bindTo, handlerFunction) { function bindServerEventHandler(eventName, bindTo, handlerFunction) {
mp.events.add(eventName, function(event, ...args) { mp.events.add(eventName, function (event, ...args) {
let result = handlerFunction.apply(this, args); let result = handlerFunction.apply(this, args);
}); });
} }

View File

@@ -137,73 +137,73 @@ function addAllNetworkEventHandlers() {
logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ..."); logToConsole(LOG_DEBUG, "[VRR.Client]: Adding network handlers ...");
// KeyBind // KeyBind
addNetworkEventHandler("vrr.useKeyBind", playerUsedKeyBind); addNetworkEventHandler("agrp.useKeyBind", playerUsedKeyBind);
// GUI // GUI
addNetworkEventHandler("vrr.promptAnswerNo", playerPromptAnswerNo); addNetworkEventHandler("agrp.promptAnswerNo", playerPromptAnswerNo);
addNetworkEventHandler("vrr.promptAnswerYes", playerPromptAnswerYes); addNetworkEventHandler("agrp.promptAnswerYes", playerPromptAnswerYes);
addNetworkEventHandler("vrr.toggleGUI", playerToggledGUI); addNetworkEventHandler("agrp.toggleGUI", playerToggledGUI);
addNetworkEventHandler("vrr.2fa", checkPlayerTwoFactorAuthentication); addNetworkEventHandler("agrp.2fa", checkPlayerTwoFactorAuthentication);
// AFK // AFK
addNetworkEventHandler("vrr.afk", playerChangeAFKState); addNetworkEventHandler("agrp.afk", playerChangeAFKState);
// Event // Event
addNetworkEventHandler("vrr.pickup", onPlayerNearPickup); addNetworkEventHandler("agrp.pickup", onPlayerNearPickup);
addNetworkEventHandler("vrr.enteredSphere", onPlayerEnteredSphere); addNetworkEventHandler("agrp.enteredSphere", onPlayerEnteredSphere);
addNetworkEventHandler("vrr.exitedSphere", onPlayerExitedSphere); addNetworkEventHandler("agrp.exitedSphere", onPlayerExitedSphere);
addNetworkEventHandler("vrr.playerDeath", onPlayerDeath); addNetworkEventHandler("agrp.playerDeath", onPlayerDeath);
addNetworkEventHandler("vrr.onPlayerEnterVehicle", onPlayerEnteredVehicle); addNetworkEventHandler("agrp.onPlayerEnterVehicle", onPlayerEnteredVehicle);
addNetworkEventHandler("vrr.onPlayerExitVehicle", onPlayerExitedVehicle); addNetworkEventHandler("agrp.onPlayerExitVehicle", onPlayerExitedVehicle);
// Job // Job
addNetworkEventHandler("vrr.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation); addNetworkEventHandler("agrp.arrivedAtJobRouteLocation", playerArrivedAtJobRouteLocation);
// Client // Client
addNetworkEventHandler("vrr.clientReady", playerClientReady); addNetworkEventHandler("agrp.clientReady", playerClientReady);
addNetworkEventHandler("vrr.guiReady", playerGUIReady); addNetworkEventHandler("agrp.guiReady", playerGUIReady);
addNetworkEventHandler("vrr.clientStarted", playerClientStarted); addNetworkEventHandler("agrp.clientStarted", playerClientStarted);
addNetworkEventHandler("vrr.clientStopped", playerClientStopped); addNetworkEventHandler("agrp.clientStopped", playerClientStopped);
// Account // Account
addNetworkEventHandler("vrr.checkLogin", checkLogin); addNetworkEventHandler("agrp.checkLogin", checkLogin);
addNetworkEventHandler("vrr.checkRegistration", checkRegistration); addNetworkEventHandler("agrp.checkRegistration", checkRegistration);
addNetworkEventHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest); addNetworkEventHandler("agrp.checkResetPassword", checkAccountResetPasswordRequest);
addNetworkEventHandler("vrr.checkChangePassword", checkAccountChangePassword); addNetworkEventHandler("agrp.checkChangePassword", checkAccountChangePassword);
// Developer // Developer
addNetworkEventHandler("vrr.runCodeSuccess", clientRunCodeSuccess); addNetworkEventHandler("agrp.runCodeSuccess", clientRunCodeSuccess);
addNetworkEventHandler("vrr.runCodeFail", clientRunCodeFail); addNetworkEventHandler("agrp.runCodeFail", clientRunCodeFail);
// SubAccount // SubAccount
addNetworkEventHandler("vrr.checkNewCharacter", checkNewCharacter); addNetworkEventHandler("agrp.checkNewCharacter", checkNewCharacter);
addNetworkEventHandler("vrr.nextCharacter", checkNextCharacter); addNetworkEventHandler("agrp.nextCharacter", checkNextCharacter);
addNetworkEventHandler("vrr.previousCharacter", checkPreviousCharacter); addNetworkEventHandler("agrp.previousCharacter", checkPreviousCharacter);
addNetworkEventHandler("vrr.selectCharacter", selectCharacter); addNetworkEventHandler("agrp.selectCharacter", selectCharacter);
// Item // Item
addNetworkEventHandler("vrr.itemActionDelayComplete", playerItemActionDelayComplete); addNetworkEventHandler("agrp.itemActionDelayComplete", playerItemActionDelayComplete);
addNetworkEventHandler("vrr.weaponDamage", playerDamagedByPlayer); addNetworkEventHandler("agrp.weaponDamage", playerDamagedByPlayer);
// Locale // Locale
addNetworkEventHandler("vrr.localeSelect", playerSelectedNewLocale); addNetworkEventHandler("agrp.localeSelect", playerSelectedNewLocale);
// Misc // Misc
addNetworkEventHandler("vrr.plr.pos", updatePositionInPlayerData); addNetworkEventHandler("agrp.plr.pos", updatePositionInPlayerData);
addNetworkEventHandler("vrr.plr.rot", updateHeadingInPlayerData); addNetworkEventHandler("agrp.plr.rot", updateHeadingInPlayerData);
addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection); addNetworkEventHandler("agrp.skinSelected", playerFinishedSkinSelection);
addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive); addNetworkEventHandler("agrp.clientInfo", updateConnectionLogOnClientInfoReceive);
addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient); addNetworkEventHandler("agrp.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId); addNetworkEventHandler("agrp.playerPedId", receivePlayerPedNetworkId);
addNetworkEventHandler("vrr.playerCop", setPlayerAsCopState); addNetworkEventHandler("agrp.playerCop", setPlayerAsCopState);
addNetworkEventHandler("agrp.mousecam", playerMouseCameraReady); addNetworkEventHandler("agrp.mouseCamera", playerMouseCameraReady);
} }
// =========================================================================== // ===========================================================================
function updatePlayerNameTag(client) { function updatePlayerNameTag(client) {
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`); //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s updated nametag to all players`);
sendNetworkEventToPlayer("vrr.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client)); sendNetworkEventToPlayer("agrp.nametag", null, getPlayerName(client), getPlayerNameForNameTag(client), getPlayerColour(client), getPlayerData(client).afk, getPlayerPing(client));
} }
// =========================================================================== // ===========================================================================
@@ -220,7 +220,7 @@ function updateAllPlayerNameTags() {
function updatePlayerPing(client) { function updatePlayerPing(client) {
//logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`); //logToConsole(LOG_DEBUG, `[VRR.Client] Sending ${getPlayerDisplayForConsole(client)}'s ping to all players`);
sendNetworkEventToPlayer("vrr.ping", null, getPlayerName(client), getPlayerPing(client)); sendNetworkEventToPlayer("agrp.ping", null, getPlayerName(client), getPlayerPing(client));
} }
// =========================================================================== // ===========================================================================
@@ -259,7 +259,7 @@ function playerClientStopped(client) {
function showGameMessage(client, text, colour, duration, fontName = "Pricedown") { function showGameMessage(client, text, colour, duration, fontName = "Pricedown") {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing game message to ${getPlayerDisplayForConsole(client)} (${text}) for ${duration} milliseconds`);
sendNetworkEventToPlayer("vrr.smallGameMessage", client, text, colour, duration, fontName); sendNetworkEventToPlayer("agrp.smallGameMessage", client, text, colour, duration, fontName);
} }
// =========================================================================== // ===========================================================================
@@ -270,7 +270,7 @@ function enableCityAmbienceForPlayer(client, clearElements = false) {
//} //}
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
//sendNetworkEventToPlayer("vrr.ambience", client, true); //sendNetworkEventToPlayer("agrp.ambience", client, true);
} }
// =========================================================================== // ===========================================================================
@@ -281,14 +281,14 @@ function disableCityAmbienceForPlayer(client, clearElements = false) {
//} //}
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`); //logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
//sendNetworkEventToPlayer("vrr.ambience", client, false, clearElements); //sendNetworkEventToPlayer("agrp.ambience", client, false, clearElements);
} }
// =========================================================================== // ===========================================================================
function clearPlayerOwnedPeds(client) { function clearPlayerOwnedPeds(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Clearing peds owned by ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.clearPeds", client); sendNetworkEventToPlayer("agrp.clearPeds", client);
} }
// =========================================================================== // ===========================================================================
@@ -296,41 +296,41 @@ function clearPlayerOwnedPeds(client) {
function updatePlayerSpawnedState(client, state) { function updatePlayerSpawnedState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`); logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s spawned state ${toUpperCase(getOnOffFromBool(state))}`);
getPlayerData(client).spawned = true; getPlayerData(client).spawned = true;
sendNetworkEventToPlayer("vrr.spawned", client, state); sendNetworkEventToPlayer("agrp.spawned", client, state);
} }
// =========================================================================== // ===========================================================================
function setPlayerControlState(client, state) { function setPlayerControlState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`); logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s control state ${toUpperCase(getOnOffFromBool(state))}`);
sendNetworkEventToPlayer("vrr.control", client, state, !state); sendNetworkEventToPlayer("agrp.control", client, state, !state);
} }
// =========================================================================== // ===========================================================================
function updatePlayerShowLogoState(client, state) { function updatePlayerShowLogoState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`); logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s logo state ${toUpperCase(getOnOffFromBool(state))}`);
sendNetworkEventToPlayer("vrr.logo", client, state); sendNetworkEventToPlayer("agrp.logo", client, state);
} }
// =========================================================================== // ===========================================================================
function restorePlayerCamera(client) { function restorePlayerCamera(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`); logToConsole(LOG_DEBUG, `[VRR.Client] Restoring ${getPlayerDisplayForConsole(client)}'s camera`);
sendNetworkEventToPlayer("vrr.restoreCamera", client); sendNetworkEventToPlayer("agrp.restoreCamera", client);
} }
// =========================================================================== // ===========================================================================
function setPlayer2DRendering(client, hudState = false, labelState = false, smallGameMessageState = false, scoreboardState = false, hotBarState = false, itemActionDelayState = false) { function setPlayer2DRendering(client, hudState = false, labelState = false, smallGameMessageState = false, scoreboardState = false, hotBarState = false, itemActionDelayState = false) {
sendNetworkEventToPlayer("vrr.set2DRendering", client, hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState); sendNetworkEventToPlayer("agrp.set2DRendering", client, hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState);
} }
// =========================================================================== // ===========================================================================
function syncPlayerProperties(client) { function syncPlayerProperties(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to sync ${getPlayerDisplayForConsole(client)}'s player ped properties`);
sendNetworkEventToPlayer("vrr.syncElement", null, getPlayerPed(client).id); sendNetworkEventToPlayer("agrp.syncElement", null, getPlayerPed(client).id);
} }
// =========================================================================== // ===========================================================================
@@ -338,7 +338,7 @@ function syncPlayerProperties(client) {
function updatePlayerSnowState(client) { function updatePlayerSnowState(client) {
if (isSnowSupported(getGame())) { if (isSnowSupported(getGame())) {
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`); logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s snow state (Falling: ${toUpperCase(getOnOffFromBool(getServerConfig().fallingSnow))}, Ground: ${toUpperCase(getOnOffFromBool(getServerConfig().groundSnow))})`);
sendNetworkEventToPlayer("vrr.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow); sendNetworkEventToPlayer("agrp.snow", client, getServerConfig().fallingSnow, getServerConfig().groundSnow);
} }
} }
@@ -362,21 +362,21 @@ function updatePlayerHotBar(client) {
} }
tempHotBarItems.push([i, itemExists, itemImage, itemValue]); tempHotBarItems.push([i, itemExists, itemImage, itemValue]);
} }
sendNetworkEventToPlayer("vrr.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems); sendNetworkEventToPlayer("agrp.hotbar", client, getPlayerData(client).activeHotBarSlot, tempHotBarItems);
} }
// =========================================================================== // ===========================================================================
function setPlayerWeaponDamageEnabled(client, state) { function setPlayerWeaponDamageEnabled(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage state for ${getPlayerDisplayForConsole(client)} to all players`);
sendNetworkEventToPlayer("vrr.weaponDamageEnabled", null, getPlayerName(client), state); sendNetworkEventToPlayer("agrp.weaponDamageEnabled", null, getPlayerName(client), state);
} }
// =========================================================================== // ===========================================================================
function setPlayerWeaponDamageEvent(client, eventType) { function setPlayerWeaponDamageEvent(client, eventType) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending weapon damage event (${eventType}) for ${getPlayerDisplayForConsole(client)} to all players`);
sendNetworkEventToPlayer("vrr.weaponDamageEvent", null, getPlayerName(client), eventType); sendNetworkEventToPlayer("agrp.weaponDamageEvent", null, getPlayerName(client), eventType);
getPlayerData(client).weaponDamageEvent = eventType; getPlayerData(client).weaponDamageEvent = eventType;
} }
@@ -384,259 +384,259 @@ function setPlayerWeaponDamageEvent(client, eventType) {
function sendJobRouteLocationToPlayer(client, position, colour) { function sendJobRouteLocationToPlayer(client, position, colour) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending job route stop data to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showJobRouteLocation", client, position, colour); sendNetworkEventToPlayer("agrp.showJobRouteLocation", client, position, colour);
} }
// =========================================================================== // ===========================================================================
function showPlayerLoginSuccessGUI(client) { function showPlayerLoginSuccessGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.loginSuccess", client); sendNetworkEventToPlayer("agrp.loginSuccess", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerLoginFailedGUI(client, errorMessage) { function showPlayerLoginFailedGUI(client, errorMessage) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending login failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.loginFailed", client, errorMessage); sendNetworkEventToPlayer("agrp.loginFailed", client, errorMessage);
} }
// =========================================================================== // ===========================================================================
function showPlayerRegistrationSuccessGUI(client) { function showPlayerRegistrationSuccessGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration success GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.registrationSuccess", client); sendNetworkEventToPlayer("agrp.registrationSuccess", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerRegistrationFailedGUI(client, errorMessage) { function showPlayerRegistrationFailedGUI(client, errorMessage) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending registration failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.registrationFailed", client, errorMessage); sendNetworkEventToPlayer("agrp.registrationFailed", client, errorMessage);
} }
// =========================================================================== // ===========================================================================
function sendPlayerGUIColours(client) { function sendPlayerGUIColours(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI colours to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]); sendNetworkEventToPlayer("agrp.guiColour", client, getServerConfig().guiColourPrimary[0], getServerConfig().guiColourPrimary[1], getServerConfig().guiColourPrimary[2], getServerConfig().guiColourSecondary[0], getServerConfig().guiColourSecondary[1], getServerConfig().guiColourSecondary[2], getServerConfig().guiTextColourPrimary[0], getServerConfig().guiTextColourPrimary[1], getServerConfig().guiTextColourPrimary[2]);
} }
// =========================================================================== // ===========================================================================
function sendPlayerGUIInit(client) { function sendPlayerGUIInit(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending GUI init signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.guiInit", client); sendNetworkEventToPlayer("agrp.guiInit", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerLoginGUI(client, errorMessage = "") { function showPlayerLoginGUI(client, errorMessage = "") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show login GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showLogin", client); sendNetworkEventToPlayer("agrp.showLogin", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerRegistrationGUI(client, errorMessage = "") { function showPlayerRegistrationGUI(client, errorMessage = "") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show registration GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showRegistration", client); sendNetworkEventToPlayer("agrp.showRegistration", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerNewCharacterGUI(client) { function showPlayerNewCharacterGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show new character GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showNewCharacter", client); sendNetworkEventToPlayer("agrp.showNewCharacter", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerChangePasswordGUI(client, errorMessage = "") { function showPlayerChangePasswordGUI(client, errorMessage = "") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showChangePassword", client, errorMessage); sendNetworkEventToPlayer("agrp.showChangePassword", client, errorMessage);
} }
// =========================================================================== // ===========================================================================
function showPlayerResetPasswordCodeInputGUI(client) { function showPlayerResetPasswordCodeInputGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password code input GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showResetPasswordCodeInput", client); sendNetworkEventToPlayer("agrp.showResetPasswordCodeInput", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerResetPasswordEmailInputGUI(client) { function showPlayerResetPasswordEmailInputGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show reset password email input GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showResetPasswordEmailInput", client); sendNetworkEventToPlayer("agrp.showResetPasswordEmailInput", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { function showPlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); sendNetworkEventToPlayer("agrp.showCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
} }
// =========================================================================== // ===========================================================================
function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) { function updatePlayerCharacterSelectGUI(client, firstName, lastName, cash, clan, lastPlayed, skin) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending update character select GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin); sendNetworkEventToPlayer("agrp.switchCharacterSelect", client, firstName, lastName, cash, clan, lastPlayed, skin);
} }
// =========================================================================== // ===========================================================================
function showPlayerCharacterSelectSuccessGUI(client) { function showPlayerCharacterSelectSuccessGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select success GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.characterSelectSuccess", client); sendNetworkEventToPlayer("agrp.characterSelectSuccess", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerCharacterSelectFailedGUI(client) { function showPlayerCharacterSelectFailedGUI(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending character select failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.characterSelectFailed", client); sendNetworkEventToPlayer("agrp.characterSelectFailed", client);
} }
// =========================================================================== // ===========================================================================
function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") { function showPlayerPromptGUI(client, promptMessage, promptTitle, yesButtonText = "Yes", noButtonText = "No") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show prompt GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${promptTitle}, Message: ${promptMessage}, YesButton: ${yesButtonText}, NoButton: ${noButtonText})`);
sendNetworkEventToPlayer("vrr.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText); sendNetworkEventToPlayer("agrp.showPrompt", client, promptMessage, promptTitle, yesButtonText, noButtonText);
} }
// =========================================================================== // ===========================================================================
function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") { function showPlayerInfoGUI(client, infoMessage, infoTitle, buttonText = "OK") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show info GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${infoTitle}, Message: ${infoMessage})`);
sendNetworkEventToPlayer("vrr.showInfo", client, infoMessage, infoTitle, buttonText); sendNetworkEventToPlayer("agrp.showInfo", client, infoMessage, infoTitle, buttonText);
} }
// =========================================================================== // ===========================================================================
function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") { function showPlayerErrorGUI(client, errorMessage, errorTitle, buttonText = "OK") {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending show error GUI signal to ${getPlayerDisplayForConsole(client)} (Title: ${errorTitle}, Message: ${errorMessage})`);
sendNetworkEventToPlayer("vrr.showError", client, errorMessage, errorTitle, buttonText); sendNetworkEventToPlayer("agrp.showError", client, errorMessage, errorTitle, buttonText);
} }
// =========================================================================== // ===========================================================================
function sendRunCodeToClient(client, code, returnTo) { function sendRunCodeToClient(client, code, returnTo) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending runcode to ${getPlayerDisplayForConsole(client)} (returnTo: ${getPlayerDisplayForConsole(getClientFromIndex(returnTo))}, Code: ${code})`);
sendNetworkEventToPlayer("vrr.runCode", client, code, getPlayerId(returnTo)); sendNetworkEventToPlayer("agrp.runCode", client, code, getPlayerId(returnTo));
} }
// =========================================================================== // ===========================================================================
function sendPlayerWorkingState(client, state) { function sendPlayerWorkingState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending working state (${toUpperCase(getYesNoFromBool(state))}) to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.working", client, state); sendNetworkEventToPlayer("agrp.working", client, state);
} }
// =========================================================================== // ===========================================================================
function sendPlayerJobType(client, jobType) { function sendPlayerJobType(client, jobType) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending job type (${jobType}) to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.jobType", client, jobType); sendNetworkEventToPlayer("agrp.jobType", client, jobType);
} }
// =========================================================================== // ===========================================================================
function sendPlayerStopJobRoute(client) { function sendPlayerStopJobRoute(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to abort job route to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.hideJobRouteLocation", client); sendNetworkEventToPlayer("agrp.hideJobRouteLocation", client);
} }
// =========================================================================== // ===========================================================================
function sendPlayerMouseCameraToggle(client) { function sendPlayerMouseCameraToggle(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.mouseCamera", client); sendNetworkEventToPlayer("agrp.mouseCamera", client);
} }
// =========================================================================== // ===========================================================================
function setPlayerMouseCameraState(client, state) { function setPlayerMouseCameraState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse camera ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.mouseCameraForce", client, state); sendNetworkEventToPlayer("agrp.mouseCameraForce", client, state);
} }
// =========================================================================== // ===========================================================================
function sendPlayerMouseCursorToggle(client) { function sendPlayerMouseCursorToggle(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to toggle mouse cursor ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.mouseCursor", client); sendNetworkEventToPlayer("agrp.mouseCursor", client);
} }
// =========================================================================== // ===========================================================================
function sendAddAccountKeyBindToClient(client, key, keyState) { function sendAddAccountKeyBindToClient(client, key, keyState) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
sendNetworkEventToPlayer("vrr.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP); sendNetworkEventToPlayer("agrp.addKeyBind", client, toInteger(key), (keyState) ? KEYSTATE_DOWN : KEYSTATE_UP);
} }
// =========================================================================== // ===========================================================================
function sendClearKeyBindsToClient(client, key, keyState) { function sendClearKeyBindsToClient(client, key, keyState) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending added keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))}, State: ${(keyState) ? "down" : "up"})`);
sendNetworkEventToPlayer("vrr.clearKeyBinds", client); sendNetworkEventToPlayer("agrp.clearKeyBinds", client);
} }
// =========================================================================== // ===========================================================================
function sendRemoveAccountKeyBindToClient(client, key) { function sendRemoveAccountKeyBindToClient(client, key) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending deleted keybind to ${getPlayerDisplayForConsole(client)} (Key: ${toUpperCase(getKeyNameFromId(key))})`);
sendNetworkEventToPlayer("vrr.delKeyBind", client, toInteger(key)); sendNetworkEventToPlayer("agrp.delKeyBind", client, toInteger(key));
} }
// =========================================================================== // ===========================================================================
function sendPlayerSetPosition(client, position) { function sendPlayerSetPosition(client, position) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending set position signal to ${getPlayerDisplayForConsole(client)} (Position: ${position.x}, ${position.y}, ${position.z})`);
sendNetworkEventToPlayer("vrr.position", client, position); sendNetworkEventToPlayer("agrp.position", client, position);
} }
// =========================================================================== // ===========================================================================
function sendPlayerSetHeading(client, heading) { function sendPlayerSetHeading(client, heading) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending set heading signal to ${getPlayerDisplayForConsole(client)} (Heading: ${heading})`);
sendNetworkEventToPlayer("vrr.heading", client, heading); sendNetworkEventToPlayer("agrp.heading", client, heading);
} }
// =========================================================================== // ===========================================================================
function sendPlayerSetInterior(client, interior) { function sendPlayerSetInterior(client, interior) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending set interior signal to ${getPlayerDisplayForConsole(client)} (Interior: ${interior})`);
sendNetworkEventToPlayer("vrr.interior", client, interior); sendNetworkEventToPlayer("agrp.interior", client, interior);
} }
// =========================================================================== // ===========================================================================
function sendPlayerFrozenState(client, state) { function sendPlayerFrozenState(client, state) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending set frozen signal to ${getPlayerDisplayForConsole(client)} (State: ${toUpperCase(getYesNoFromBool(state))})`);
sendNetworkEventToPlayer("vrr.frozen", client, state); sendNetworkEventToPlayer("agrp.frozen", client, state);
} }
// =========================================================================== // ===========================================================================
function clearPlayerWeapons(client, clearData = true) { function clearPlayerWeapons(client, clearData = true) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to clear weapons`);
sendNetworkEventToPlayer("vrr.clearWeapons", client, clearData); sendNetworkEventToPlayer("agrp.clearWeapons", client, clearData);
} }
// =========================================================================== // ===========================================================================
function showPlayerNewCharacterFailedGUI(client, errorMessage) { function showPlayerNewCharacterFailedGUI(client, errorMessage) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending new character failed GUI signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.newCharacterFailed", client, errorMessage); sendNetworkEventToPlayer("agrp.newCharacterFailed", client, errorMessage);
} }
// =========================================================================== // ===========================================================================
function sendPlayerRemoveFromVehicle(client) { function sendPlayerRemoveFromVehicle(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Sending remove from vehicle signal to ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.removeFromVehicle", client); sendNetworkEventToPlayer("agrp.removeFromVehicle", client);
} }
// =========================================================================== // ===========================================================================
@@ -653,7 +653,7 @@ function showPlayerItemTakeDelay(client, itemId) {
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item TAKE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -668,7 +668,7 @@ function showPlayerItemUseDelay(client, itemSlot) {
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay; let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).useDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item USE delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -683,7 +683,7 @@ function showPlayerItemDropDelay(client, itemSlot) {
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay; let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).dropDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item DROP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -698,7 +698,7 @@ function showPlayerItemPickupDelay(client, itemId) {
let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay; let delay = getItemTypeData(getItemData(itemId).itemTypeIndex).pickupDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PICKUP delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -713,7 +713,7 @@ function showPlayerItemPutDelay(client, itemSlot) {
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay; let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).putDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item PUT delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -729,7 +729,7 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay; let delay = getItemTypeData(getItemData(getPlayerData(client).hotBarItems[itemSlot]).itemTypeIndex).switchDelay;
if (delay > 0) { if (delay > 0) {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (${delay} milliseconds)`);
sendNetworkEventToPlayer("vrr.showItemActionDelay", client, delay); sendNetworkEventToPlayer("agrp.showItemActionDelay", client, delay);
} else { } else {
logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`); logToConsole(LOG_DEBUG, `[VRR.Client] Showing item switch delay to ${getPlayerDisplayForConsole(client)} (instant)`);
playerItemActionDelayComplete(client); playerItemActionDelayComplete(client);
@@ -748,14 +748,14 @@ function showPlayerItemSwitchDelay(client, itemSlot) {
function sendPlayerDrunkEffect(client, amount, duration) { function sendPlayerDrunkEffect(client, amount, duration) {
logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`); logToConsole(LOG_DEBUG, `[VRR.Client] Setting drunk effect for ${getPlayerDisplayForConsole(client)} to ${amount} for ${duration} milliseconds`);
sendNetworkEventToPlayer("vrr.drunkEffect", client, amount, duration); sendNetworkEventToPlayer("agrp.drunkEffect", client, amount, duration);
} }
// =========================================================================== // ===========================================================================
function sendPlayerClearPedState(client) { function sendPlayerClearPedState(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`); logToConsole(LOG_DEBUG, `[VRR.Client] Clearing ped state for ${getPlayerDisplayForConsole(client)}`);
sendNetworkEventToPlayer("vrr.clearPedState", client); sendNetworkEventToPlayer("agrp.clearPedState", client);
} }
// =========================================================================== // ===========================================================================
@@ -813,13 +813,13 @@ function playerDamagedByPlayer(client, damagerEntityName, weaponId, pedPiece, he
// =========================================================================== // ===========================================================================
function setPlayerCameraLookAt(client, cameraPosition, lookAtPosition) { function setPlayerCameraLookAt(client, cameraPosition, lookAtPosition) {
sendNetworkEventToPlayer("vrr.cameraLookAt", client, cameraPosition, lookAtPosition); sendNetworkEventToPlayer("agrp.cameraLookAt", client, cameraPosition, lookAtPosition);
} }
// =========================================================================== // ===========================================================================
function sendTimeMinuteDurationToPlayer(client, minuteDuration) { function sendTimeMinuteDurationToPlayer(client, minuteDuration) {
sendNetworkEventToPlayer("vrr.minuteDuration", client, minuteDuration); sendNetworkEventToPlayer("agrp.minuteDuration", client, minuteDuration);
} }
// =========================================================================== // ===========================================================================
@@ -862,13 +862,13 @@ function forcePlayerIntoSkinSelect(client) {
setPlayerDimension(client, getPlayerId(client) + 500); setPlayerDimension(client, getPlayerId(client) + 500);
} }
sendNetworkEventToPlayer("vrr.skinSelect", client, true); sendNetworkEventToPlayer("agrp.skinSelect", client, true);
} }
// =========================================================================== // ===========================================================================
function updatePlayerCash(client) { function updatePlayerCash(client) {
sendNetworkEventToPlayer("vrr.money", client, getPlayerCurrentSubAccount(client).cash); sendNetworkEventToPlayer("agrp.money", client, getPlayerCurrentSubAccount(client).cash);
} }
// =========================================================================== // ===========================================================================
@@ -886,7 +886,7 @@ function sendAllPoliceStationBlips(client) {
getColourByName("policeBlue"), getColourByName("policeBlue"),
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
@@ -905,7 +905,7 @@ function sendAllFireStationBlips(client) {
getColourByName("firefighterRed"), getColourByName("firefighterRed"),
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
@@ -924,7 +924,7 @@ function sendAllHospitalBlips(client) {
getColourByName("medicPink"), getColourByName("medicPink"),
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
@@ -943,7 +943,7 @@ function sendAllAmmunationBlips(client) {
0 0
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
@@ -962,7 +962,7 @@ function sendAllPayAndSprayBlips(client) {
0 0
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
@@ -981,26 +981,26 @@ function sendAllFuelStationBlips(client) {
getColourByName("burntOrange"), getColourByName("burntOrange"),
]); ]);
} }
sendNetworkEventToPlayer("vrr.blips", client, tempBlips); sendNetworkEventToPlayer("agrp.blips", client, tempBlips);
} }
} }
// =========================================================================== // ===========================================================================
function sendPlayerSetHealth(client, health) { function sendPlayerSetHealth(client, health) {
sendNetworkEventToPlayer("vrr.health", client, toInteger(health)); sendNetworkEventToPlayer("agrp.health", client, toInteger(health));
} }
// =========================================================================== // ===========================================================================
function sendPlayerSetArmour(client, armour) { function sendPlayerSetArmour(client, armour) {
sendNetworkEventToPlayer("vrr.armour", client, armour); sendNetworkEventToPlayer("agrp.armour", client, armour);
} }
// =========================================================================== // ===========================================================================
function playerFinishedSkinSelection(client, allowedSkinIndex) { function playerFinishedSkinSelection(client, allowedSkinIndex) {
sendNetworkEventToPlayer("vrr.skinSelect", client, false); sendNetworkEventToPlayer("agrp.skinSelect", client, false);
if (allowedSkinIndex == -1) { if (allowedSkinIndex == -1) {
messagePlayerAlert(client, "You canceled the skin change."); messagePlayerAlert(client, "You canceled the skin change.");
restorePlayerCamera(client); restorePlayerCamera(client);
@@ -1052,34 +1052,34 @@ function playerFinishedSkinSelection(client, allowedSkinIndex) {
// =========================================================================== // ===========================================================================
function sendPlayerChatScrollLines(client, amount) { function sendPlayerChatScrollLines(client, amount) {
sendNetworkEventToPlayer("vrr.chatScrollLines", client, amount); sendNetworkEventToPlayer("agrp.chatScrollLines", client, amount);
} }
// =========================================================================== // ===========================================================================
function sendPlayerChatAutoHideDelay(client, delay) { function sendPlayerChatAutoHideDelay(client, delay) {
sendNetworkEventToPlayer("vrr.chatAutoHideDelay", client, delay); sendNetworkEventToPlayer("agrp.chatAutoHideDelay", client, delay);
} }
// =========================================================================== // ===========================================================================
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) { function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`); logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element); sendNetworkEventToPlayer("agrp.radioStream", client, streamURL, loop, volume, element);
} }
// =========================================================================== // ===========================================================================
function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) { function playAudioFileForPlayer(client, audioName, loop = true, volume = 0, element = false) {
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`); logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to play audio ${audioName}`);
sendNetworkEventToPlayer("vrr.audioFileStream", client, audioName, loop, volume); sendNetworkEventToPlayer("agrp.audioFileStream", client, audioName, loop, volume);
} }
// =========================================================================== // ===========================================================================
function stopRadioStreamForPlayer(client) { function stopRadioStreamForPlayer(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`); logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`);
sendNetworkEventToPlayer("vrr.stopRadioStream", client); sendNetworkEventToPlayer("agrp.stopRadioStream", client);
} }
// =========================================================================== // ===========================================================================
@@ -1087,65 +1087,65 @@ function stopRadioStreamForPlayer(client) {
function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) { function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) {
getPlayerData(client).accountData.streamingRadioVolume = volumeLevel; getPlayerData(client).accountData.streamingRadioVolume = volumeLevel;
getPlayerData(client).streamingRadioElement = elementId; getPlayerData(client).streamingRadioElement = elementId;
sendNetworkEventToPlayer("vrr.radioVolume", client, volumeLevel, elementId); sendNetworkEventToPlayer("agrp.radioVolume", client, volumeLevel, elementId);
} }
// =========================================================================== // ===========================================================================
function setVehicleLightsState(vehicle, state) { function setVehicleLightsState(vehicle, state) {
setEntityData(vehicle, "vrr.lights", getVehicleData(vehicle).lights); setEntityData(vehicle, "agrp.lights", getVehicleData(vehicle).lights);
sendNetworkEventToPlayer("vrr.veh.lights", null, vehicle.id, state); sendNetworkEventToPlayer("agrp.veh.lights", null, vehicle.id, state);
} }
// =========================================================================== // ===========================================================================
function sendPlayerEnterPropertyKey(client, key) { function sendPlayerEnterPropertyKey(client, key) {
sendNetworkEventToPlayer("vrr.enterPropertyKey", client, key); sendNetworkEventToPlayer("agrp.enterPropertyKey", client, key);
} }
// =========================================================================== // ===========================================================================
function makePedPlayAnimation(ped, animationSlot, positionOffset) { function makePedPlayAnimation(ped, animationSlot, positionOffset) {
setEntityData(ped, "vrr.anim", animationSlot, true); setEntityData(ped, "agrp.anim", animationSlot, true);
sendNetworkEventToPlayer("vrr.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); sendNetworkEventToPlayer("agrp.anim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
} }
// =========================================================================== // ===========================================================================
function makePedStopAnimation(ped) { function makePedStopAnimation(ped) {
removeEntityData(ped, "vrr.anim"); removeEntityData(ped, "agrp.anim");
sendNetworkEventToPlayer("vrr.stopAnim", null, getPedForNetworkEvent(ped)); sendNetworkEventToPlayer("agrp.stopAnim", null, getPedForNetworkEvent(ped));
} }
// =========================================================================== // ===========================================================================
function forcePedAnimation(ped, animationSlot, positionOffset = 0) { function forcePedAnimation(ped, animationSlot, positionOffset = 0) {
addEntityData(ped, "vrr.anim", animationSlot, true); addEntityData(ped, "agrp.anim", animationSlot, true);
sendNetworkEventToPlayer("vrr.forceAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset); sendNetworkEventToPlayer("agrp.forceAnim", null, getPedForNetworkEvent(ped), animationSlot, positionOffset);
} }
// =========================================================================== // ===========================================================================
function hideAllPlayerGUI(client) { function hideAllPlayerGUI(client) {
sendNetworkEventToPlayer("vrr.hideAllGUI", client); sendNetworkEventToPlayer("agrp.hideAllGUI", client);
} }
// =========================================================================== // ===========================================================================
function requestClientInfo(client) { function requestClientInfo(client) {
sendNetworkEventToPlayer("vrr.clientInfo", client); sendNetworkEventToPlayer("agrp.clientInfo", client);
} }
// =========================================================================== // ===========================================================================
function updateInteriorLightsForPlayer(client, state) { function updateInteriorLightsForPlayer(client, state) {
sendNetworkEventToPlayer("vrr.interiorLights", client, state); sendNetworkEventToPlayer("agrp.interiorLights", client, state);
} }
// =========================================================================== // ===========================================================================
function forcePlayerToSyncElementProperties(client, element) { function forcePlayerToSyncElementProperties(client, element) {
sendNetworkEventToPlayer("vrr.syncElement", client, element.id); sendNetworkEventToPlayer("agrp.syncElement", client, element.id);
} }
// =========================================================================== // ===========================================================================
@@ -1154,7 +1154,7 @@ function sendPlayerPedPartsAndProps(client) {
let bodyParts = getPlayerCurrentSubAccount(client).bodyParts; let bodyParts = getPlayerCurrentSubAccount(client).bodyParts;
let bodyProps = getPlayerCurrentSubAccount(client).bodyProps; let bodyProps = getPlayerCurrentSubAccount(client).bodyProps;
sendNetworkEventToPlayer("vrr.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]); sendNetworkEventToPlayer("agrp.ped", client, [bodyParts.hair, bodyParts.head, bodyParts.upper, bodyParts.lower], [bodyProps.hair, bodyProps.eyes, bodyProps.head, bodyProps.leftHand, bodyProps.rightHand, bodyProps.leftWrist, bodyProps.rightWrist, bodyParts.hip, bodyProps.leftFoot, bodyProps.rightFoot]);
} }
// =========================================================================== // ===========================================================================
@@ -1179,7 +1179,7 @@ function updateAllInteriorVehiclesForPlayer(client, interior, dimension) {
function setPlayerBuyingVehicleState(client, state, vehicleId, position) { function setPlayerBuyingVehicleState(client, state, vehicleId, position) {
if (getGlobalConfig().useServerSideVehiclePurchaseCheck == false) { if (getGlobalConfig().useServerSideVehiclePurchaseCheck == false) {
sendNetworkEventToPlayer("vrr.vehBuyState", client, state, vehicleId, position); sendNetworkEventToPlayer("agrp.vehBuyState", client, state, vehicleId, position);
} }
} }
@@ -1194,37 +1194,37 @@ function receiveVehiclePurchaseStateUpdateFromClient(client, state) {
// =========================================================================== // ===========================================================================
function sendPlayerLogLevel(client, tempLogLevel = logLevel) { function sendPlayerLogLevel(client, tempLogLevel = logLevel) {
sendNetworkEventToPlayer("vrr.logLevel", client, tempLogLevel); sendNetworkEventToPlayer("agrp.logLevel", client, tempLogLevel);
} }
// ========================================================================== // ==========================================================================
function setPlayerInfiniteRun(client, state) { function setPlayerInfiniteRun(client, state) {
sendNetworkEventToPlayer("vrr.infiniteRun", client, state); sendNetworkEventToPlayer("agrp.infiniteRun", client, state);
} }
// ========================================================================== // ==========================================================================
function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) { function sendBusinessToPlayer(client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
sendNetworkEventToPlayer("vrr.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems); sendNetworkEventToPlayer("agrp.business", client, businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
} }
// ========================================================================== // ==========================================================================
function sendHouseToPlayer(client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) { function sendHouseToPlayer(client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior) {
sendNetworkEventToPlayer("vrr.house", client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior); sendNetworkEventToPlayer("agrp.house", client, houseId, description, entrancePosition, blipModel, pickupModel, hasInterior);
} }
// ========================================================================== // ==========================================================================
function sendJobToPlayer(client, jobId, jobLocationId, name, position) { function sendJobToPlayer(client, jobId, jobLocationId, name, position) {
sendNetworkEventToPlayer("vrr.job", client, jobId, jobLocationId, name, position); sendNetworkEventToPlayer("agrp.job", client, jobId, jobLocationId, name, position);
} }
// ========================================================================== // ==========================================================================
function sendVehicleToPlayer(client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4) { function sendVehicleToPlayer(client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4) {
sendNetworkEventToPlayer("vrr.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4); sendNetworkEventToPlayer("agrp.vehicle", client, vehicleId, model, position, heading, colour1, colour2, colour3, colour4);
} }
// ========================================================================== // ==========================================================================
@@ -1268,7 +1268,7 @@ function sendAllVehiclesToPlayer(client) {
// ========================================================================== // ==========================================================================
function makePlayerHoldObjectModel(client, modelIndex) { function makePlayerHoldObjectModel(client, modelIndex) {
sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).ped, modelIndex); sendNetworkEventToPlayer("agrp.holdObject", client, getPlayerData(client).ped, modelIndex);
} }
// ========================================================================== // ==========================================================================
@@ -1280,44 +1280,44 @@ function receivePlayerPedNetworkId(client, pedId) {
// ========================================================================== // ==========================================================================
function requestPlayerPedNetworkId(client) { function requestPlayerPedNetworkId(client) {
sendNetworkEventToPlayer("vrr.playerPedId", client); sendNetworkEventToPlayer("agrp.playerPedId", client);
} }
// ========================================================================== // ==========================================================================
function setPlayerInCutsceneInterior(client, cutsceneName) { function setPlayerInCutsceneInterior(client, cutsceneName) {
getPlayerData(client).interiorCutscene = cutsceneName; getPlayerData(client).interiorCutscene = cutsceneName;
sendNetworkEventToPlayer("vrr.cutsceneInterior", client, cutsceneName); sendNetworkEventToPlayer("agrp.cutsceneInterior", client, cutsceneName);
} }
// ========================================================================== // ==========================================================================
function makePlayerPedSpeak(client, pedSpeechName) { function makePlayerPedSpeak(client, pedSpeechName) {
sendNetworkEventToPlayer("vrr.pedSpeak", client, pedSpeechName); sendNetworkEventToPlayer("agrp.pedSpeak", client, pedSpeechName);
} }
// ========================================================================== // ==========================================================================
function setPlayerAsCopState(client, state) { function setPlayerAsCopState(client, state) {
sendNetworkEventToPlayer("vrr.playerCop", client, state); sendNetworkEventToPlayer("agrp.playerCop", client, state);
} }
// ========================================================================== // ==========================================================================
function tellPlayerToSpawn(client, skinId, position) { function tellPlayerToSpawn(client, skinId, position) {
sendNetworkEventToPlayer("vrr.spawn", client, skinId, position); sendNetworkEventToPlayer("agrp.spawn", client, skinId, position);
} }
// ========================================================================== // ==========================================================================
function sendNameTagDistanceToClient(client, distance) { function sendNameTagDistanceToClient(client, distance) {
sendNetworkEventToPlayer("vrr.nameTagDistance", client, distance); sendNetworkEventToPlayer("agrp.nameTagDistance", client, distance);
} }
// ========================================================================== // ==========================================================================
function sendGPSBlipToPlayer(client, position, colour) { function sendGPSBlipToPlayer(client, position, colour) {
sendNetworkEventToPlayer("vrr.showGPSBlip", client, position, colour); sendNetworkEventToPlayer("agrp.showGPSBlip", client, position, colour);
} }
// ========================================================================== // ==========================================================================
@@ -1330,13 +1330,13 @@ function playerSelectedNewLocale(client, localeId) {
// ========================================================================== // ==========================================================================
function sendPlayerLocaleId(client, localeId) { function sendPlayerLocaleId(client, localeId) {
sendNetworkEventToPlayer("vrr.locale", client, localeId); sendNetworkEventToPlayer("agrp.locale", client, localeId);
} }
// ========================================================================== // ==========================================================================
function showLocaleChooserForPlayer(client) { function showLocaleChooserForPlayer(client) {
sendNetworkEventToPlayer("vrr.localeChooser", client); sendNetworkEventToPlayer("agrp.localeChooser", client);
} }
// ========================================================================== // ==========================================================================
@@ -1344,14 +1344,20 @@ function showLocaleChooserForPlayer(client) {
function sendPlayerLocaleStrings(client) { function sendPlayerLocaleStrings(client) {
let strings = getGlobalConfig().locale.sendStringsToClient; let strings = getGlobalConfig().locale.sendStringsToClient;
for (let i in strings) { for (let i in strings) {
sendNetworkEventToPlayer("vrr.localeString", client, strings[i], getLocaleString(client, strings[i])); sendNetworkEventToPlayer("agrp.localeString", client, strings[i], getLocaleString(client, strings[i]));
} }
} }
// ========================================================================== // ==========================================================================
function playerMouseCameraReady(client) { function playerMouseCameraReady(client) {
sendNetworkEventToPlayer("agrp.mouseCamera", client, false); setPlayerMouseCameraState(client, false);
}
// ==========================================================================
function setPlayerRenderLabelsState(client, state) {
sendNetworkEventToPlayer("agrp.renderLabels", client, state);
} }
// ========================================================================== // ==========================================================================

View File

@@ -466,11 +466,11 @@ function spawnNPC(npcIndex) {
let ped = createGamePed(npcData.skin, npcData.position, npcData.rotation.z); let ped = createGamePed(npcData.skin, npcData.position, npcData.rotation.z);
if (ped) { if (ped) {
getNPCData(npcIndex).ped = ped; getNPCData(npcIndex).ped = ped;
setEntityData(ped, "vrr.dataIndex", npcIndex, false); setEntityData(ped, "agrp.dataIndex", npcIndex, false);
if (npcData.animationName != "") { if (npcData.animationName != "") {
let animationId = getAnimationFromParams(npcData.animationName); let animationId = getAnimationFromParams(npcData.animationName);
if (animationId != false) { if (animationId != false) {
setEntityData(ped, "vrr.anim", animationId, true); setEntityData(ped, "agrp.anim", animationId, true);
} }
} }
setElementDimension(ped, npcData.dimension); setElementDimension(ped, npcData.dimension);
@@ -590,7 +590,7 @@ function toggleNPCLookAtClosestPlayerCommand(command, params, client) {
getNPCData(closestNPC).lookAtClosestPlayer = !getNPCData(closestNPC).lookAtClosestPlayer; getNPCData(closestNPC).lookAtClosestPlayer = !getNPCData(closestNPC).lookAtClosestPlayer;
getNPCData(closestNPC).needsSaved = true; getNPCData(closestNPC).needsSaved = true;
setEntityData(getNPCData(closestNPC).ped, "vrr.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true); setEntityData(getNPCData(closestNPC).ped, "agrp.lookAtClosestPlayer", getNPCData(closestNPC).lookAtClosestPlayer, true);
forcePlayerToSyncElementProperties(null, getNPCData(closestNPC).ped); forcePlayerToSyncElementProperties(null, getNPCData(closestNPC).ped);
//messagePlayerSuccess(client, getLocaleString(client, "NPCLookAtClosestPlayerSet", `{ALTCOLOUR}${getNPCData(closestNPC).name}{MAINCOLOUR})); //messagePlayerSuccess(client, getLocaleString(client, "NPCLookAtClosestPlayerSet", `{ALTCOLOUR}${getNPCData(closestNPC).name}{MAINCOLOUR}));
} }

View File

@@ -16,7 +16,7 @@ class RadioStationData {
this.codec = ""; this.codec = "";
this.index = -1; this.index = -1;
if(dbAssoc) { if (dbAssoc) {
this.databaseId = dbAssoc["radio_id"]; this.databaseId = dbAssoc["radio_id"];
this.name = dbAssoc["radio_name"]; this.name = dbAssoc["radio_name"];
this.url = dbAssoc["radio_url"]; this.url = dbAssoc["radio_url"];
@@ -41,11 +41,11 @@ function loadRadioStationsFromDatabase() {
let dbConnection = connectToDatabase(); let dbConnection = connectToDatabase();
let tempRadioStations = []; let tempRadioStations = [];
let dbAssoc; let dbAssoc;
if(dbConnection) { if (dbConnection) {
let dbQueryString = `SELECT * FROM radio_main`; let dbQueryString = `SELECT * FROM radio_main`;
let dbQuery = queryDatabase(dbConnection, dbQueryString); let dbQuery = queryDatabase(dbConnection, dbQueryString);
if(dbQuery) { if (dbQuery) {
while(dbAssoc = fetchQueryAssoc(dbQuery)) { while (dbAssoc = fetchQueryAssoc(dbQuery)) {
let tempRadioStationData = new RadioStationData(dbAssoc); let tempRadioStationData = new RadioStationData(dbAssoc);
tempRadioStations.push(tempRadioStationData); tempRadioStations.push(tempRadioStationData);
} }
@@ -70,7 +70,7 @@ function loadRadioStationsFromDatabase() {
* *
*/ */
function playStreamingRadioCommand(command, params, client) { function playStreamingRadioCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
messagePlayerInfo(client, "Use /radiostations for a list of available radio stations."); messagePlayerInfo(client, "Use /radiostations for a list of available radio stations.");
return false; return false;
@@ -78,96 +78,96 @@ function playStreamingRadioCommand(command, params, client) {
let radioStationId = getRadioStationFromParams(params); let radioStationId = getRadioStationFromParams(params);
if(radioStationId != 0 && typeof getServerData().radioStations[radioStationId-1] == "undefined") { if (radioStationId != 0 && typeof getServerData().radioStations[radioStationId - 1] == "undefined") {
messagePlayerError(client, getLocaleString(client, "InvalidRadioStation")); messagePlayerError(client, getLocaleString(client, "InvalidRadioStation"));
return false; return false;
} }
if(isPlayerInAnyVehicle(client)) { if (isPlayerInAnyVehicle(client)) {
let vehicle = getPlayerVehicle(client); let vehicle = getPlayerVehicle(client);
if(!getVehicleData(vehicle)) { if (!getVehicleData(vehicle)) {
messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled")); messagePlayerError(client, getLocaleString(client, "RandomVehicleCommandsDisabled"));
return false; return false;
} }
if(radioStationId == 0) { if (radioStationId == 0) {
getVehicleData(vehicle).streamingRadioStation = -1; getVehicleData(vehicle).streamingRadioStation = -1;
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
getPlayerData(client).streamingRadioStation = -1; getPlayerData(client).streamingRadioStation = -1;
meActionToNearbyPlayers(client, `turns off their vehicle's radio`); meActionToNearbyPlayers(client, `turns off their vehicle's radio`);
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerVehicle(client) == getPlayerVehicle(clients[i])) { if (getPlayerVehicle(client) == getPlayerVehicle(clients[i])) {
playRadioStreamForPlayer(clients[i], ""); playRadioStreamForPlayer(clients[i], "");
} }
} }
return false; return false;
} }
getVehicleData(vehicle).streamingRadioStation = radioStationId-1; getVehicleData(vehicle).streamingRadioStation = radioStationId - 1;
getPlayerData(client).streamingRadioStation = radioStationId-1; getPlayerData(client).streamingRadioStation = radioStationId - 1;
meActionToNearbyPlayers(client, getLocaleString(client, "ActionVehicleRadioStationChange", getRadioStationData(radioStationId-1).name, getRadioStationData(radioStationId-1).genre)); meActionToNearbyPlayers(client, getLocaleString(client, "ActionVehicleRadioStationChange", getRadioStationData(radioStationId - 1).name, getRadioStationData(radioStationId - 1).genre));
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(vehicle == getPlayerVehicle(clients[i])) { if (vehicle == getPlayerVehicle(clients[i])) {
playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId-1).url, true, getPlayerStreamingRadioVolume(client)); playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(client));
} }
} }
} else { } else {
if(doesEntityDataExist(client, "vrr.inHouse")) { if (doesEntityDataExist(client, "agrp.inHouse")) {
let houseId = getEntityData(client, "vrr.inHouse"); let houseId = getEntityData(client, "agrp.inHouse");
if(radioStationId == 0) { if (radioStationId == 0) {
getHouseData(houseId).streamingRadioStation = -1; getHouseData(houseId).streamingRadioStation = -1;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
getPlayerData(client).streamingRadioStation = -1; getPlayerData(client).streamingRadioStation = -1;
meActionToNearbyPlayers(client, `turns off the house radio`); meActionToNearbyPlayers(client, `turns off the house radio`);
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getEntityData(clients[i], "vrr.inHouse") == houseId) { if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], ""); playRadioStreamForPlayer(clients[i], "");
} }
} }
} else { } else {
getHouseData(houseId).streamingRadioStation = radioStationId-1; getHouseData(houseId).streamingRadioStation = radioStationId - 1;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
getPlayerData(client).streamingRadioStation = radioStationId-1; getPlayerData(client).streamingRadioStation = radioStationId - 1;
meActionToNearbyPlayers(client, getLocaleString(client, "ActionHouseRadioStationChange", getRadioStationData(radioStationId-1).name, getRadioStationData(radioStationId-1).genre)); meActionToNearbyPlayers(client, getLocaleString(client, "ActionHouseRadioStationChange", getRadioStationData(radioStationId - 1).name, getRadioStationData(radioStationId - 1).genre));
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getEntityData(clients[i], "vrr.inHouse") == houseId) { if (getEntityData(clients[i], "agrp.inHouse") == houseId) {
playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId-1).url, true, getPlayerStreamingRadioVolume(clients[i])); playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i]));
} }
} }
} }
} else if(isPlayerInAnyBusiness(client)) { } else if (isPlayerInAnyBusiness(client)) {
let businessId = getPlayerBusiness(client); let businessId = getPlayerBusiness(client);
if(radioStationId == 0) { if (radioStationId == 0) {
getBusinessData(businessId).streamingRadioStation = -1; getBusinessData(businessId).streamingRadioStation = -1;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
getPlayerData(client).streamingRadioStation = -1; getPlayerData(client).streamingRadioStation = -1;
meActionToNearbyPlayers(client, `turns off the business radio`); meActionToNearbyPlayers(client, `turns off the business radio`);
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerBusiness(clients[i]) == businessId) { if (getPlayerBusiness(clients[i]) == businessId) {
stopRadioStreamForPlayer(clients[i]); stopRadioStreamForPlayer(clients[i]);
} }
} }
} else { } else {
getBusinessData(businessId).streamingRadioStation = radioStationId-1; getBusinessData(businessId).streamingRadioStation = radioStationId - 1;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
getPlayerData(client).streamingRadioStation = radioStationId-1; getPlayerData(client).streamingRadioStation = radioStationId - 1;
meActionToNearbyPlayers(client, getLocaleString(client, "ActionBusinessRadioStationChange", getRadioStationData(radioStationId-1).name, getRadioStationData(radioStationId-1).genre)); meActionToNearbyPlayers(client, getLocaleString(client, "ActionBusinessRadioStationChange", getRadioStationData(radioStationId - 1).name, getRadioStationData(radioStationId - 1).genre));
let clients = getClients(); let clients = getClients();
for(let i in clients) { for (let i in clients) {
if(getPlayerBusiness(clients[i]) == businessId) { if (getPlayerBusiness(clients[i]) == businessId) {
playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId-1).url, true, getPlayerStreamingRadioVolume(clients[i])); playRadioStreamForPlayer(clients[i], getRadioStationData(radioStationId - 1).url, true, getPlayerStreamingRadioVolume(clients[i]));
} }
} }
} }
@@ -190,14 +190,14 @@ function playStreamingRadioCommand(command, params, client) {
* *
*/ */
function setStreamingRadioVolumeCommand(command, params, client) { function setStreamingRadioVolumeCommand(command, params, client) {
if(areParamsEmpty(params)) { if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command)); messagePlayerSyntax(client, getCommandSyntaxText(command));
return false; return false;
} }
let volumeLevel = params; let volumeLevel = params;
if(isNaN(volumeLevel)) { if (isNaN(volumeLevel)) {
messagePlayerError(client, getLocaleString(client, "RadioVolumeNotNumber")); messagePlayerError(client, getLocaleString(client, "RadioVolumeNotNumber"));
return false; return false;
} }
@@ -205,13 +205,13 @@ function setStreamingRadioVolumeCommand(command, params, client) {
setPlayerStreamingRadioVolume(client, toInteger(volumeLevel)); setPlayerStreamingRadioVolume(client, toInteger(volumeLevel));
getPlayerData(client).accountData.streamingRadioVolume = toInteger(volumeLevel); getPlayerData(client).accountData.streamingRadioVolume = toInteger(volumeLevel);
let volumeEmoji = ''; let volumeEmoji = '';
if(volumeLevel >= 60) { if (volumeLevel >= 60) {
volumeEmoji = '🔊'; volumeEmoji = '🔊';
} else if(volumeLevel >= 30 && volumeLevel < 60) { } else if (volumeLevel >= 30 && volumeLevel < 60) {
volumeEmoji = '🔉'; volumeEmoji = '🔉';
} else if(volumeLevel > 0 && volumeLevel < 30) { } else if (volumeLevel > 0 && volumeLevel < 30) {
volumeEmoji = '🔈'; volumeEmoji = '🔈';
} else if(volumeLevel <= 0) { } else if (volumeLevel <= 0) {
volumeEmoji = '🔇'; volumeEmoji = '🔇';
} }
@@ -221,7 +221,7 @@ function setStreamingRadioVolumeCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function getPlayerStreamingRadioVolume(client) { function getPlayerStreamingRadioVolume(client) {
if(!getPlayerData(client) || !isPlayerLoggedIn(client) || !isPlayerSpawned(client)) { if (!getPlayerData(client) || !isPlayerLoggedIn(client) || !isPlayerSpawned(client)) {
return 20; return 20;
} }
return getPlayerData(client).accountData.streamingRadioVolume; return getPlayerData(client).accountData.streamingRadioVolume;
@@ -239,13 +239,13 @@ function getPlayerStreamingRadioVolume(client) {
* *
*/ */
function showRadioStationListCommand(command, params, client) { function showRadioStationListCommand(command, params, client) {
let stationList = getServerData().radioStations.map(function(x) { return `{ALTCOLOUR}${toInteger(x.index)+1}: {MAINCOLOUR}${x.name}`; }); let stationList = getServerData().radioStations.map(function (x) { return `{ALTCOLOUR}${toInteger(x.index) + 1}: {MAINCOLOUR}${x.name}`; });
let chunkedList = splitArrayIntoChunks(stationList, 4); let chunkedList = splitArrayIntoChunks(stationList, 4);
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderRadioStationsList"))); messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderRadioStationsList")));
for(let i in chunkedList) { for (let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", ")); messagePlayerInfo(client, chunkedList[i].join(", "));
} }
} }
@@ -253,7 +253,7 @@ function showRadioStationListCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function setAllRadioStationIndexes() { function setAllRadioStationIndexes() {
for(let i in getServerData().radioStations) { for (let i in getServerData().radioStations) {
getServerData().radioStations[i].index = i; getServerData().radioStations[i].index = i;
} }
} }
@@ -291,14 +291,14 @@ function reloadAllRadioStationsCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function getRadioStationFromParams(params) { function getRadioStationFromParams(params) {
if(isNaN(params)) { if (isNaN(params)) {
for(let i in getServerData().radioStations) { for (let i in getServerData().radioStations) {
if(toLowerCase(getServerData().radioStations[i].name).indexOf(toLowerCase(params)) != -1) { if (toLowerCase(getServerData().radioStations[i].name).indexOf(toLowerCase(params)) != -1) {
return i; return i;
} }
} }
} else { } else {
if(typeof getServerData().radioStations[params] != "undefined") { if (typeof getServerData().radioStations[params] != "undefined") {
return toInteger(params); return toInteger(params);
} }
} }

View File

@@ -126,7 +126,7 @@ function loadServerDataFromDatabase() {
//getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom); //getServerData().cachedTranslations.fill(getServerData().cachedTranslationFrom);
// Only load these if the server isn't a testing/dev server // Only load these if the server isn't a testing/dev server
if (!getServerConfig().devServer || server.getCVar("agrp_devserver") == 1) { if (!getServerConfig().devServer && server.getCVar("agrp_devserver") == 0) {
getServerData().items = loadItemsFromDatabase(); getServerData().items = loadItemsFromDatabase();
getServerData().businesses = loadBusinessesFromDatabase(); getServerData().businesses = loadBusinessesFromDatabase();
getServerData().houses = loadHousesFromDatabase(); getServerData().houses = loadHousesFromDatabase();

View File

@@ -321,7 +321,7 @@ function spawnAllVehicles() {
for (let i in getServerData().vehicles) { for (let i in getServerData().vehicles) {
let vehicle = spawnVehicle(getServerData().vehicles[i]); let vehicle = spawnVehicle(getServerData().vehicles[i]);
getServerData().vehicles[i].vehicle = vehicle; getServerData().vehicles[i].vehicle = vehicle;
setEntityData(vehicle, "vrr.dataSlot", i, false); setEntityData(vehicle, "agrp.dataSlot", i, false);
setAllVehicleIndexes(); setAllVehicleIndexes();
} }
} }
@@ -335,7 +335,7 @@ function spawnAllVehicles() {
function getVehicleData(vehicle) { function getVehicleData(vehicle) {
if (getGame() != VRR_GAME_GTA_IV) { if (getGame() != VRR_GAME_GTA_IV) {
if (isVehicleObject(vehicle)) { if (isVehicleObject(vehicle)) {
let dataIndex = getEntityData(vehicle, "vrr.dataSlot"); let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
if (typeof getServerData().vehicles[dataIndex] != "undefined") { if (typeof getServerData().vehicles[dataIndex] != "undefined") {
return getServerData().vehicles[dataIndex]; return getServerData().vehicles[dataIndex];
} }
@@ -501,7 +501,7 @@ function deleteVehicleCommand(command, params, client) {
return false; return false;
} }
let dataIndex = getEntityData(vehicle, "vrr.dataSlot"); let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
let vehicleName = getVehicleName(vehicle); let vehicleName = getVehicleName(vehicle);
quickDatabaseQuery(`UPDATE veh_main SET veh_deleted = 1 WHERE veh_id = ${getVehicleData(vehicle).databaseId}`); quickDatabaseQuery(`UPDATE veh_main SET veh_deleted = 1 WHERE veh_id = ${getVehicleData(vehicle).databaseId}`);
@@ -539,7 +539,7 @@ function vehicleEngineCommand(command, params, client) {
getVehicleData(vehicle).engine = !getVehicleData(vehicle).engine; getVehicleData(vehicle).engine = !getVehicleData(vehicle).engine;
vehicle.engine = getVehicleData(vehicle).engine; vehicle.engine = getVehicleData(vehicle).engine;
setEntityData(vehicle, "vrr.engine", getVehicleData(vehicle).engine, true); setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
@@ -665,7 +665,7 @@ function vehicleAdminLiveryCommand(command, params, client) {
getVehicleData(vehicle).livery = livery; getVehicleData(vehicle).livery = livery;
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
setEntityData(vehicle, "vrr.livery", livery, true); setEntityData(vehicle, "agrp.livery", livery, true);
forcePlayerToSyncElementProperties(null, vehicle); forcePlayerToSyncElementProperties(null, vehicle);
meActionToNearbyPlayers(client, `sets the ${getVehicleName(vehicle)}'s livery/paintjob'`); meActionToNearbyPlayers(client, `sets the ${getVehicleName(vehicle)}'s livery/paintjob'`);
@@ -699,7 +699,7 @@ function buyVehicleCommand(command, params, client) {
getPlayerData(client).buyingVehicle = vehicle; getPlayerData(client).buyingVehicle = vehicle;
getVehicleData(vehicle).engine = true; getVehicleData(vehicle).engine = true;
vehicle.engine = true; vehicle.engine = true;
setEntityData(vehicle, "vrr.engine", getVehicleData(vehicle).engine, true); setEntityData(vehicle, "agrp.engine", getVehicleData(vehicle).engine, true);
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle)); setPlayerBuyingVehicleState(client, VRR_VEHBUYSTATE_TESTDRIVE, vehicle.id, getVehiclePosition(vehicle));
@@ -770,7 +770,7 @@ function rentVehicleCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function enterVehicleAsPassengerCommand(command, params, client) { function enterVehicleAsPassengerCommand(command, params, client) {
sendNetworkEventToPlayer("vrr.passenger", client); sendNetworkEventToPlayer("agrp.passenger", client);
} }
// =========================================================================== // ===========================================================================
@@ -1451,7 +1451,7 @@ function respawnVehicle(vehicle) {
let newVehicle = spawnVehicle(vehicles[i]); let newVehicle = spawnVehicle(vehicles[i]);
vehicles[i].vehicle = newVehicle; vehicles[i].vehicle = newVehicle;
setEntityData(newVehicle, "vrr.dataSlot", i, false); setEntityData(newVehicle, "agrp.dataSlot", i, false);
} }
} }
@@ -1503,10 +1503,10 @@ function spawnVehicle(vehicleData) {
//setVehicleHealth(vehicle, 1000); //setVehicleHealth(vehicle, 1000);
repairVehicle(vehicle); repairVehicle(vehicle);
setEntityData(vehicle, "vrr.livery", vehicleData.livery, true); setEntityData(vehicle, "agrp.livery", vehicleData.livery, true);
setEntityData(vehicle, "vrr.upgrades", vehicleData.extras, true); setEntityData(vehicle, "agrp.upgrades", vehicleData.extras, true);
setEntityData(vehicle, "vrr.interior", vehicleData.interior, true); setEntityData(vehicle, "agrp.interior", vehicleData.interior, true);
setEntityData(vehicle, "vrr.engine", vehicleData.engine, true); setEntityData(vehicle, "agrp.engine", vehicleData.engine, true);
forcePlayerToSyncElementProperties(null, vehicle); forcePlayerToSyncElementProperties(null, vehicle);
@@ -1592,7 +1592,7 @@ function createNewDealershipVehicle(modelIndex, spawnPosition, spawnRotation, pr
tempVehicleData.dimension = dimension; tempVehicleData.dimension = dimension;
let slot = getServerData().vehicles.push(tempVehicleData); let slot = getServerData().vehicles.push(tempVehicleData);
setEntityData(vehicle, "vrr.dataSlot", slot - 1, false); setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
} }
// =========================================================================== // ===========================================================================
@@ -1617,7 +1617,7 @@ function createTemporaryVehicle(modelIndex, position, heading, interior = 0, dim
} }
let slot = getServerData().vehicles.push(tempVehicleData); let slot = getServerData().vehicles.push(tempVehicleData);
setEntityData(vehicle, "vrr.dataSlot", slot - 1, false); setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
return vehicle; return vehicle;
} }
@@ -1645,7 +1645,7 @@ function createPermanentVehicle(modelIndex, position, heading, interior = 0, dim
let slot = getServerData().vehicles.push(tempVehicleData); let slot = getServerData().vehicles.push(tempVehicleData);
if (areServerElementsSupported()) { if (areServerElementsSupported()) {
setEntityData(vehicle, "vrr.dataSlot", slot - 1, false); setEntityData(vehicle, "agrp.dataSlot", slot - 1, false);
} }