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