diff --git a/meta.xml b/meta.xml
index 1d3ed971..dd4d6d07 100644
--- a/meta.xml
+++ b/meta.xml
@@ -115,6 +115,7 @@
+
diff --git a/scripts/client/business.js b/scripts/client/business.js
new file mode 100644
index 00000000..245826e2
--- /dev/null
+++ b/scripts/client/business.js
@@ -0,0 +1,52 @@
+// ===========================================================================
+// Vortrex's Roleplay Resource
+// https://github.com/VortrexFTW/gtac_roleplay
+// ===========================================================================
+// FILE: business.js
+// DESC: Provides business functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+class BusinessData {
+ constructor(index, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ this.index = index;
+ this.name = name;
+ this.entrancePosition = entrancePosition;
+ this.blipModel = blipModel;
+ this.pickupModel = pickupModel;
+ this.hasInterior = hasInterior;
+ this.hasItems = hasItems;
+ this.blipId = -1;
+ }
+}
+
+// ===========================================================================
+
+function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ if(getBusinessData(businessId) != false) {
+ if(blipModel == -1) {
+ natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
+ businesses.splice(getBusinessData(businessId).index, 1);
+ } else {
+ natives.setBlipCoordinates(getBusinessData(businessId).blipId, getBusinessData(businessId).entrancePosition);
+ natives.changeBlipSprite(getBusinessData(businessId).blipId, getBusinessData(businessId).blipModel);
+ natives.changeBlipNameFromAscii(getBusinessData(businessId).blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ }
+ } else {
+ if(blipModel != -1) {
+ let blipId = natives.addBlipForCoord(entrancePosition);
+ if(blipId) {
+ let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
+ tempBusinessData.blipId = blipId;
+ natives.changeBlipSprite(blipId, blipModel);
+ natives.setBlipMarkerLongDistance(blipId, true);
+ natives.changeBlipNameFromAscii(blipId, `${name.substr(0, 24)}${(name.length > 24) ? " ...": ""}`);
+ businesses.push(tempBusinessData);
+ }
+ }
+ }
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/label.js b/scripts/client/label.js
index 70e2df8e..a8d2664d 100644
--- a/scripts/client/label.js
+++ b/scripts/client/label.js
@@ -249,42 +249,52 @@ function renderJobLabel(name, position, jobType) {
function processLabelRendering() {
if(renderLabels && areWorldLabelsSupported()) {
if(localPlayer != null) {
- let pickups = getElementsByType(ELEMENT_PICKUP);
- for(let i in pickups) {
- if(pickups[i].getData("vrr.label.type") != null) {
- if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
- if(!pickups[i].isOnScreen) {
- let price = "0";
- let rentPrice = "0";
- let labelInfoType = VRR_PROPLABEL_INFO_NONE;
- if(pickups[i].getData("vrr.label.price") != null) {
- price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
- }
-
- if(pickups[i].getData("vrr.label.rentprice") != null) {
- rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
- }
-
- if(pickups[i].getData("vrr.label.help") != null) {
- labelInfoType = pickups[i].getData("vrr.label.help");
- }
-
- switch(pickups[i].getData("vrr.label.type")) {
- case VRR_LABEL_BUSINESS:
- renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_HOUSE:
- renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
- break;
-
- case VRR_LABEL_JOB:
- renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
- break;
-
- case VRR_LABEL_EXIT:
- renderPropertyExitLabel(pickups[i].position);
- break;
+ if(!areServerElementsSupported()) {
+ //for(let i in businesses) {
+ // if(pickups[i].getData("vrr.label.type") != null) {
+ // if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
+
+ // natives.getScreenViewportId
+ // natives.getGameViewportId
+ // natives.getViewportPositionOfCoord
+ } else {
+ let pickups = getElementsByType(ELEMENT_PICKUP);
+ for(let i in pickups) {
+ if(pickups[i].getData("vrr.label.type") != null) {
+ if(getDistance(localPlayer.position, pickups[i].position) <= renderLabelDistance) {
+ if(!pickups[i].isOnScreen) {
+ let price = "0";
+ let rentPrice = "0";
+ let labelInfoType = VRR_PROPLABEL_INFO_NONE;
+ if(pickups[i].getData("vrr.label.price") != null) {
+ price = makeLargeNumberReadable(pickups[i].getData("vrr.label.price"));
+ }
+
+ if(pickups[i].getData("vrr.label.rentprice") != null) {
+ rentPrice = makeLargeNumberReadable(pickups[i].getData("vrr.label.rentprice"));
+ }
+
+ if(pickups[i].getData("vrr.label.help") != null) {
+ labelInfoType = pickups[i].getData("vrr.label.help");
+ }
+
+ switch(pickups[i].getData("vrr.label.type")) {
+ case VRR_LABEL_BUSINESS:
+ renderPropertyEntranceLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.locked"), true, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_HOUSE:
+ renderPropertyEntranceLabel("House", pickups[i].position, pickups[i].getData("vrr.label.locked"), false, price, rentPrice, labelInfoType);
+ break;
+
+ case VRR_LABEL_JOB:
+ renderJobLabel(pickups[i].getData("vrr.label.name"), pickups[i].position, pickups[i].getData("vrr.label.jobType"));
+ break;
+
+ case VRR_LABEL_EXIT:
+ renderPropertyExitLabel(pickups[i].position);
+ break;
+ }
}
}
}
diff --git a/scripts/client/main.js b/scripts/client/main.js
index 7292f970..7e56d8ce 100644
--- a/scripts/client/main.js
+++ b/scripts/client/main.js
@@ -69,4 +69,8 @@ let forceWantedLevel = 0;
// Pre-cache all allowed skins
let allowedSkins = getAllowedSkins(getGame());
+let businesses = {};
+let houses = {};
+let jobs = {};
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/server.js b/scripts/client/server.js
index b5bb5da8..db892867 100644
--- a/scripts/client/server.js
+++ b/scripts/client/server.js
@@ -85,7 +85,6 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
- addNetworkEventHandler("vrr.gameScript", setGameScriptState);
addNetworkEventHandler("vrr.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("vrr.interiorLights", updateInteriorLightsState);
@@ -101,6 +100,13 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.logLevel", setLogLevel);
addNetworkEventHandler("vrr.infiniteRun", setLocalPlayerInfiniteRun);
+
+ addNetworkEventHandler("vrr.business", receiveBusinessFromServer);
+ addNetworkEventHandler("vrr.house", receiveHouseFromServer);
+
+ addNetworkEventHandler("vrr.holdObject", makePedHoldObject);
+
+ addNetworkEventHandler("vrr.playerPedId", sendLocalPlayerNetworkIdToServer);
}
// ===========================================================================
@@ -205,18 +211,6 @@ function setEnterPropertyKey(key) {
// ===========================================================================
-function setGameScriptState(scriptName, state) {
- if(state == VRR_GAMESCRIPT_FORCE) {
- logToConsole(`[VRR.Server] Starting game script '${scriptName}'`);
- game.startNewScript(scriptName);
- } else if(state == VRR_GAMESCRIPT_DENY) {
- logToConsole(`[VRR.Server] Terminating game script '${scriptName}'`);
- game.terminateScript(scriptName);
- }
-}
-
-// ===========================================================================
-
function serverRequestedClientInfo() {
sendServerClientInfo();
}
@@ -266,6 +260,9 @@ function setElementCollisionsEnabled(elementId, state) {
function setLocalPlayerPedPartsAndProps(parts, props) {
for(let i in parts) {
localPlayer.changeBodyPart(parts[0], parts[1], parts[2]);
+ }
+
+ for(let i in props) {
localPlayer.changeBodyProp(props[0], props[1]);
}
}
@@ -311,4 +308,18 @@ function setLocalPlayerSkin(skinId) {
}
}
+// ===========================================================================
+
+function makePedHoldObject(pedId, modelIndex) {
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.givePedAmbientObject(natives.getPedFromNetworkId(pedId), getGameConfig().objects[getGame()][modelIndex][1])
+ }
+}
+
+// ===========================================================================
+
+function sendLocalPlayerNetworkIdToServer() {
+ sendNetworkEventToServer("vrr.playerPedId", natives.getNetworkIdFromPed(localPlayer));
+}
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/startup.js b/scripts/client/startup.js
index 1dcdcb3a..e2685005 100644
--- a/scripts/client/startup.js
+++ b/scripts/client/startup.js
@@ -24,6 +24,146 @@ function initClientScripts() {
// ===========================================================================
+function setUpInitialGame() {
+ if(getGame() == VRR_GAME_GTA_III) {
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ game.SET_CAR_DENSITY_MULTIPLIER(3.0);
+ game.SET_PED_DENSITY_MULTIPLIER(3.0);
+ game.onMission = true;
+ SetStandardControlsEnabled(true);
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_VC) {
+ game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
+ game.setGameStat(STAT_PROGRESSMADE, 9999);
+ game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
+ game.SET_CAR_DENSITY_MULTIPLIER(3.0);
+ game.SET_PED_DENSITY_MULTIPLIER(3.0);
+
+ game.REQUEST_ANIMATION("bikev");
+ game.REQUEST_ANIMATION("bikeh");
+ game.REQUEST_ANIMATION("biked");
+ game.REQUEST_ANIMATION("knife");
+ game.REQUEST_ANIMATION("python");
+ game.REQUEST_ANIMATION("shotgun");
+ game.REQUEST_ANIMATION("buddy");
+ game.REQUEST_ANIMATION("tec");
+ game.REQUEST_ANIMATION("uzi");
+ game.REQUEST_ANIMATION("rifle");
+ game.REQUEST_ANIMATION("m60");
+ game.REQUEST_ANIMATION("sniper");
+ game.REQUEST_ANIMATION("grenade");
+ game.REQUEST_ANIMATION("flame");
+ game.REQUEST_ANIMATION("medic");
+ game.REQUEST_ANIMATION("sunbathe");
+ //game.REQUEST_ANIMATION("playidles");
+ game.REQUEST_ANIMATION("riot");
+ game.REQUEST_ANIMATION("strip");
+ game.REQUEST_ANIMATION("lance");
+ game.REQUEST_ANIMATION("skate");
+
+ game.LOAD_ALL_MODELS_NOW();
+ game.onMission = true;
+ SetStandardControlsEnabled(true);
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_SA) {
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
+ game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
+ game.setGameStat(STAT_DRIVING_SKILL, 9999);
+ game.setGameStat(STAT_FAT, 9999);
+ game.setGameStat(STAT_ENERGY, 9999);
+ game.setGameStat(STAT_CYCLE_SKILL, 9999);
+ game.setGameStat(STAT_BIKE_SKILL, 9999);
+ game.setGameStat(STAT_GAMBLING, 9999);
+ game.setGameStat(STAT_PROGRESS_MADE, 9999);
+ game.setGameStat(STAT_RESPECT, 0);
+ game.setGameStat(STAT_RESPECT_TOTAL, 0);
+ game.setGameStat(STAT_SEX_APPEAL, 0);
+ game.setGameStat(STAT_STAMINA, 9999);
+ game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
+ game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
+ game.setGameStat(STAT_BODY_MUSCLE, 9999);
+
+ game.setDefaultInteriors(false);
+ game.onMission = true;
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.allowEmergencyServices(false);
+ natives.setCreateRandomCops(true);
+ natives.setMaxWantedLevel(0);
+ natives.setWantedMultiplier(0.0);
+ natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
+ natives.setPlayerTeam(natives.getPlayerId(), 0);
+ natives.loadAllObjectsNow();
+ natives.setCellphoneRanked(false);
+ natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
+ natives.setSyncWeatherAndGameTime(false);
+ natives.usePlayerColourInsteadOfTeamColour(true);
+ natives.disablePauseMenu(true);
+ natives.allowReactionAnims(localPlayer, true);
+ natives.allowGameToPauseForStreaming(false);
+ natives.allowStuntJumpsToTrigger(false);
+ natives.setPickupsFixCars(false);
+
+ // HUD and Display
+ natives.displayCash(false);
+ natives.displayAmmo(false);
+ natives.displayHud(false);
+ natives.displayRadar(false);
+ natives.displayAreaName(false);
+ natives.displayPlayerNames(false);
+ natives.setPoliceRadarBlips(false);
+ natives.removeTemporaryRadarBlipsForPickups();
+ natives.displayNonMinigameHelpMessages(false);
+ natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
+
+ // Item/Money Dropping
+ natives.setMoneyCarriedByAllNewPeds(0);
+ natives.setDeadPedsDropWeapons(false);
+ natives.setPlayersDropMoneyInNetworkGame(false);
+
+ // Population
+ natives.dontSuppressAnyCarModels(5.0);
+ natives.dontSuppressAnyPedModels(5.0);
+ natives.forceGenerateParkedCarsTooCloseToOthers(5.0);
+ natives.setParkedCarDensityMultiplier(5.0);
+ natives.setRandomCarDensityMultiplier(5.0);
+ natives.setPedDensityMultiplier(5.0);
+ natives.setCarDensityMultiplier(5.0);
+ natives.setScenarioPedDensityMultiplier(5.0, 5.0);
+ natives.switchRandomTrains(true);
+ natives.switchRandomBoats(true);
+ natives.switchAmbientPlanes(true);
+ natives.switchMadDrivers(false);
+
+ natives.requestAnims("DANCING");
+ return true;
+ }
+
+ if(getGame() == VRR_GAME_MAFIA_ONE) {
+ game.mapEnabled = false;
+ game.setTrafficEnabled(false);
+ return true;
+ }
+}
+
+// ===========================================================================
+
initClientScripts();
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/sync.js b/scripts/client/sync.js
index 7b7d7413..2ffe01e3 100644
--- a/scripts/client/sync.js
+++ b/scripts/client/sync.js
@@ -14,18 +14,6 @@ function processSync(event, deltaTime) {
sendNetworkEventToServer("vrr.player.heading", localPlayer.heading);
}
- //if(game.game == VRR_GAME_GTA_SA) {
- // let lookAtPos = getLocalPlayerLookAtPosition();
- // sendNetworkEventToServer("vrr.player.lookat", lookAtPos);
- // setEntityData(localPlayer, "vrr.headLook", lookAtPos);
- // let peds = getPeds();
- // for(let i in peds) {
- // if(doesEntityDataExist(peds[i], "vrr.headLook")) {
- // peds[i].lookAt(getEntityData(peds[i], "vrr.headLook"), 99999);
- // }
- // }
- //}
-
if(localPlayer.health <= 0) {
if(!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`);
@@ -391,17 +379,11 @@ function syncElementProperties(element) {
}
}
-// ===========================================================================
-function receiveBlipFromServer(model, position) {
- if(getGame() == VRR_GAME_GTA_IV) {
-
- }
-}
// ===========================================================================
-function receivePickupFromServer(model, position) {
+function receiveHouseFromServer(houseId, entrancePosition, blipModel, pickupModel, hasInterior) {
if(getGame() == VRR_GAME_GTA_IV) {
}
diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js
index a4354ffe..d1190946 100644
--- a/scripts/client/utilities.js
+++ b/scripts/client/utilities.js
@@ -275,9 +275,17 @@ function runClientCode(code, returnTo) {
function enterVehicleAsPassenger() {
if(localPlayer.vehicle == null) {
let tempVehicle = getClosestVehicle(localPlayer.position);
- if(tempVehicle != null) {
- localPlayer.enterVehicle(tempVehicle, false);
- }
+ if(getGame() != VRR_GAME_GTA_IV) {
+ if(tempVehicle != null) {
+ localPlayer.enterVehicle(tempVehicle, false);
+ }
+ } else {
+ for(let i = 0 ; i <= natives.getMaximumNumberOfPassengers(tempVehicle); i++) {
+ if(natives.isCarPassengerSeatFree(tempVehicle, i)) {
+ natives.taskEnterCarAsPassenger(localPlayer, tempVehicle, i, 1);
+ }
+ }
+ }
}
}
@@ -404,7 +412,11 @@ function clearLocalPedState() {
// ===========================================================================
function getWeaponSlot(weaponId) {
- return weaponSlots[game.game][weaponId];
+ if(getGame() == VRR_GAME_GTA_IV) {
+ return false;
+ }
+
+ return weaponSlots[getGame()][weaponId];
}
// ===========================================================================
@@ -501,6 +513,10 @@ function setLocalPlayerCash(amount) {
if(typeof localPlayer.money != "undefined") {
localPlayer.money = toInteger(amount);
}
+
+ if(getGame() == VRR_GAME_GTA_IV) {
+ natives.setMultiplayerHudCash(amount);
+ }
}
// ===========================================================================
@@ -618,12 +634,12 @@ function forceLocalPlayerEquippedWeaponItem() {
if(forceWeapon != 0) {
if(localPlayer.weapon != forceWeapon) {
localPlayer.weapon = forceWeapon;
- if(getGame() <= VRR_GAME_GTA_IV) {
+ if(getGame() < VRR_GAME_GTA_IV) {
localPlayer.setWeaponClipAmmunition(getWeaponSlot(forceWeapon), forceWeaponClipAmmo);
localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo);
}
} else {
- if(getGame() <= VRR_GAME_GTA_IV) {
+ if(getGame() < VRR_GAME_GTA_IV) {
forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon));
forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon));
}
@@ -748,119 +764,6 @@ function processNearbyPickups() {
// ===========================================================================
-function setUpInitialGame() {
- if(getGame() == VRR_GAME_GTA_III) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_VC) {
- game.SET_PLAYER_NEVER_GETS_TIRED(game.GET_PLAYER_ID(), 0);
- game.setGameStat(STAT_PROGRESSMADE, 9999);
- game.setGameStat(STAT_TOTALPROGRESSINGAME, 9999);
- game.SET_CAR_DENSITY_MULTIPLIER(3.0);
- game.SET_PED_DENSITY_MULTIPLIER(3.0);
-
- game.REQUEST_ANIMATION("bikev");
- game.REQUEST_ANIMATION("bikeh");
- game.REQUEST_ANIMATION("biked");
- game.REQUEST_ANIMATION("knife");
- game.REQUEST_ANIMATION("python");
- game.REQUEST_ANIMATION("shotgun");
- game.REQUEST_ANIMATION("buddy");
- game.REQUEST_ANIMATION("tec");
- game.REQUEST_ANIMATION("uzi");
- game.REQUEST_ANIMATION("rifle");
- game.REQUEST_ANIMATION("m60");
- game.REQUEST_ANIMATION("sniper");
- game.REQUEST_ANIMATION("grenade");
- game.REQUEST_ANIMATION("flame");
- game.REQUEST_ANIMATION("medic");
- game.REQUEST_ANIMATION("sunbathe");
- //game.REQUEST_ANIMATION("playidles");
- game.REQUEST_ANIMATION("riot");
- game.REQUEST_ANIMATION("strip");
- game.REQUEST_ANIMATION("lance");
- game.REQUEST_ANIMATION("skate");
-
- game.LOAD_ALL_MODELS_NOW();
- game.onMission = true;
- SetStandardControlsEnabled(true);
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_SA) {
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_PISTOL_SILENCED_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_DESERT_EAGLE_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MICRO_UZI_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_MP5_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_AK47_SKILL, 400);
- game.setGameStat(STAT_WEAPONTYPE_M4_SKILL, 400);
- game.setGameStat(STAT_DRIVING_SKILL, 9999);
- game.setGameStat(STAT_FAT, 9999);
- game.setGameStat(STAT_ENERGY, 9999);
- game.setGameStat(STAT_CYCLE_SKILL, 9999);
- game.setGameStat(STAT_BIKE_SKILL, 9999);
- game.setGameStat(STAT_GAMBLING, 9999);
- game.setGameStat(STAT_PROGRESS_MADE, 9999);
- game.setGameStat(STAT_RESPECT, 0);
- game.setGameStat(STAT_RESPECT_TOTAL, 0);
- game.setGameStat(STAT_SEX_APPEAL, 0);
- game.setGameStat(STAT_STAMINA, 9999);
- game.setGameStat(STAT_TOTAL_PROGRESS, 9999);
- game.setGameStat(STAT_UNDERWATER_STAMINA, 9999);
- game.setGameStat(STAT_BODY_MUSCLE, 9999);
-
- game.setDefaultInteriors(false);
- game.onMission = true;
- return true;
- }
-
- if(getGame() == VRR_GAME_GTA_IV) {
- natives.allowEmergencyServices(false);
- natives.setCreateRandomCops(true);
- natives.setMaxWantedLevel(0);
- natives.setWantedMultiplier(0.0);
- natives.allowPlayerToCarryNonMissionObjects(natives.getPlayerId(), true);
- natives.setPlayerTeam(natives.getPlayerId(), 0);
- natives.loadAllObjectsNow();
- natives.setCellphoneRanked(false);
- natives.setOverrideNoSprintingOnPhoneInMultiplayer(false);
- natives.setPlayersDropMoneyInNetworkGame(false);
- natives.setSyncWeatherAndGameTime(false);
- natives.usePlayerColourInsteadOfTeamColour(true);
- natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
- natives.removeTemporaryRadarBlipsForPickups();
- natives.setPickupsFixCars(false);
- natives.displayCash(false);
- natives.displayAmmo(false);
- natives.displayHud(false);
- natives.displayAreaName(false);
- natives.setPoliceRadarBlips(false);
-
- natives.requestAnims("DANCING");
- return true;
- }
-
- if(getGame() == VRR_GAME_MAFIA_ONE) {
- game.mapEnabled = false;
- game.setTrafficEnabled(false);
- return true;
- }
-}
-
-// ===========================================================================
-
function processGameSpecifics() {
if(game.game < VRR_GAME_GTA_IV) {
game.clearMessages();
diff --git a/scripts/server/accent.js b/scripts/server/accent.js
index 6b76c45e..41cea951 100644
--- a/scripts/server/accent.js
+++ b/scripts/server/accent.js
@@ -63,8 +63,7 @@ function listAccentsCommand(command, params, client) {
let chunkedList = splitArrayIntoChunks(accentList, 8);
- messagePlayerInfo(client, `{clanOrange}== {jobYellow}Accents {clanOrange}==================================`);
-
+ messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "AccentList")));
for(let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
@@ -112,7 +111,7 @@ function addAccentCommand(command, params, client) {
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
- messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
+ messageAdmins(`${client.name}{MAINCOLOUR} added a new accent: ${newAccentName}`);
}
// ===========================================================================
@@ -132,7 +131,7 @@ function removeAccentCommand(command, params, client) {
getGlobalConfig().accents.push(newAccentName);
saveAccentConfig();
- messageAdmins(`${client.name} {MAINCOLOUR}added a new accent: ${newAccentName}`);
+ messageAdmins(`${client.name}{MAINCOLOUR} added a new accent: ${newAccentName}`);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/server/account.js b/scripts/server/account.js
index ff9764c5..87be5779 100644
--- a/scripts/server/account.js
+++ b/scripts/server/account.js
@@ -599,7 +599,6 @@ function loginSuccess(client) {
getPlayerData(client).accountData.ipAddress = client.ip;
- //sendRemovedWorldObjectsToPlayer(client);
sendPlayerChatScrollLines(client, getPlayerData(client).accountData.chatScrollLines);
messagePlayerNormal(null, `👋 ${getPlayerName(client)} has joined the server`, getColourByName("softYellow"));
diff --git a/scripts/server/anticheat.js b/scripts/server/anticheat.js
index e82b5079..38ff2b63 100644
--- a/scripts/server/anticheat.js
+++ b/scripts/server/anticheat.js
@@ -9,57 +9,8 @@
function initAntiCheatScript() {
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Initializing anticheat script ...");
- getServerData().antiCheat.whiteListedGameScripts = loadAntiCheatGameScriptWhiteListFromDatabase();
- getServerData().antiCheat.blackListedGameScripts = loadAntiCheatGameScriptBlackListFromDatabase();
logToConsole(LOG_DEBUG, "[VRR.AntiCheat]: Anticheat script initialized!");
}
-// ===========================================================================
-
-function loadAntiCheatGameScriptWhiteListFromDatabase() {
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Loading whitelisted game scripts ...`);
- let dbConnection = connectToDatabase();
- let tempWhiteListedGameScripts = [];
-
- if(dbConnection) {
- let dbQueryString = `SELECT * FROM ac_script_wl WHERE ac_script_wl_enabled = 1 AND ac_script_wl_server = ${getServerId()}`;
- let dbQuery = queryDatabase(dbConnection, dbQueryString);
- if(dbQuery) {
- if(dbQuery.numRows > 0) {
- let dbAssoc = fetchQueryAssoc(dbQuery);
- let tempWhiteListedGameScriptData = new WhiteListedGameScriptData(dbAssoc);
- tempWhiteListedGameScripts.push(tempWhiteListedGameScriptData);
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Whitelisted game script '${tempWhiteListedGameScriptData.scriptName}' loaded successfully!`);
- }
- }
- disconnectFromDatabase(dbConnection);
- }
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] ${tempWhiteListedGameScripts.length} whitelisted game scripts loaded!`);
- return tempWhiteListedGameScripts;
-}
-
-// ===========================================================================
-
-function loadAntiCheatGameScriptBlackListFromDatabase() {
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Loading blacklisted game scripts ...`);
- let dbConnection = connectToDatabase();
- let tempBlackListedGameScripts = [];
-
- if(dbConnection) {
- let dbQueryString = `SELECT * FROM ac_script_bl WHERE ac_script_bl_enabled = 1 AND ac_script_bl_server = ${getServerId()}`;
- let dbQuery = queryDatabase(dbConnection, dbQueryString);
- if(dbQuery) {
- if(dbQuery.numRows > 0) {
- let dbAssoc = fetchQueryAssoc(dbQuery);
- let tempBlackListedGameScriptData = new BlackListedGameScriptData(dbAssoc);
- tempBlackListedGameScripts.push(tempBlackListedGameScriptData);
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] Blacklisted game script '${tempBlackListedGameScriptData.scriptName}' loaded successfully!`);
- }
- }
- disconnectFromDatabase(dbConnection);
- }
- logToConsole(LOG_DEBUG, `[VRR.AntiCheat] ${tempBlackListedGameScripts.length} blacklisted game scripts loaded!`);
- return tempBlackListedGameScripts;
-}
// ===========================================================================
@@ -76,170 +27,6 @@ function clearPlayerStateToEnterExitProperty(client) {
// ===========================================================================
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function addAntiCheatBlackListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let scriptName = params;
- let tempBlackListedGameScriptData = new BlackListedGameScriptData(false);
- tempBlackListedGameScriptData.scriptName = scriptName;
- tempBlackListedGameScriptData.serverId = getServerId();
- tempBlackListedGameScriptData.enabled = true;
- tempBlackListedGameScriptData.needsSaved = true;
- getServerConfig().antiCheat.blackListedGameScripts.push(tempBlackListedGameScriptData);
-
- if(getServerConfig().antiCheat.gameScriptBlackListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_DENY);
- }
-
- messagePlayerSuccess(client, `You added {ALTCOLOUR}${scriptName} {MAINCOLOUR} to the anticheat game script blacklist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function addAntiCheatWhiteListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let scriptName = params;
- let tempWhiteListedGameScriptData = new WhiteListedGameScriptData(false);
- tempWhiteListedGameScriptData.scriptName = scriptName;
- tempWhiteListedGameScriptData.serverId = getServerId();
- tempWhiteListedGameScriptData.enabled = true;
- tempWhiteListedGameScriptData.needsSaved = true;
- getServerConfig().antiCheat.whiteListedGameScripts.push(tempWhiteListedGameScriptData);
-
- if(getServerConfig().antiCheat.gameScriptWhiteListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_ALLOW);
- }
-
- messagePlayerSuccess(client, `You added {ALTCOLOUR}${scriptName} {MAINCOLOUR} to the anticheat game script whitelist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function removeAntiCheatWhiteListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let whiteListScriptId = getAntiCheatWhiteListedScriptFromParams(params);
-
- getServerConfig().antiCheat.whiteListedGameScripts.splice(whiteListScriptId, 1);
-
- if(getServerConfig().antiCheat.gameScriptWhiteListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_NONE);
- }
-
- messagePlayerSuccess(client, `You removed {ALTCOLOUR}${scriptName} {MAINCOLOUR} from the anticheat game script whitelist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function removeAntiCheatBlackListedScriptCommand(command, params, client) {
- if(areParamsEmpty(params)) {
- messagePlayerSyntax(client, getCommandSyntaxText(command));
- return false;
- }
-
- let blackListScriptId = getAntiCheatBlackListedScriptFromParams(params);
-
- getServerConfig().antiCheat.blackListedGameScripts.splice(blackListScriptId, 1);
-
- if(getServerConfig().antiCheat.gameScriptBlackListEnabled) {
- sendPlayerGameScriptState(null, scriptName, VRR_GAMESCRIPT_NONE);
- }
-
- messagePlayerSuccess(client, `You removed {ALTCOLOUR}${scriptName} {MAINCOLOUR} from the anticheat game script blacklist`);
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
- function toggleAntiCheatScriptWhiteListCommand(command, params, client) {
- getServerConfig().antiCheat.gameScriptWhiteListEnabled = !getServerConfig().antiCheat.gameScriptWhiteListEnabled;
- getServerConfig().needsSaved = true;
-
- messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned anticheat game script whitelist ${getBoolRedGreenInlineColour(getServerConfig().antiCheat.gameScriptWhiteListEnabled)}${toUpperCase(getOnOffFromBool(getServerConfig().antiCheat.gameScriptWhiteListEnabled))}`);
- updateServerRules();
- return true;
-}
-
-// ===========================================================================
-
-/**
- * This is a command handler function.
- *
- * @param {string} command - The command name used by the player
- * @param {string} params - The parameters/args string used with the command by the player
- * @param {Client} client - The client/player that used the command
- * @return {bool} Whether or not the command was successful
- *
- */
-function toggleAntiCheatScriptBlackListCommand(command, params, client) {
- getServerConfig().antiCheat.gameScriptBlackListEnabled = !getServerConfig().antiCheat.gameScriptBlackListEnabled;
- getServerConfig().needsSaved = true;
-
- messageAdminAction(`${getPlayerName(client)} {MAINCOLOUR}turned anticheat game script blacklist ${getBoolRedGreenInlineColour(getServerConfig().antiCheat.gameScriptBlackListEnabled)}${toUpperCase(getOnOffFromBool(getServerConfig().antiCheat.gameScriptBlackListEnabled))}`);
- updateServerRules();
- return true;
-}
-
-// ===========================================================================
-
function isPlayerExemptFromAntiCheat(client) {
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
return true;
diff --git a/scripts/server/business.js b/scripts/server/business.js
index 24af8bfa..9335ea09 100644
--- a/scripts/server/business.js
+++ b/scripts/server/business.js
@@ -58,7 +58,7 @@ function loadBusinessesFromDatabase() {
while(dbAssoc = fetchQueryAssoc(dbQuery)) {
let tempBusinessData = new BusinessData(dbAssoc);
tempBusinessData.locations = loadBusinessLocationsFromDatabase(tempBusinessData.databaseId);
- tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
+ //tempBusinessData.gameScripts = loadBusinessGameScriptsFromDatabase(tempBusinessData.databaseId);
tempBusinesses.push(tempBusinessData);
logToConsole(LOG_INFO, `[VRR.Business]: Business '${tempBusinessData.name}' (ID ${tempBusinessData.databaseId}) loaded from database successfully!`);
}
@@ -105,6 +105,7 @@ function loadBusinessLocationsFromDatabase(businessId) {
// ===========================================================================
+/*
function loadBusinessGameScriptsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[VRR.Business]: Loading business game scripts for business ${businessId} from database ...`);
@@ -133,6 +134,7 @@ function loadBusinessGameScriptsFromDatabase(businessId) {
logToConsole(LOG_VERBOSE, `[VRR.Business]: ${tempBusinessGameScripts.length} game scripts for business ${businessId} loaded from database successfully!`);
return tempBusinessGameScripts;
}
+*/
// ===========================================================================
@@ -1335,11 +1337,7 @@ function createAllBusinessBlips() {
// ===========================================================================
-function createBusinessEntrancePickup(businessId) {
- if(!areServerElementsSupported()) {
- return false;
- }
-
+function createBusinessEntrancePickup(businessId) {
if(!getServerConfig().createBusinessPickups) {
return false;
}
@@ -1359,6 +1357,8 @@ function createBusinessEntrancePickup(businessId) {
setElementDimension(getBusinessData(businessId).entrancePickup, getBusinessData(businessId).entranceDimension);
updateBusinessPickupLabelData(businessId);
addToWorld(getBusinessData(businessId).entrancePickup);
+ } else {
+ sendBusinessEntranceToPlayer(null, businessId, getBusinessData(businessId), getBusinessData(businessId).entrancePosition, getBusinessData(businessId).entranceBlipModel, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
}
}
}
@@ -1388,6 +1388,8 @@ function createBusinessEntranceBlip(businessId) {
setElementOnAllDimensions(getBusinessData(businessId).entranceBlip, false);
setElementDimension(getBusinessData(businessId).entranceBlip, getBusinessData(businessId).entranceDimension);
addToWorld(getBusinessData(businessId).entranceBlip);
+ } else {
+ sendBusinessEntranceToPlayer(null, businessId, getBusinessData(businessId).name, getBusinessData(businessId).entrancePosition, blipModelId, getBusinessData(businessId).entrancePickupModel, getBusinessData(businessId).hasInterior, false);
}
}
}
@@ -1551,6 +1553,10 @@ function doesBusinessHaveInterior(businessId) {
// ===========================================================================
function deleteBusinessEntrancePickup(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).entrancePickup != null) {
//removeFromWorld(getBusinessData(businessId).entrancePickup);
deleteGameElement(getBusinessData(businessId).entrancePickup);
@@ -1561,6 +1567,10 @@ function deleteBusinessEntrancePickup(businessId) {
// ===========================================================================
function deleteBusinessExitPickup(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).exitPickup != null) {
//removeFromWorld(getBusinessData(businessId).exitPickup);
deleteGameElement(getBusinessData(businessId).exitPickup);
@@ -1571,6 +1581,10 @@ function deleteBusinessExitPickup(businessId) {
// ===========================================================================
function deleteBusinessEntranceBlip(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).entranceBlip != null) {
//removeFromWorld(getBusinessData(businessId).entranceBlip);
deleteGameElement(getBusinessData(businessId).entranceBlip);
@@ -1581,6 +1595,10 @@ function deleteBusinessEntranceBlip(businessId) {
// ===========================================================================
function deleteBusinessExitBlip(businessId) {
+ if(!areServerElementsSupported()) {
+ return false;
+ }
+
if(getBusinessData(businessId).exitBlip != null) {
//removeFromWorld(getBusinessData(businessId).exitBlip);
deleteGameElement(getBusinessData(businessId).exitBlip);
@@ -2042,19 +2060,19 @@ function doesBusinessHaveAnyItemsToBuy(businessId) {
// ===========================================================================
-function sendPlayerBusinessGameScripts(client, businessId) {
- for(let i in getBusinessData(businessId).gameScripts) {
- sendPlayerGameScriptState(client, getBusinessData(businessId).gameScripts[i].state);
- }
-}
+//function sendPlayerBusinessGameScripts(client, businessId) {
+// for(let i in getBusinessData(businessId).gameScripts) {
+// sendPlayerGameScriptState(client, getBusinessData(businessId).gameScripts[i].state);
+// }
+//}
// ===========================================================================
-function clearPlayerBusinessGameScripts(client, businessId) {
- for(let i in getBusinessData(businessId).gameScripts) {
- sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
- }
-}
+//function clearPlayerBusinessGameScripts(client, businessId) {
+// for(let i in getBusinessData(businessId).gameScripts) {
+// sendPlayerGameScriptState(client, VRR_GAMESCRIPT_DENY);
+// }
+//}
// ===========================================================================
diff --git a/scripts/server/class.js b/scripts/server/class.js
index 6219c2d1..a4d92a13 100644
--- a/scripts/server/class.js
+++ b/scripts/server/class.js
@@ -62,11 +62,11 @@ class ServerData {
this.antiCheat = {
enabled: false,
- checkGameScripts: false,
- gameScriptWhiteListEnabled: false,
- gameScriptBlackListEnabled: false,
- gameScriptWhiteList: [],
- gameScriptBlackList: [],
+ //checkGameScripts: false,
+ //gameScriptWhiteListEnabled: false,
+ //gameScriptBlackListEnabled: false,
+ //gameScriptWhiteList: [],
+ //gameScriptBlackList: [],
};
this.discordBotToken = "";
@@ -113,38 +113,14 @@ class ServerData {
this.minute = toInteger(dbAssoc["svr_start_time_min"]);
this.minuteDuration = toInteger(dbAssoc["svr_time_min_duration"]);
this.weather = toInteger(dbAssoc["svr_start_weather"]);
- this.fallingSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("FallingSnow"));
- this.groundSnow = hasBitFlag(this.settings, getServerSettingsFlagValue("GroundSnow"));
- this.useGUI = hasBitFlag(this.settings, getServerSettingsFlagValue("GUI"));
this.guiColourPrimary = [toInteger(dbAssoc["svr_gui_col1_r"]), toInteger(dbAssoc["svr_gui_col1_g"]), toInteger(dbAssoc["svr_gui_col1_b"])];
this.guiColourSecondary = [toInteger(dbAssoc["svr_gui_col2_r"]), toInteger(dbAssoc["svr_gui_col2_g"]), toInteger(dbAssoc["svr_gui_col2_b"])];
this.guiTextColourPrimary = [toInteger(dbAssoc["svr_gui_textcol1_r"]), toInteger(dbAssoc["svr_gui_textcol1_g"]), toInteger(dbAssoc["svr_gui_textcol1_b"])];
//this.guiTextColourSecondary = [toInteger(dbAssoc["svr_gui_textcol2_r"]), toInteger(dbAssoc["svr_gui_textcol2_g"]), toInteger(dbAssoc["svr_gui_textcol2_b"])];
- this.showLogo = hasBitFlag(this.settings, getServerSettingsFlagValue("Logo"));
this.inflationMultiplier = toFloat(dbAssoc["svr_inflation_multiplier"]);
- this.testerOnly = hasBitFlag(this.settings, getServerSettingsFlagValue("Testing"));
-
- this.antiCheat = {
- enabled: hasBitFlag(this.settings, getServerSettingsFlagValue("Anticheat")),
- checkGameScripts: hasBitFlag(this.settings, getServerSettingsFlagValue("CheckGameScripts")),
- gameScriptBlackListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptBlackList")),
- gameScriptWhiteListEnabled: hasBitFlag(this.settings, getServerSettingsFlagValue("GameScriptWhiteList")),
- gameScriptWhiteList: [],
- gameScriptBlackList: [],
- };
this.discordBotToken = intToBool(dbAssoc["svr_discord_bot_token"]);
- this.discordEnabled = hasBitFlag(this.settings, getServerSettingsFlagValue("DiscordBot"));
-
- this.createJobPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("JobPickups"));
- this.createBusinessPickups = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessPickups"));
- this.createHousePickups = hasBitFlag(this.settings, getServerSettingsFlagValue("HousePickups"));
- this.createJobBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("JobBlips"));
- this.createBusinessBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("BusinessBlips"));
- this.createHouseBlips = hasBitFlag(this.settings, getServerSettingsFlagValue("HouseBlips"));
-
this.introMusicURL = dbAssoc["svr_intro_music"];
- this.useRealTime = hasBitFlag(this.settings, getServerSettingsFlagValue("RealTime"));
this.realTimeZone = dbAssoc["svr_time_realtime_timezone"];
this.discordConfig = {
@@ -263,6 +239,8 @@ class ClientData {
this.locale = 0;
this.enteringVehicle = null;
+
+ this.pedId = -1;
}
};
@@ -672,7 +650,7 @@ class HouseData {
this.itemCache = [];
this.locations = [];
- this.gameScripts = [];
+ //this.gameScripts = [];
this.entrancePosition = false;
this.entranceRotation = 0.0;
diff --git a/scripts/server/client.js b/scripts/server/client.js
index c0ea074c..565fd7b7 100644
--- a/scripts/server/client.js
+++ b/scripts/server/client.js
@@ -74,6 +74,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("vrr.skinSelected", playerFinishedSkinSelection);
addNetworkEventHandler("vrr.clientInfo", updateConnectionLogOnClientInfoReceive);
addNetworkEventHandler("vrr.vehBuyState", receiveVehiclePurchaseStateUpdateFromClient);
+ addNetworkEventHandler("vrr.playerPedId", receivePlayerPedNetworkId);
}
// ===========================================================================
@@ -223,29 +224,6 @@ function updatePlayerSnowState(client) {
// ===========================================================================
-function sendExcludedModelsForGroundSnowToPlayer(client) {
- if(getGameConfig().excludedGroundSnowModels[getServerGame()].length > 0) {
- for(let i in getGameConfig().excludedGroundSnowModels[getServerGame()]) {
- logToConsole(LOG_DEBUG, `[VRR.Misc] Sending excluded model ${i} for ground snow to ${getPlayerName(client)}`);
- sendNetworkEventToPlayer("vrr.excludeGroundSnow", client, getGameConfig().excludedGroundSnowModels[getServerGame()][i]);
- }
- }
-}
-
-// ===========================================================================
-
-function sendRemovedWorldObjectsToPlayer(client) {
- if(getGameConfig().removedWorldObjects[getServerGame()].length > 0) {
- for(let i in getGameConfig().removedWorldObjects[getServerGame()]) {
- logToConsole(LOG_DEBUG, `[VRR.Client] Sending removed world object ${i} (${getGameConfig().removedWorldObjects[getServerGame()][i][0]}) to ${getPlayerName(client)}`);
- sendNetworkEventToPlayer("vrr.removeWorldObject", client, getGameConfig().removedWorldObjects[getServerGame()][i][0], getGameConfig().removedWorldObjects[getServerGame()][i][1], getGameConfig().removedWorldObjects[getServerGame()][i][2]);
- }
- }
- return true;
-}
-
-// ===========================================================================
-
function updatePlayerHotBar(client) {
logToConsole(LOG_DEBUG, `[VRR.Client] Sending updated hotbar data to ${getPlayerDisplayForConsole(client)}`);
let tempHotBarItems = [];
@@ -1053,12 +1031,6 @@ function setPlayerHeadLookPosition(client, position) {
// ===========================================================================
-function sendPlayerGameScriptState(client, scriptName, state) {
- sendNetworkEventToPlayer("vrr.gameScript", client, scriptName, state);
-}
-
-// ===========================================================================
-
function requestClientInfo(client) {
sendNetworkEventToPlayer("vrr.clientInfo", client);
}
@@ -1078,7 +1050,10 @@ function forcePlayerToSyncElementProperties(client, element) {
// ===========================================================================
function sendPlayerPedPartsAndProps(client) {
- sendNetworkEventToPlayer("vrr.ped")
+ let bodyParts = getPlayerCurrentSubAccount(client).bodyParts;
+ 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]);
}
// ===========================================================================
@@ -1146,4 +1121,44 @@ function sendHouseEntranceToPlayer(client, houseId, entrancePosition, blipModel,
sendNetworkEventToPlayer("vrr.house", client, houseId, entrancePosition, blipModel, pickupModel, hasInterior);
}
+// ==========================================================================
+
+function sendAllBusinessEntrancesToPlayer(client) {
+ let businesses = getServerData().businesses;
+ for(let i in businesses) {
+ if(businesses[i].entranceBlipModel > 0) {
+ sendBusinessEntranceToPlayer(client, businesses[i].index, businesses[i].name, businesses[i].entrancePosition, businesses[i].entranceBlipModel, businesses[i].entrancePickupModel, businesses[i].hasInterior, false);
+ }
+ }
+}
+
+// ==========================================================================
+
+function sendAllHouseEntrancesToPlayer(client) {
+ let houses = getServerData().houses;
+ for(let i in houses) {
+ if(houses[i].entranceBlipModel > 0) {
+ sendBusinessEntranceToPlayer(client, businesses[i].index, houses[i].entrancePosition, houses[i].entranceBlipModel, houses[i].entrancePickupModel, houses[i].hasInterior);
+ }
+ }
+}
+
+// ==========================================================================
+
+function makePlayerHoldObjectModel(client, modelIndex) {
+ sendNetworkEventToPlayer("vrr.holdObject", client, getPlayerData(client).pedId, modelIndex);
+}
+
+// ==========================================================================
+
+function receivePlayerPedNetworkId(client, pedId) {
+ getPlayerData(client).pedId = pedId;
+}
+
+// ==========================================================================
+
+function requestPlayerPedNetworkId(client) {
+ sendNetworkEventToPlayer("vrr.playerPedId", client);
+}
+
// ==========================================================================
\ No newline at end of file
diff --git a/scripts/server/command.js b/scripts/server/command.js
index a7d1aaa6..c577d396 100644
--- a/scripts/server/command.js
+++ b/scripts/server/command.js
@@ -68,12 +68,6 @@ function loadCommands() {
commandData("stopanim", stopPlayerAnimationCommand, "", getStaffFlagValue("None"), true, true, "Stops your current animation"),
],
antiCheat: [
- commandData("addacscriptwl", addAntiCheatWhiteListedScriptCommand, "