diff --git a/scripts/client/job.js b/scripts/client/job.js index f9b057ca..88c58cf8 100644 --- a/scripts/client/job.js +++ b/scripts/client/job.js @@ -52,7 +52,7 @@ function setLocalPlayerWorkingState(tempWorking) { function showJobRouteLocation(position, colour) { logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`); if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - if(game.game == VRR_GAME_GTA_SA) { + if(getGame() == VRR_GAME_GTA_SA) { // Server-side spheres don't show in GTA SA for some reason. jobRouteLocationSphere = game.createPickup(1318, position, 1); } else { diff --git a/scripts/client/nametag.js b/scripts/client/nametag.js index 9e53676c..174a6331 100644 --- a/scripts/client/nametag.js +++ b/scripts/client/nametag.js @@ -48,7 +48,7 @@ function updatePlayerNameTag(clientName, characterName, colour, paused, ping) { playerPaused[clientName] = paused; playerPing[clientName] = ping; - if(game.game == VRR_GAME_GTA_IV) { + if(getGame() == VRR_GAME_GTA_IV) { let client = getPlayerFromParams(clientName); if(client != false) { if(getPlayerPed(client) != null) { @@ -81,7 +81,7 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, // Health Bar if(getMultiplayerMod() == VRR_MPMOD_GTAC) { - if(game.game == VRR_GAME_GTA_III) { + if(getGame() == VRR_GAME_GTA_III) { // Mickey Hamfists is ridiculously tall. Raise the nametag for him a bit if(skin == 109) { y -= 20; @@ -214,7 +214,7 @@ function getClientFromPlayer(player) { // =========================================================================== function processNameTagRendering(event) { - //if(game.game >= GAME_GTA_IV) { + //if(getGame() >= GAME_GTA_IV) { // return false; //} diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 8cdd2416..109d337b 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -117,7 +117,7 @@ let weaponSlots = [ ]; function openAllGarages() { - switch(game.game) { + switch(getGame()) { case VRR_GAME_GTA_III: for(let i=0;i<=26;i++) { openGarage(i); @@ -146,7 +146,7 @@ function openAllGarages() { // =========================================================================== function closeAllGarages() { - switch(game.game) { + switch(getGame()) { case VRR_GAME_GTA_III: for(let i=0;i<=26;i++) { closeGarage(i); @@ -185,7 +185,7 @@ function setLocalPlayerControlState(controlState, cursorState = false) { logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); controlsEnabled = controlState; if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { - game.SET_PLAYER_CONTROL(getPlayerId(localClient), boolToInt(controlState)); + game.SET_PLAYER_CONTROL(game.GET_PLAYER_ID(), boolToInt(controlState)); } if(getGame() != VRR_GAME_GTA_IV) { @@ -246,7 +246,7 @@ function setCityAmbienceState(state, clearElements = false) { if(getMultiplayerMod() == VRR_MPMOD_GTAC) { game.setGenerateCarsAroundCamera(state); - if(game.game != VRR_GAME_GTA_SA) { + if(getGame() != VRR_GAME_GTA_SA) { game.setCiviliansEnabled(state); } @@ -622,7 +622,7 @@ function processLocalPlayerSphereEntryExitHandling() { // =========================================================================== function processJobRouteSphere() { - if(game.game == VRR_GAME_GTA_SA) { + if(getGame() == VRR_GAME_GTA_SA) { let position = getLocalPlayerPosition(); if(jobRouteLocationSphere != null) { if(getDistance(position, jobRouteLocationSphere.position) <= 2.0) { @@ -644,10 +644,10 @@ function forceLocalPlayerEquippedWeaponItem() { localPlayer.setWeaponAmmunition(getWeaponSlot(forceWeapon), forceWeaponAmmo); } } else { - if(getGame() < VRR_GAME_GTA_IV) { - forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); - forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); - } + //if(getGame() < VRR_GAME_GTA_IV) { + // forceWeaponClipAmmo = localPlayer.getWeaponClipAmmunition(getWeaponSlot(forceWeapon)); + // forceWeaponAmmo = localPlayer.getWeaponAmmunition(getWeaponSlot(forceWeapon)); + //} } } else { if(localPlayer.weapon > 0) { @@ -772,7 +772,7 @@ function processNearbyPickups() { // =========================================================================== function processGameSpecifics() { - if(game.game < VRR_GAME_GTA_IV) { + if(getGame() < VRR_GAME_GTA_IV) { game.clearMessages(); }