Skip to content

Commit 3002b13

Browse files
Add interiors list
1 parent 45b33e7 commit 3002b13

File tree

4 files changed

+305
-0
lines changed

4 files changed

+305
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
from collections import defaultdict
4+
5+
url = "https://wiki.multitheftauto.com/wiki/Interior_IDs"
6+
response = requests.get(url)
7+
soup = BeautifulSoup(response.text, "html.parser")
8+
9+
interiors = []
10+
11+
# Find all relevant tables
12+
tables = soup.find_all("table", class_="wikitable")
13+
14+
for table in tables:
15+
header_row = table.find("tr")
16+
if not header_row or not header_row.find("th", colspan="6"):
17+
continue
18+
19+
interior_id_text = header_row.find("th").get_text(strip=True)
20+
if not interior_id_text.startswith("ID"):
21+
continue
22+
23+
try:
24+
interior_id = int(interior_id_text.split()[1])
25+
except (IndexError, ValueError):
26+
continue
27+
28+
rows = table.find_all("tr")[2:]
29+
for row in rows:
30+
cols = row.find_all("td")
31+
if len(cols) != 4:
32+
continue
33+
name = cols[0].get_text(strip=True)
34+
x = float(cols[1].get_text(strip=True))
35+
y = float(cols[2].get_text(strip=True))
36+
z = float(cols[3].get_text(strip=True))
37+
interiors.append({
38+
"id": interior_id,
39+
"name": name,
40+
"x": x,
41+
"y": y,
42+
"z": z
43+
})
44+
45+
# Group by ID
46+
grouped = defaultdict(list)
47+
for i in interiors:
48+
grouped[i["id"]].append({k: i[k] for k in ("name", "x", "y", "z")})
49+
50+
# Prepare TypeScript output
51+
ts_lines = ["export const interiors = {"]
52+
for interior_id in sorted(grouped.keys()):
53+
ts_lines.append(f" {interior_id}: [")
54+
for entry in grouped[interior_id]:
55+
ts_lines.append(
56+
f' {{ name: "{entry["name"]}", x: {entry["x"]}, y: {entry["y"]}, z: {entry["z"]} }},'
57+
)
58+
ts_lines.append(" ],")
59+
ts_lines.append("};\n")
60+
61+
# Write to file
62+
with open("interiors.ts", "w", encoding="utf-8") as f:
63+
f.write("\n".join(ts_lines))
64+
65+
print("TypeScript file 'interiors.ts' generated.")
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
---
2+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
4+
import { getSeeAlsoLinksFromList } from '@src/utils/general';
5+
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
6+
7+
export const interiors = {
8+
1: [
9+
{ name: "Ammu-nation 1", x: 289.787, y: -35.719, z: 1003.516 },
10+
{ name: "Burglary House 1", x: 224.6351, y: 1289.012, z: 1082.141 },
11+
{ name: "The Wellcome Pump (Catalina?)", x: 681.65, y: -452.86, z: -25.62 },
12+
{ name: "Restaurant 1", x: 446.6941, y: -9.7977, z: 1000.734 },
13+
{ name: "Caligulas Casino", x: 2235.2524, y: 1708.5146, z: 1010.6129 },
14+
{ name: "Denise's Place", x: 244.0892, y: 304.8456, z: 999.1484 },
15+
{ name: "Shamal cabin", x: 1.6127, y: 34.7411, z: 1199.0 },
16+
{ name: "Liberty City", x: -750.8, y: 491.0, z: 1371.7 },
17+
{ name: "Sweet's House", x: 2525.042, y: -1679.115, z: 1015.499 },
18+
{ name: "Transfender", x: 621.785, y: -12.5417, z: 1000.922 },
19+
{ name: "Safe House 4", x: 2216.54, y: -1076.29, z: 1050.484 },
20+
{ name: "Trials(Hyman Memorial?) Stadium", x: -1401.13, y: 106.11, z: 1032.273 },
21+
{ name: "Warehouse 1", x: 1405.312, y: -8.2928, z: 1000.913 },
22+
{ name: "Doherty Garage", x: -2042.42, y: 178.59, z: 28.84 },
23+
{ name: "Sindacco Abatoir", x: 963.6078, y: 2108.397, z: 1011.03 },
24+
{ name: "Sub Urban", x: 203.8173, y: -46.5385, z: 1001.805 },
25+
{ name: "Wu Zi Mu's Betting place", x: -2159.926, y: 641.4587, z: 1052.382 },
26+
],
27+
2: [
28+
{ name: "Ryder's House", x: 2464.211, y: -1697.952, z: 1013.508 },
29+
{ name: "Angel Pine Trailer", x: 0.344, y: -0.514, z: 999.4284 },
30+
{ name: "The Pig Pen", x: 1213.433, y: -6.683, z: 1000.922 },
31+
{ name: "BDups Crack Palace", x: 1523.751, y: -46.0458, z: 1002.131 },
32+
{ name: "Big Smoke's Crack Palace", x: 2543.661, y: -1303.932, z: 1025.07 },
33+
{ name: "Burglary House 2", x: 225.756, y: 1240.0, z: 1082.149 },
34+
{ name: "Burglary House 3", x: 447.47, y: 1398.348, z: 1084.305 },
35+
{ name: "Burglary House 4", x: 491.74, y: 1400.541, z: 1080.265 },
36+
{ name: "Katie's Place", x: 267.229, y: 304.71, z: 999.148 },
37+
{ name: "Loco Low Co.", x: 612.591, y: -75.637, z: 997.992 },
38+
{ name: "Reece's Barbershop", x: 411.6259, y: -21.4332, z: 1001.8046 },
39+
{ name: "Safe House 17", x: 2237.59, y: -1080.8699, z: 1049.0234 },
40+
],
41+
3: [
42+
{ name: "Jizzy's Pleasure Domes", x: -2636.719, y: 1402.917, z: 906.4609 },
43+
{ name: "Brothel", x: 940.652, y: -18.486, z: 1000.93 },
44+
{ name: "Brothel 2", x: 967.5334, y: -53.0245, z: 1001.125 },
45+
{ name: "BDups Apartment", x: 1527.38, y: -11.02, z: 1002.1 },
46+
{ name: "Bike School", x: 1494.335, y: 1305.651, z: 1093.289 },
47+
{ name: "Big Spread Ranch", x: 1210.257, y: -29.2986, z: 1000.879 },
48+
{ name: "LV Tattoo Parlour", x: -204.439, y: -43.652, z: 1002.299 },
49+
{ name: "LVPD HQ", x: 289.7703, y: 171.746, z: 1007.179 },
50+
{ name: "OG Loc's House", x: 516.889, y: -18.412, z: 1001.565 },
51+
{ name: "Pro-Laps", x: 207.356, y: -138.0029, z: 1003.313 },
52+
{ name: "Las Venturas Planning Dep.", x: 374.6708, y: 173.805, z: 1008.3893 },
53+
{ name: "Record Label Hallway", x: 1038.219, y: 6.9905, z: 1001.284 },
54+
{ name: "Driving School", x: -2027.92, y: -105.183, z: 1035.172 },
55+
{ name: "Johnson House", x: 2496.05, y: -1693.926, z: 1014.742 },
56+
{ name: "Burglary House 5", x: 234.733, y: 1190.391, z: 1080.258 },
57+
{ name: "Gay Gordo's Barbershop", x: 418.653, y: -82.639, z: 1001.805 },
58+
{ name: "Helena's Place", x: 292.4459, y: 308.779, z: 999.1484 },
59+
{ name: "Inside Track Betting", x: 826.8863, y: 5.5091, z: 1004.483 },
60+
{ name: "Sex Shop", x: -106.7268, y: -19.6444, z: 1000.719 },
61+
{ name: "Wheel Arch Angels", x: 614.3889, y: -124.0991, z: 997.995 },
62+
],
63+
4: [
64+
{ name: "24/7 shop 1", x: -27.3769, y: -27.6416, z: 1003.557 },
65+
{ name: "Ammu-Nation 2", x: 285.8, y: -84.547, z: 1001.539 },
66+
{ name: "Burglary House 6", x: -262.91, y: 1454.966, z: 1084.367 },
67+
{ name: "Burglary House 7", x: 221.4296, y: 1142.423, z: 1082.609 },
68+
{ name: "Burglary House 8", x: 261.1168, y: 1286.519, z: 1080.258 },
69+
{ name: "Diner 2", x: 460.0, y: -88.43, z: 999.62 },
70+
{ name: "Dirtbike Stadium", x: -1435.869, y: -662.2505, z: 1052.465 },
71+
{ name: "Michelle's Place", x: 302.6404, y: 304.8048, z: 999.1484 },
72+
],
73+
5: [
74+
{ name: "Madd Dogg's Mansion", x: 1262.1451416016, y: -785.32977294922, z: 1091.90625 },
75+
{ name: "Well Stacked Pizza Co.", x: 377.7758, y: -126.2766, z: 1001.492 },
76+
{ name: "Victim", x: 221.331, y: -6.6169, z: 1002.0078 },
77+
{ name: "Burning Desire House", x: 2351.154, y: -1180.577, z: 1027.977 },
78+
{ name: "Barbara's Place", x: 322.1979, y: 302.4979, z: 999.1484 },
79+
{ name: "Burglary House 9", x: 22.79996, y: 1404.642, z: 1084.43 },
80+
{ name: "Burglary House 10", x: 228.9003, y: 1114.477, z: 1080.992 },
81+
{ name: "Burglary House 11", x: 140.5631, y: 1369.051, z: 1083.864 },
82+
{ name: "The Crack Den", x: 322.1117, y: 1119.327, z: 1083.883 },
83+
{ name: "Police Station (Barbara's)", x: 322.72, y: 306.43, z: 999.15 },
84+
{ name: "Diner 1", x: 448.7435, y: -110.0457, z: 1000.0772 },
85+
{ name: "Ganton Gym", x: 768.0793, y: 5.8606, z: 1000.716 },
86+
{ name: "Vank Hoff Hotel", x: 2232.821, y: -1110.018, z: 1050.883 },
87+
],
88+
6: [
89+
{ name: "Ammu-Nation 3", x: 297.446, y: -109.968, z: 1001.516 },
90+
{ name: "Ammu-Nation 4", x: 317.238, y: -168.052, z: 999.593 },
91+
{ name: "LSPD HQ", x: 246.451, y: 65.586, z: 1003.641 },
92+
{ name: "Safe House 3", x: 2333.033, y: -1073.96, z: 1049.023 },
93+
{ name: "Safe House 5", x: 2194.291, y: -1204.015, z: 1049.023 },
94+
{ name: "Safe House 6", x: 2308.871, y: -1210.717, z: 1049.023 },
95+
{ name: "Cobra Marital Arts Gym", x: 774.087, y: -47.983, z: 1000.586 },
96+
{ name: "24/7 shop 2", x: -26.718, y: -55.986, z: 1003.547 },
97+
{ name: "Millie's Bedroom", x: 344.52, y: 304.821, z: 999.148 },
98+
{ name: "Fanny Batter's Brothel", x: 744.271, y: 1437.253, z: 1102.703 },
99+
{ name: "RC Zero's Shop", x: -2241.07, y: 128.52, z: 1035.4195 },
100+
{ name: "Restaurant 2", x: 443.981, y: -65.219, z: 1050.0 },
101+
{ name: "Burglary House 15", x: 234.319, y: 1066.455, z: 1084.208 },
102+
{ name: "Burglary House 16", x: -69.049, y: 1354.056, z: 1080.211 },
103+
],
104+
7: [
105+
{ name: "Ammu-Nation 5 (2 Floors)", x: 315.385, y: -142.242, z: 999.601 },
106+
{ name: "8-Track Stadium", x: -1417.872, y: -276.426, z: 1051.191 },
107+
{ name: "Below the Belt Gym", x: 774.243, y: -76.009, z: 1000.654 },
108+
],
109+
8: [
110+
{ name: "Safe house 2", x: 2365.2383, y: -1134.2969, z: 1050.875 },
111+
{ name: "Colonel Fuhrberger's House", x: 2807.899, y: -1172.921, z: 1025.57 },
112+
{ name: "Burglary House 22", x: -42.49, y: 1407.644, z: 1084.43 },
113+
],
114+
9: [
115+
{ name: "Unknown safe house", x: 2253.174, y: -1139.01, z: 1050.633 },
116+
{ name: "Andromada Cargo hold", x: 315.48, y: 984.13, z: 1959.11 },
117+
{ name: "Burglary House 12", x: 85.32596, y: 1323.585, z: 1083.859 },
118+
{ name: "Burglary House 13", x: 260.3189, y: 1239.663, z: 1084.258 },
119+
{ name: "Cluckin' Bell", x: 365.67, y: -11.61, z: 1002.0 },
120+
],
121+
10: [
122+
{ name: "Four Dragons Casino", x: 2009.414, y: 1017.899, z: 994.468 },
123+
{ name: "RC Zero's Battlefield", x: -975.5766, y: 1061.1312, z: 1345.6719 },
124+
{ name: "Burger Shot", x: 366.422, y: -73.47, z: 1001.508 },
125+
{ name: "Burglary House 14", x: 21.241, y: 1342.153, z: 1084.375 },
126+
{ name: "Janitor room(Four Dragons Maintenance)", x: 1891.396, y: 1018.126, z: 31.882 },
127+
{ name: "Safe House 1", x: 2262.83, y: -1137.71, z: 1050.63 },
128+
{ name: "Hashbury safe house", x: 2264.5231, y: -1210.5229, z: 1049.0234 },
129+
{ name: "24/7 shop 3", x: 6.078, y: -28.633, z: 1003.549 },
130+
{ name: "Abandoned AC Tower", x: 419.614, y: 2536.603, z: 10.0 },
131+
{ name: "SFPD HQ", x: 246.441, y: 112.164, z: 1003.219 },
132+
],
133+
11: [
134+
{ name: "The Four Dragons Office", x: 2011.603, y: 1017.023, z: 39.091 },
135+
{ name: "Los Santos safe house", x: 2282.9766, y: -1140.2861, z: 1050.8984 },
136+
{ name: "Ten Green Bottles Bar", x: 502.331, y: -70.682, z: 998.757 },
137+
],
138+
12: [
139+
{ name: "Budget Inn Motel Room", x: 444.6469, y: 508.239, z: 1001.4194 },
140+
{ name: "The Casino", x: 1132.945, y: -8.675, z: 1000.68 },
141+
{ name: "Macisla's Barbershop", x: 411.641, y: -51.846, z: 1001.898 },
142+
{ name: "Safe house 7", x: 2324.3848, y: -1148.4805, z: 1050.7101 },
143+
{ name: "Modern safe house", x: 2324.499, y: -1147.071, z: 1050.71 },
144+
],
145+
13: [
146+
{ name: "LS Atrium", x: 1724.33, y: -1625.784, z: 20.211 },
147+
{ name: "CJ's Garage", x: -2043.966, y: 172.932, z: 28.835 },
148+
],
149+
14: [
150+
{ name: "Kickstart Stadium", x: -1464.536, y: 1557.69, z: 1052.531 },
151+
{ name: "Didier Sachs", x: 204.1789, y: -165.874, z: 1000.523 },
152+
{ name: "Francis Int. Airport (Front ext.)", x: -1827.1473, y: 7.2074, z: 1061.1435 },
153+
{ name: "Francis Int. Airport (Baggage Claim/Ticket Sales)", x: -1855.5687, y: 41.2631, z: 1061.1435 },
154+
{ name: "San Fierro Chunk (cutscene place)", x: -2015.66, y: 148.2, z: 27.6875 },
155+
{ name: "Wardrobe", x: 255.719, y: -41.137, z: 1002.023 },
156+
],
157+
15: [
158+
{ name: "Binco", x: 207.543, y: -109.004, z: 1005.133 },
159+
{ name: "Blood Bowl Stadium", x: -1394.2, y: 987.62, z: 1023.96 },
160+
{ name: "Jefferson Motel", x: 2217.625, y: -1150.658, z: 1025.797 },
161+
{ name: "Burglary House 17", x: -285.711, y: 1470.697, z: 1084.375 },
162+
{ name: "Burglary House 18", x: 327.808, y: 1479.74, z: 1084.438 },
163+
{ name: "Burglary House 19", x: 375.572, y: 1417.439, z: 1081.328 },
164+
{ name: "Burglary House 20", x: 384.644, y: 1471.479, z: 1080.195 },
165+
{ name: "Burglary House 21", x: 295.467, y: 1474.697, z: 1080.258 },
166+
],
167+
16: [
168+
{ name: "24/7 shop 4", x: -25.373, y: -139.654, z: 1003.547 },
169+
{ name: "LS Tattoo Parlour", x: -204.558, y: -25.697, z: 1002.273 },
170+
{ name: "Sumoring? stadium", x: -1400.0, y: 1250.0, z: 1040.0 },
171+
],
172+
17: [
173+
{ name: "24/7 shop 5", x: -25.393, y: -185.911, z: 1003.547 },
174+
{ name: "Club", x: 493.4687, y: -23.008, z: 1000.6796 },
175+
{ name: "Rusty Brown's - Ring Donuts", x: 377.003, y: -192.507, z: 1000.633 },
176+
{ name: "The Sherman's Dam Generator Hall", x: -942.132, y: 1849.142, z: 5.005 },
177+
{ name: "Hemlock Tattoo", x: 377.003, y: -192.507, z: 1000.633 },
178+
],
179+
18: [
180+
{ name: "Lil Probe Inn", x: -227.028, y: 1401.229, z: 27.769 },
181+
{ name: "24/7 shop 6", x: -30.946, y: -89.609, z: 1003.549 },
182+
{ name: "Atrium", x: 1726.137, y: -1645.23, z: 20.226 },
183+
{ name: "Warehouse 2", x: 1296.631, y: 0.592, z: 1001.023 },
184+
{ name: "Zip", x: 161.462, y: -91.394, z: 1001.805 },
185+
],
186+
};
187+
188+
---
189+
<StarlightPage frontmatter={{
190+
template: 'doc',
191+
title: 'Interiors',
192+
tableOfContents: false,
193+
}}>
194+
<p>List of San Andreas Interior IDs. Related functions: <a href="/reference/setElementInterior">setElementInterior</a> and <a href="/reference/getElementInterior">getElementInterior</a></p>
195+
<br>
196+
197+
<!-- Display one table per ID -->
198+
{Object.entries(interiors).map(([id, interiorsList]) => (
199+
<div class="interior-list">
200+
<h4 id={"id-"+id}>ID {id}</h4>
201+
<table>
202+
<thead>
203+
<tr>
204+
<th>Interior Name</th>
205+
<th>X</th>
206+
<th>Y</th>
207+
<th>Z</th>
208+
</tr>
209+
</thead>
210+
<tbody>
211+
{interiorsList.map(interior => (
212+
<tr>
213+
<td>{interior.name}</td>
214+
<td><code>{interior.x.toFixed(3)}</code></td>
215+
<td><code>{interior.y.toFixed(3)}</code></td>
216+
<td><code>{interior.z.toFixed(3)}</code></td>
217+
</tr>
218+
))}
219+
</tbody>
220+
</table>
221+
</div>
222+
))}
223+
224+
225+
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
226+
'reference:ID_Lists',
227+
])} currentId='' />
228+
</StarlightPage>
229+
230+
<style>
231+
.interior-list {
232+
margin-bottom: 2rem;
233+
border: 1px solid var(--sl-color-gray-3);
234+
padding: 1rem;
235+
}
236+
.interior-list h4 {
237+
margin: 0;
238+
}
239+
</style>

web/src/pages/reference/ID_Lists/index.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1313
<li><a href="/reference/ID_Lists/Bones">Bones</a></li>
1414
<li><a href="/reference/ID_Lists/Damage_Types">Damage Types</a></li>
1515
<li><a href="/reference/ID_Lists/Garages">Garages</a></li>
16+
<li><a href="/reference/ID_Lists/Interiors">Interiors</a></li>
1617
<li><a href="/reference/ID_Lists/Vehicle_Colors">Vehicle Colors</a></li>
1718
<li><a href="/reference/ID_Lists/Vehicle_Variants">Vehicle Variants</a></li>
1819
<li><a href="/reference/ID_Lists/Weather">Weather</a></li>

0 commit comments

Comments
 (0)