Skip to content

Commit 1ce715c

Browse files
committed
feat(natives/interior): update interiors natives/examples
* Update PIN_INTERIOR_IN_MEMORY * Update IS_INTERIOR_ENTITY_SET_ACTIVE * Update ENABLE_SHADOW_CULL_MODEL_THIS_FRAME * Update ENABLE_EXTERIOR_CULL_MODEL_THIS_FRAME * Update DISABLE_METRO_SYSTEM * Update DEACTIVATE_INTERIOR_ENTITY_SET * Update ACTIVATE_INTERIOR_ENTITY_SET
1 parent 5999728 commit 1ce715c

9 files changed

+255
-41
lines changed

INTERIOR/ActivateInteriorEntitySet.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,53 @@ aliases: ["0x55E86AF2712B36A1","_ENABLE_INTERIOR_PROP"]
99
void ACTIVATE_INTERIOR_ENTITY_SET(int interior, char* entitySetName);
1010
```
1111
12+
Activates the entity set with the specified name in the given interior. If you want to disable a entity set, use [`DEACTIVATE_INTERIOR_ENTITY_SET`](#_0x420BD37289EEE162).
13+
1214
```
13-
More info: http://gtaforums.com/topic/836367-adding-props-to-interiors/
15+
NativeDB Introduced: v323
16+
More info: https://gtaforums.com/topic/836367-adding-props-to-interiors/
1417
```
1518
1619
## Parameters
17-
* **interior**:
18-
* **entitySetName**:
20+
* **interior**: The index of the interior.
21+
* **entitySetName**: The name of the entity set to activate.
22+
23+
## Examples
24+
```lua
25+
-- Get the interior id for the casino penthouse
26+
local interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641)
27+
28+
-- Activate certain entity sets for the casino penthouse
29+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open')
30+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open')
31+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro')
32+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter')
33+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03')
34+
ActivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02')
35+
```
36+
```javascript
37+
// Get the interior id for the casino penthouse
38+
const interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
39+
40+
// Activate certain entity sets for the casino penthouse
41+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open');
42+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open');
43+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro');
44+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter');
45+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03');
46+
ActivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02');
47+
```
48+
```csharp
49+
using static CitizenFX.Core.Native.API;
50+
51+
// Get the interior id for the casino penthouse
52+
int interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
1953

54+
// Activate certain entity sets for the casino penthouse
55+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open');
56+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open');
57+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro');
58+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter');
59+
ActivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03');
60+
ActivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02');
61+
```

INTERIOR/DeactivateInteriorEntitySet.md

+46-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,52 @@ aliases: ["0x420BD37289EEE162","_DISABLE_INTERIOR_PROP"]
99
void DEACTIVATE_INTERIOR_ENTITY_SET(int interior, char* entitySetName);
1010
```
1111
12+
Deactivates the entity set with the specified name in the given interior.
13+
14+
```
15+
NativeDB Introduced: v323
16+
```
1217
1318
## Parameters
14-
* **interior**:
15-
* **entitySetName**:
19+
* **interior**: The index of the interior.
20+
* **entitySetName**: The name of the entity set to deactivate.
21+
22+
## Examples
23+
```lua
24+
-- Get the interior id for the casino penthouse
25+
local interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641)
26+
27+
-- Deactivate certain entity sets for the casino penthouse
28+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open')
29+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open')
30+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro')
31+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter')
32+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03')
33+
DeactivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02')
34+
```
35+
```javascript
36+
// Get the interior id for the casino penthouse
37+
const interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
38+
39+
// Deactivate certain entity sets for the casino penthouse
40+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open');
41+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open');
42+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro');
43+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter');
44+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03');
45+
DeactivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02');
46+
```
47+
```csharp
48+
using static CitizenFX.Core.Native.API;
49+
50+
// Get the interior id for the casino penthouse
51+
int interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
1652

53+
// Deactivate certain entity sets for the casino penthouse
54+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Spa_Bar_Open');
55+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Media_Bar_Open');
56+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Arcade_Retro');
57+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Bar_Clutter');
58+
DeactivateInteriorEntitySet(interiorID, 'Set_Pent_Clutter_03');
59+
DeactivateInteriorEntitySet(interiorID, 'Set_pent_bar_light_02');
60+
```

INTERIOR/DisableMetroSystem.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
ns: INTERIOR
3+
aliases: ["_0x9E6542F0CE8E70A3"]
4+
---
5+
## DISABLE_METRO_SYSTEM
6+
7+
```c
8+
// 0x9E6542F0CE8E70A3 0x5EF9C5C2
9+
void DISABLE_METRO_SYSTEM(BOOL toggle);
10+
```
11+
12+
Completely disables the metro system in the game.
13+
14+
```
15+
NativeDB Introduced: v323
16+
```
17+
18+
## Parameters
19+
* **toggle**: A boolean value indicating whether to disable (`true`) or enable (`false`) the metro system.
20+
21+
## Examples
22+
```lua
23+
-- Disable metro system
24+
DisableMetroSystem(true)
25+
```
26+
```javascript
27+
// Disable metro system
28+
DisableMetroSystem(true);
29+
```
30+
```csharp
31+
using static CitizenFX.Core.Native.API;
32+
33+
// Disable metro system
34+
DisableMetroSystem(true);
35+
```

INTERIOR/EnableExteriorCullModelThisFrame.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,34 @@ aliases: ["0xA97F257D0151A6AB","_HIDE_MAP_OBJECT_THIS_FRAME"]
99
void ENABLE_EXTERIOR_CULL_MODEL_THIS_FRAME(Hash mapObjectHash);
1010
```
1111
12+
Culls exterior objects from rendering (G-buffer only) based on the model name hash. Primarily used in multiplayer apartments to hide the exterior shell of buildings. This native needs to be called every frame.
13+
1214
```
13-
This is the native that is used to hide the exterior of GTA Online apartment buildings when you are inside an apartment.
15+
NativeDB Introduced: v323
16+
More info: https://gtaforums.com/topic/836301-hiding-gta-online-apartment-exteriors/
1417
```
1518
1619
## Parameters
17-
* **mapObjectHash**:
20+
* **mapObjectHash**: The hash of the model name to cull
21+
22+
## Examples
23+
```lua
24+
CreateThread(function()
25+
local buildingTopHash = GetHashKey("hei_kt1_08_buildingtop_a")
26+
local emissiveHash = GetHashKey("hei_kt1_08_kt1_emissive_ema")
27+
while (true) do
28+
EnableExteriorCullModelThisFrame(buildingTopHash)
29+
EnableExteriorCullModelThisFrame(emissiveHash)
30+
Wait(0)
31+
end
32+
end)
33+
```
34+
```javascript
35+
const buildingTopHash = GetHashKey("hei_kt1_08_buildingtop_a");
36+
const emissiveHash = GetHashKey("hei_kt1_08_kt1_emissive_ema");
1837

38+
setTick(() => {
39+
EnableExteriorCullModelThisFrame(buildingTopHash);
40+
EnableExteriorCullModelThisFrame(emissiveHash);
41+
});
42+
```

INTERIOR/EnableScriptCullModelThisFrame.md

-14
This file was deleted.
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
ns: INTERIOR
3+
aliases: ["0x50C375537449F369", "_ENABLE_SCRIPT_CULL_MODEL_THIS_FRAME"]
4+
---
5+
## ENABLE_SHADOW_CULL_MODEL_THIS_FRAME
6+
7+
```c
8+
// 0x50C375537449F369
9+
void ENABLE_SHADOW_CULL_MODEL_THIS_FRAME(cs_type(Any) Hash mapObjectHash);
10+
```
11+
12+
Culls exterior objects from rendering (cascade shadows only) based on the model name hash. Primarily used in multiplayer apartments to hide the exterior structure of buildings. This native needs to be called every frame and is generally used with [`ENABLE_EXTERIOR_CULL_MODEL_THIS_FRAME`](#_0xA97F257D0151A6AB).
13+
14+
```
15+
NativeDB Introduced: v323
16+
```
17+
18+
## Parameters
19+
* **mapObjectHash**: The hash of the model name to cull from shadow rendering.
20+
21+
## Examples
22+
```lua
23+
CreateThread(function()
24+
local buildingTopHash = GetHashKey("hei_kt1_08_buildingtop_a")
25+
local emissiveHash = GetHashKey("hei_kt1_08_kt1_emissive_ema")
26+
while (true) do
27+
-- hei_kt1_08_buildingtop_a
28+
EnableExteriorCullModelThisFrame(buildingTopHash)
29+
EnableShadowCullModelThisFrame(buildingTopHash)
30+
-- hei_kt1_08_kt1_emissive_ema
31+
EnableExteriorCullModelThisFrame(emissiveHash)
32+
EnableShadowCullModelThisFrame(emissiveHash)
33+
34+
Wait(0)
35+
end
36+
end)
37+
```
38+
```javascript
39+
const buildingTopHash = GetHashKey("hei_kt1_08_buildingtop_a");
40+
const emissiveHash = GetHashKey("hei_kt1_08_kt1_emissive_ema");
41+
42+
setTick(() => {
43+
// hei_kt1_08_buildingtop_a
44+
EnableExteriorCullModelThisFrame(buildingTopHash);
45+
EnableShadowCullModelThisFrame(buildingTopHash);
46+
// hei_kt1_08_kt1_emissive_ema
47+
EnableExteriorCullModelThisFrame(emissiveHash);
48+
EnableShadowCullModelThisFrame(emissiveHash);
49+
});
50+
```

INTERIOR/IsInteriorEntitySetActive.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,43 @@ aliases: ["0x35F7DD45E8C0A16D","_IS_INTERIOR_PROP_ENABLED"]
99
BOOL IS_INTERIOR_ENTITY_SET_ACTIVE(int interior, char* entitySetName);
1010
```
1111
12+
Determines whether the specified entity set is active within the given interior.
13+
14+
```
15+
NativeDB Introduced: v323
16+
```
1217
1318
## Parameters
14-
* **interior**:
15-
* **entitySetName**:
19+
* **interior**: The index of the interior.
20+
* **entitySetName**: The name of the entity set to check.
1621
1722
## Return value
23+
A boolean value indicating whether the entity set is active (`true`) or not (`false`).
24+
25+
## Examples
26+
```lua
27+
-- Check if the entity set `Set_Pent_Spa_Bar_Open` (casino penthouse) is active or not
28+
local interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641)
29+
local entitySet = "Set_Pent_Spa_Bar_Open"
30+
local isInteriorSetActive = IsInteriorEntitySetActive(interiorID, entitySet)
31+
32+
print("Entity Set Active: " .. isInteriorSetActive)
33+
```
34+
```javascript
35+
// Check if the entity set `Set_Pent_Spa_Bar_Open` (casino penthouse) is active or not
36+
const interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
37+
const entitySet = "Set_Pent_Spa_Bar_Open";
38+
const isInteriorSetActive = IsInteriorEntitySetActive(interiorID, entitySet);
39+
40+
console.log(`Entity Set Active: ${isInteriorSetActive}`);
41+
```
42+
```csharp
43+
using static CitizenFX.Core.Native.API;
44+
45+
// Check if the entity set `Set_Pent_Spa_Bar_Open` (casino penthouse) is active or not
46+
int interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641);
47+
string entitySet = "Set_Pent_Spa_Bar_Open";
48+
bool isInteriorSetActive = IsInteriorEntitySetActive(interiorID, entitySet);
49+
50+
Debug.WriteLine($"Entity Set Active: {isInteriorSetActive}");
51+
```

INTERIOR/N_0x9e6542f0ce8e70a3.md

-17
This file was deleted.

INTERIOR/PinInteriorInMemory.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ aliases: ["0x2CA429C029CCF247","_LOAD_INTERIOR"]
99
void PIN_INTERIOR_IN_MEMORY(int interior);
1010
```
1111
12+
Instructs the interior system to load the specified interior into memory.
13+
14+
```
15+
NativeDB Introduced: v323
16+
```
17+
1218
## Parameters
13-
* **interior**:
19+
* **interior**: The index of the interior.
1420
21+
## Examples
22+
```lua
23+
CreateThread(function()
24+
local interiorID = GetInteriorAtCoords(976.6364, 70.29476, 115.1641)
25+
PinInteriorInMemory(interiorID)
26+
repeat
27+
Wait(0)
28+
until IsInteriorReady(interiorID)
29+
end)
30+
```

0 commit comments

Comments
 (0)