diff --git a/scripts/client/skin-select.js b/scripts/client/skin-select.js index 42bf3b8a..13093a82 100644 --- a/scripts/client/skin-select.js +++ b/scripts/client/skin-select.js @@ -111,20 +111,10 @@ function toggleSkinSelect(state) { localPlayer.skin = allowedSkins[skinSelectorIndex][0]; skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1]; - gui.showCursor(true, false); - //localPlayer.invincible = true; - //localPlayer.setProofs(true, true, true, true, true); - localPlayer.collisionsEnabled = false; - + setLocalPlayerControlState(false, false); } else { usingSkinSelector = false; - //game.restoreCamera(true); - gui.showCursor(false, true); - if(localPlayer) { - //localPlayer.invincible = false; - //localPlayer.setProofs(false, false, false, false, false); - localPlayer.collisionsEnabled = true; - } + setLocalPlayerControlState(false, false); } } diff --git a/scripts/client/utilities.js b/scripts/client/utilities.js index 3223ed58..dd363cbe 100644 --- a/scripts/client/utilities.js +++ b/scripts/client/utilities.js @@ -184,11 +184,12 @@ function setLocalPlayerFrozenState(state) { function setLocalPlayerControlState(controlState, cursorState = false) { logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting control state to ${controlState} (Cursor: ${cursorState})`); controlsEnabled = controlState; - //localPlayer.invincible = true; - //if(getGame() != VRR_GAME_GTA_IV) { - // localPlayer.collisionsEnabled = controlState; - // localPlayer.invincible = false; - //} + if(getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) { + game.SET_PLAYER_CONTROL(localClient.index, boolToInt(controlState)); + } + + localPlayer.collisionsEnabled = controlState; + localPlayer.invincible = true; } // ===========================================================================