Fixes for IV
This commit is contained in:
@@ -56,14 +56,18 @@ function makePedStopAnimation(pedId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
if(getGame() != VRR_GAME_GTA_IV) {
|
||||||
getElementFromId(pedId).clearAnimations();
|
if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
|
||||||
} else {
|
getElementFromId(pedId).clearAnimations();
|
||||||
getElementFromId(pedId).clearObjective();
|
} else {
|
||||||
|
getElementFromId(pedId).clearObjective();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getElementFromId(pedId) == localPlayer) {
|
if(getElementFromId(pedId) == localPlayer) {
|
||||||
localPlayer.collisionsEnabled = true;
|
if(getGame() != VRR_GAME_GTA_IV) {
|
||||||
|
localPlayer.collisionsEnabled = true;
|
||||||
|
}
|
||||||
setLocalPlayerControlState(true, false);
|
setLocalPlayerControlState(true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ function addAllNetworkHandlers() {
|
|||||||
|
|
||||||
addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
|
addNetworkEventHandler("vrr.pedAnim", makePedPlayAnimation);
|
||||||
addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
|
addNetworkEventHandler("vrr.pedStopAnim", makePedStopAnimation);
|
||||||
|
addNetworkEventHandler("vrr.localPlayerSkin", setLocalPlayerSkin);
|
||||||
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
|
addNetworkEventHandler("vrr.forcePedAnim", forcePedAnimation);
|
||||||
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
|
addNetworkEventHandler("vrr.hideAllGUI", hideAllGUI);
|
||||||
addNetworkEventHandler("vrr.gameScript", setGameScriptState);
|
addNetworkEventHandler("vrr.gameScript", setGameScriptState);
|
||||||
@@ -128,10 +129,12 @@ function setPlayer2DRendering(hudState, labelState, smallGameMessageState, score
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
||||||
renderHUD = hudState;
|
renderHUD = hudState;
|
||||||
|
|
||||||
if(typeof setHUDEnabled != "undefined") {
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
natives.displayCash(hudState);
|
||||||
natives.displayHud(false);
|
natives.displayAmmo(hudState);
|
||||||
} else {
|
natives.displayHud(hudState);
|
||||||
|
} else {
|
||||||
|
if(typeof setHUDEnabled != "undefined") {
|
||||||
setHUDEnabled(hudState);
|
setHUDEnabled(hudState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,4 +300,15 @@ function setLocalPlayerInfiniteRun(state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerSkin(skinId) {
|
||||||
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
//natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
|
} else {
|
||||||
|
localPlayer.skin = skinId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -54,7 +54,8 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
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) {
|
||||||
natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
} else {
|
} else {
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
}
|
}
|
||||||
@@ -67,7 +68,8 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
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) {
|
||||||
natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
} else {
|
} else {
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
}
|
}
|
||||||
@@ -118,7 +120,8 @@ function toggleSkinSelect(state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(getGame() == VRR_GAME_GTA_IV) {
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
//natives.changePlayerModel(natives.getPlayerId(), allowedSkins[skinSelectorIndex][0]);
|
||||||
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
} else {
|
} else {
|
||||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -837,7 +837,7 @@ function setUpInitialGame() {
|
|||||||
natives.setPlayersDropMoneyInNetworkGame(false);
|
natives.setPlayersDropMoneyInNetworkGame(false);
|
||||||
natives.setSyncWeatherAndGameTime(false);
|
natives.setSyncWeatherAndGameTime(false);
|
||||||
natives.usePlayerColourInsteadOfTeamColour(true);
|
natives.usePlayerColourInsteadOfTeamColour(true);
|
||||||
natives.setDisplayPlayerNameAndIcon(false);
|
natives.setDisplayPlayerNameAndIcon(natives.getPlayerId(), false);
|
||||||
natives.removeTemporaryRadarBlipsForPickups();
|
natives.removeTemporaryRadarBlipsForPickups();
|
||||||
natives.setPickupsFixCars(false);
|
natives.setPickupsFixCars(false);
|
||||||
natives.displayCash(true);
|
natives.displayCash(true);
|
||||||
|
|||||||
@@ -196,7 +196,11 @@ function removePlayerFromVehicle(client) {
|
|||||||
|
|
||||||
function setPlayerSkin(client, skinIndex) {
|
function setPlayerSkin(client, skinIndex) {
|
||||||
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameData().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameData().skins[getGame()][skinIndex][1]})`);
|
logToConsole(LOG_DEBUG, `Setting ${getPlayerDisplayForConsole(client)}'s skin to ${getGameData().skins[getGame()][skinIndex][0]} (Index: ${skinIndex}, Name: ${getGameData().skins[getGame()][skinIndex][1]})`);
|
||||||
client.player.modelIndex = getGameData().skins[getGame()][skinIndex][0];
|
if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
triggerNetworkEvent("vrr.localPlayerSkin", client, getGameData().skins[getGame()][skinIndex][0]);
|
||||||
|
} else {
|
||||||
|
client.player.modelIndex = getGameData().skins[getGame()][skinIndex][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -371,9 +371,11 @@ function selectCharacter(client, characterId = -1) {
|
|||||||
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
//setPlayerCameraLookAt(client, getPosBehindPos(spawnPosition, spawnHeading, 5), spawnPosition);
|
||||||
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING;
|
getPlayerData(client).pedState = VRR_PEDSTATE_SPAWNING;
|
||||||
|
|
||||||
if(getGame() < VRR_GAME_MAFIA_ONE) {
|
if(getGame() < VRR_GAME_GTA_IV) {
|
||||||
spawnPlayer(client, spawnPosition, spawnHeading, getGameData().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
spawnPlayer(client, spawnPosition, spawnHeading, getGameData().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
||||||
} else {
|
} else if(getGame() == VRR_GAME_GTA_IV) {
|
||||||
|
spawnPlayer(client, spawnPosition, spawnHeading, getGameData().skins[getGame()][skin][0], spawnInterior, spawnDimension);
|
||||||
|
} else if(getGame() >= VRR_GAME_MAFIA_ONE) {
|
||||||
spawnPlayer(client, getGameData().skins[getGame()][skin][0], spawnPosition, spawnHeading);
|
spawnPlayer(client, getGameData().skins[getGame()][skin][0], spawnPosition, spawnHeading);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user