Created
April 9, 2021 09:25
-
-
Save MrPancakers/2bb5a15a05ba5979bf851462b6e1aea4 to your computer and use it in GitHub Desktop.
GTA V Penthouse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Vector3: 976.636, 70.295, 115.164 | |
* IPL: vw_casino_penthouse | |
* Notes: | |
* This is missing the dealer you would have inside your penthouse | |
* | |
* | |
* Settings: | |
* Arcade: Types of arcade machines in the bar area | |
* - Set_Pent_Arcade_Modern | |
* - Set_Pent_Arcade_Retro | |
* Party: Wall Lights + Balloons inside the bar area | |
* - set_pent_bar_party_0 - Pink/Redish | |
* - set_pent_bar_party_1 - Black and yellow | |
* - set_pent_bar_party_2 - Blue and White | |
* - set_pent_bar_party_after - Trashed bar areat | |
* Light: Lights around the bar | |
* - set_pent_bar_light_0 - Yellow | |
* - set_pent_bar_light_01 - Pink/Redish | |
* - set_pent_bar_light_02 - Blue and White | |
* Blockers: Stops you from entering certain areas | |
* - Set_Pent_CINE_BLOCKER (Cinema Room) | |
* - Set_Pent_SPA_BLOCKER (Spa Behind the bar) | |
* - Set_Pent_BAR_BLOCKER (Bar, but it doesn't block the door from the Spa area) | |
* - Set_Pent_OFFICE_BLOCKER (Office outside lounge area) | |
* - Set_Pent_LOUNGE_BLOCKER (Blocks lounge door from penthouse area) | |
* - Set_Pent_GUEST_BLOCKER (Guest room attached to penthouse) | |
* Clutter: Adds random items on tables | |
* - Set_Pent_Bar_Clutter (Random items on bar and tables) | |
* - Set_Pent_Clutter_01 (Adds clutter throughout the penthouse, 1, 2, 3 all just adds different types of clutter so loading all 3 makes the whole place messy) | |
* - Set_Pent_Clutter_02 | |
* - Set_Pent_Clutter_03 | |
* Dealer: Adds a divider into the lounge area, I assume something else needs to be loaded here | |
* - Set_Pent_NoDealer (Divider is closed) | |
* - Set_Pent_Dealer (Divider is open) | |
* Spa Bar Open: | |
* Adds a door to the spa area from the bar side. None of these loaded means no door | |
* - Set_Pent_Spa_Bar_Open (Doors open) | |
* - Set_Pent_Spa_Bar_Closed (Doors closed) | |
* Media Bar: | |
* Adds a door inside the media room from the bar side | |
* - Set_Pent_Media_Bar_Closed (Doors closed) | |
* - Set_Pent_Media_Bar_Open (Doors open) | |
* Pattern: | |
* Patterns on the carpet | |
* - Set_Pent_Pattern_01 (Pop) | |
* - Set_Pent_Pattern_02 | |
* - Set_Pent_Pattern_03 | |
* - Set_Pent_Pattern_04 | |
* - Set_Pent_Pattern_05 | |
* - Set_Pent_Pattern_06 | |
* - Set_Pent_Pattern_07 | |
* - Set_Pent_Pattern_08 | |
* - Set_Pent_Pattern_09 | |
* Tint Shell: The whole interior, color is controlled by _SET_INTERIOR_PROP_COLOR | |
* - Set_Pent_Tint_Shell | |
* - 0 : Crazy random colors | |
* - 1 : Pink (Timeless) | |
* - 2 : Hot pink and Blue (Vibrant) | |
* - 3 : Dark blue (Sharp) | |
*/ | |
let interiorId = 0; | |
// Penthouse options, used to load your penthouse | |
const penthouseCustomisation = { | |
"tint_color": 3, | |
"interior": "Set_Pent_Tint_Shell", | |
"pattern": "Set_Pent_Pattern_01", | |
"spa": "Set_Pent_Spa_Bar_Open", | |
"media_bar": "Set_Pent_Media_Bar_Open", | |
"dealer": "Set_Pent_Dealer", | |
"arcade": "Set_Pent_Arcade_Retro", | |
"bar_clutter": "", | |
"clutter_variation": "", | |
"light": "set_pent_bar_light_02", | |
"party": "set_pent_bar_party_2" | |
} | |
// Loading the penthouse, use when needing to request the IPL and load the interior | |
mp.events.add("casino:loadPenthouse", () => { | |
mp.game.streaming.requestIpl("vw_casino_penthouse"); | |
if(mp.game.streaming.isIplActive("vw_casino_penthouse")){ | |
interiorId = mp.game.interior.getInteriorAtCoords(976.636, 70.295, 115.164); | |
reloadPenthouse(); | |
} else { | |
mp.gui.chat.push("IPL failed to load, try again."); | |
} | |
}); | |
// Unloading the penthouse, used when no longer needing this loaded. | |
mp.events.add("casino:unloadPenthouse", () => { | |
mp.game.streaming.removeIpl("vw_casino_penthouse"); | |
for(const [item, value] of Object.entries(penthouseCustomisation)){ | |
mp.game.interior.disableInteriorProp(interiorId, value); | |
} | |
}); | |
// When we load a feature, we need to unload the current one | |
mp.events.add("casino:updatePenthouseFeature", (feature, value) => { | |
if(penthouseCustomisation.hasOwnProperty(feature)){ | |
if(feature !== "tint_color"){ | |
mp.game.interior.disableInteriorProp(interiorId, penthouseCustomisation[feature]); | |
} | |
penthouseCustomisation[feature] = value; | |
reloadPenthouse(); | |
} | |
}); | |
// Updates all features of a penthouse | |
// NOTE: Needed especially when changing tint color, some furniture needs the updated tint_color | |
function reloadPenthouse(){ | |
for(const [item, value] of Object.entries(penthouseCustomisation)){ | |
mp.game.interior.enableInteriorProp(interiorId, value); | |
mp.game.invoke("0xC1F1920BAF281317", interiorId, value, parseInt(penthouseCustomisation["tint_color"])); // _SET_INTERIOR_PROP_COLOR | |
} | |
mp.game.interior.refreshInterior(interiorId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment