Skip to content

Commit 96f9da2

Browse files
Add Vending machines list
1 parent 3002b13 commit 96f9da2

File tree

6 files changed

+273
-2
lines changed

6 files changed

+273
-2
lines changed

migrate/oldwiki/additional/parse_interiors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
grouped[i["id"]].append({k: i[k] for k in ("name", "x", "y", "z")})
4949

5050
# Prepare TypeScript output
51-
ts_lines = ["export const interiors = {"]
51+
ts_lines = ["const interiors = {"]
5252
for interior_id in sorted(grouped.keys()):
5353
ts_lines.append(f" {interior_id}: [")
5454
for entry in grouped[interior_id]:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
url = "https://wiki.multitheftauto.com/wiki/Vending"
5+
response = requests.get(url)
6+
soup = BeautifulSoup(response.text, "html.parser")
7+
8+
# Find the vending machine table
9+
table = soup.find("table", class_="wikitable")
10+
rows = table.find_all("tr")[1:] # Skip header row
11+
12+
vending_machines = []
13+
14+
for row in rows:
15+
cols = row.find_all("td")
16+
if len(cols) < 6:
17+
continue
18+
model_id = int(cols[0].get_text(strip=True))
19+
name = cols[1].get_text(strip=True)
20+
x = float(cols[2].get_text(strip=True))
21+
y = float(cols[3].get_text(strip=True))
22+
z = float(cols[4].get_text(strip=True))
23+
rot_z = float(cols[5].get_text(strip=True))
24+
vending_machines.append({
25+
"modelId": model_id,
26+
"name": name,
27+
"x": x,
28+
"y": y,
29+
"z": z,
30+
"rotZ": rot_z
31+
})
32+
33+
# Generate TypeScript variable
34+
ts_lines = ["const vendingMachines = ["]
35+
for v in vending_machines:
36+
ts_lines.append(
37+
f' {{ modelId: {v["modelId"]}, name: "{v["name"]}", x: {v["x"]}, y: {v["y"]}, z: {v["z"]}, rotZ: {v["rotZ"]} }},'
38+
)
39+
ts_lines.append("];\n")
40+
41+
# Write to file
42+
with open("vendingMachines.ts", "w", encoding="utf-8") as f:
43+
f.write("\n".join(ts_lines))
44+
45+
print("TypeScript file 'vendingMachines.ts' generated.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
44
import { getSeeAlsoLinksFromList } from '@src/utils/general';
55
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
66
7-
export const interiors = {
7+
const interiors = {
88
1: [
99
{ name: "Ammu-nation 1", x: 289.787, y: -35.719, z: 1003.516 },
1010
{ name: "Burglary House 1", x: 224.6351, y: 1289.012, z: 1082.141 },
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
import { Code } from '@astrojs/starlight/components';
8+
9+
const paintjobsById = {
10+
536: { vehicleName: "Blade", paintjobs: [0,1,2] },
11+
575: { vehicleName: "Broadway", paintjobs: [0,1] },
12+
483: { vehicleName: "Camper", paintjobs: [0] },
13+
562: { vehicleName: "Elegy", paintjobs: [0,1,2] },
14+
565: { vehicleName: "Flash", paintjobs: [0,1,2] },
15+
559: { vehicleName: "Jester", paintjobs: [0,1,2] },
16+
534: { vehicleName: "Remington", paintjobs: [0,1,2] },
17+
567: { vehicleName: "Savanna", paintjobs: [0,1,2] },
18+
535: { vehicleName: "Slamvan", paintjobs: [0,1,2] },
19+
560: { vehicleName: "Sultan", paintjobs: [0,1,2] },
20+
576: { vehicleName: "Tornado", paintjobs: [0,1,2] },
21+
558: { vehicleName: "Uranus", paintjobs: [0,1,2] },
22+
};
23+
24+
let luaTable = `local vehiclePaintjobs = {`;
25+
Object.entries(paintjobsById).forEach(([id, { vehicleName, paintjobs }]) => {
26+
luaTable += `\n [${id}] = {${paintjobs.join(', ')}}, -- ${vehicleName}`;
27+
});
28+
luaTable += `\n}\n`;
29+
30+
31+
---
32+
<StarlightPage frontmatter={{
33+
template: 'doc',
34+
title: 'Vehicle Paintjobs',
35+
tableOfContents: false,
36+
}}>
37+
<p>
38+
Paintjobs can be applied on a vehicle using <a href="/reference/setVehiclePaintjob">setVehiclePaintjob</a>.</p>
39+
<p>To remove a paintjob from a vehicle, apply paintjob number <code>3</code> to it.
40+
</p>
41+
<table>
42+
<thead>
43+
<tr>
44+
<th>Vehicle Name</th>
45+
<th>Vehicle ID</th>
46+
<th>Paintjobs</th>
47+
</tr>
48+
</thead>
49+
<tbody>
50+
{Object.entries(paintjobsById).map(([id, { vehicleName, paintjobs }]) => (
51+
<tr>
52+
<td>{vehicleName}</td>
53+
<td>{id}</td>
54+
<td>{paintjobs.join(', ')}</td>
55+
</tr>
56+
))}
57+
</tbody>
58+
</table>
59+
<p>Above list serialized in Lua:</p>
60+
61+
<Code code={luaTable} lang="lua" />
62+
63+
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
64+
'reference:ID_Lists',
65+
])} currentId='' />
66+
</StarlightPage>
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
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+
import { Code } from '@astrojs/starlight/components';
8+
9+
const vendingMachines = [
10+
{ modelId: 1302, name: "vendmachfd", x: -2420.18, y: 985.945, z: 44.2969, rotZ: -90.0 },
11+
{ modelId: 1209, name: "vendmach", x: -2420.22, y: 984.578, z: 44.2969, rotZ: -90.0 },
12+
{ modelId: 1977, name: "vendin3", x: 316.875, y: -140.352, z: 998.586, rotZ: 90.0 },
13+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 2225.2, y: -1153.42, z: 1025.91, rotZ: 90.0 },
14+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 2155.91, y: 1606.77, z: 1000.05, rotZ: -90.0 },
15+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 2576.7, y: -1284.43, z: 1061.09, rotZ: 90.0 },
16+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 2222.2, y: 1606.77, z: 1000.05, rotZ: -90.0 },
17+
{ modelId: 1775, name: "CJ_SPRUNK1", x: -19.0391, y: -57.8359, z: 1003.63, rotZ: 0.0 },
18+
{ modelId: 1775, name: "CJ_SPRUNK1", x: -16.1172, y: -91.6406, z: 1003.63, rotZ: 0.0 },
19+
{ modelId: 1775, name: "CJ_SPRUNK1", x: -32.4453, y: -186.695, z: 1003.63, rotZ: 0.0 },
20+
{ modelId: 1775, name: "CJ_SPRUNK1", x: -35.7266, y: -140.227, z: 1003.63, rotZ: 0.0 },
21+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 495.969, y: -24.3203, z: 1000.73, rotZ: 0.0 },
22+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 501.828, y: -1.42969, z: 1000.73, rotZ: 0.0 },
23+
{ modelId: 1775, name: "CJ_SPRUNK1", x: 373.828, y: -178.141, z: 1000.73, rotZ: 0.0 },
24+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 330.68, y: 178.5, z: 1020.07, rotZ: 0.0 },
25+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 331.922, y: 178.5, z: 1020.07, rotZ: 0.0 },
26+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 350.906, y: 206.086, z: 1008.48, rotZ: -90.0 },
27+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 361.562, y: 158.617, z: 1008.48, rotZ: 0.0 },
28+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 371.594, y: 178.453, z: 1020.07, rotZ: 0.0 },
29+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 374.891, y: 188.977, z: 1008.48, rotZ: 0.0 },
30+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 2155.84, y: 1607.88, z: 1000.06, rotZ: -90.0 },
31+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 2202.45, y: 1617.01, z: 1000.06, rotZ: 360.0 },
32+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 2209.24, y: 1621.21, z: 1000.06, rotZ: 0.0 },
33+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 2222.37, y: 1602.64, z: 1000.06, rotZ: -90.0 },
34+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: -36.1484, y: -57.875, z: 1003.63, rotZ: 360.0 },
35+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: -17.5469, y: -91.7109, z: 1003.63, rotZ: 360.0 },
36+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: -16.5312, y: -140.297, z: 1003.63, rotZ: 360.0 },
37+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: -33.875, y: -186.766, z: 1003.63, rotZ: 360.0 },
38+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 500.562, y: -1.36719, z: 1000.73, rotZ: 0.0 },
39+
{ modelId: 1776, name: "CJ_CANDYVENDOR", x: 379.039, y: -178.883, z: 1000.73, rotZ: 90.0 },
40+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 1634.11, y: -2237.53, z: 12.8906, rotZ: 0.0 },
41+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 2480.86, y: -1959.27, z: 12.9609, rotZ: 360.0 },
42+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 2139.52, y: -1161.48, z: 23.3594, rotZ: -90.0 },
43+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 2153.23, y: -1016.15, z: 62.2344, rotZ: 308.132 },
44+
{ modelId: 956, name: "CJ_EXT_CANDY", x: -1350.12, y: 493.859, z: 10.5859, rotZ: -90.0 },
45+
{ modelId: 956, name: "CJ_EXT_CANDY", x: -2229.19, y: 286.414, z: 34.7031, rotZ: 0.0 },
46+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 1659.46, y: 1722.86, z: 10.2188, rotZ: 0.0 },
47+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 2647.7, y: 1129.66, z: 10.2188, rotZ: 0.0 },
48+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 1398.84, y: 2222.61, z: 10.4219, rotZ: 0.0 },
49+
{ modelId: 956, name: "CJ_EXT_CANDY", x: -1455.12, y: 2591.66, z: 55.2344, rotZ: 0.0 },
50+
{ modelId: 956, name: "CJ_EXT_CANDY", x: -76.0312, y: 1227.99, z: 19.125, rotZ: -90.0 },
51+
{ modelId: 956, name: "CJ_EXT_CANDY", x: -253.742, y: 2599.76, z: 62.2422, rotZ: -90.0 },
52+
{ modelId: 956, name: "CJ_EXT_CANDY", x: 662.43, y: -552.164, z: 15.7109, rotZ: 360.0 },
53+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1789.21, y: -1369.27, z: 15.1641, rotZ: 90.0 },
54+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1729.79, y: -1943.05, z: 12.9453, rotZ: 0.0 },
55+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 2060.12, y: -1897.64, z: 12.9297, rotZ: 0.0 },
56+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1928.73, y: -1772.45, z: 12.9453, rotZ: -90.0 },
57+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 2325.98, y: -1645.13, z: 14.2109, rotZ: 0.0 },
58+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 2352.18, y: -1357.16, z: 23.7734, rotZ: -90.0 },
59+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1154.73, y: -1460.89, z: 15.1562, rotZ: 90.0 },
60+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -1350.12, y: 492.289, z: 10.5859, rotZ: -90.0 },
61+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2118.97, y: -423.648, z: 34.7266, rotZ: 75.0001 },
62+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2118.62, y: -422.414, z: 34.7266, rotZ: 75.0001 },
63+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2097.27, y: -398.336, z: 34.7266, rotZ: 360.0 },
64+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2092.09, y: -490.055, z: 34.7266, rotZ: 0.0 },
65+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2063.27, y: -490.055, z: 34.7266, rotZ: 0.0 },
66+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2005.65, y: -490.055, z: 34.7266, rotZ: 0.0 },
67+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2034.46, y: -490.055, z: 34.7266, rotZ: 0.0 },
68+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2068.56, y: -398.336, z: 34.7266, rotZ: 360.0 },
69+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2039.85, y: -398.336, z: 34.7266, rotZ: 360.0 },
70+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -2011.14, y: -398.336, z: 34.7266, rotZ: 360.0 },
71+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -1980.79, y: 142.664, z: 27.0703, rotZ: 90.0 },
72+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 2319.99, y: 2532.85, z: 10.2188, rotZ: 0.0 },
73+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1520.15, y: 1055.27, z: 10.0, rotZ: 90.0 },
74+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -862.828, y: 1536.61, z: 21.9844, rotZ: 0.0 },
75+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -14.7031, y: 1175.36, z: 18.9531, rotZ: 0.0 },
76+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: -253.742, y: 2597.95, z: 62.2422, rotZ: -90.0 },
77+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 201.016, y: -107.617, z: 0.898438, rotZ: 90.0 },
78+
{ modelId: 955, name: "CJ_EXT_SPRUNK", x: 1277.771, y: 372.57, z: 19.5547, rotZ: 244.11 },
79+
{ modelId: 1340, name: "chillidogcart", x: 1589.7, y: -1287.27, z: 17.6406, rotZ: 90.0 },
80+
{ modelId: 1340, name: "chillidogcart", x: 1000.48, y: -1849.04, z: 12.7969, rotZ: 70.0 },
81+
{ modelId: 1340, name: "chillidogcart", x: 388.859, y: -2071.66, z: 7.94531, rotZ: 90.0 },
82+
{ modelId: 1340, name: "chillidogcart", x: -2691.68, y: 384.492, z: 4.48438, rotZ: 45.0 },
83+
{ modelId: 1340, name: "chillidogcart", x: -2146.52, y: -424.773, z: 35.3281, rotZ: 334.564 },
84+
{ modelId: 1340, name: "chillidogcart", x: -2094.23, y: -396.461, z: 35.6562, rotZ: 309.564 },
85+
{ modelId: 1340, name: "chillidogcart", x: -2036.32, y: -396.758, z: 35.6562, rotZ: 279.564 },
86+
{ modelId: 1340, name: "chillidogcart", x: 2537.82, y: 2137.12, z: 10.8594, rotZ: 0.0 },
87+
{ modelId: 1340, name: "chillidogcart", x: 1558.2, y: 979.445, z: 10.9453, rotZ: 0.0 },
88+
{ modelId: 1340, name: "chillidogcart", x: 2144.64, y: 1441.93, z: 10.8516, rotZ: 90.0 },
89+
{ modelId: 1340, name: "chillidogcart", x: -799.781, y: 1624.22, z: 27.125, rotZ: 72.0001 },
90+
{ modelId: 1340, name: "chillidogcart", x: -197.492, y: 2659.91, z: 62.8203, rotZ: 0.0 },
91+
{ modelId: 1340, name: "chillidogcart", x: -2199.99, y: -2386.89, z: 30.7188, rotZ: 19.3753 },
92+
{ modelId: 1341, name: "icescart_prop", x: -2286.54, y: 147.633, z: 35.3203, rotZ: 315.0 },
93+
{ modelId: 1341, name: "icescart_prop", x: -2384.23, y: -584.008, z: 132.109, rotZ: 360.0 },
94+
{ modelId: 1341, name: "icescart_prop", x: 2538.03, y: 2153.7, z: 10.7344, rotZ: 0.0 },
95+
{ modelId: 1341, name: "icescart_prop", x: 2295.71, y: 2250.1, z: 10.7344, rotZ: 0.0 },
96+
{ modelId: 1341, name: "icescart_prop", x: 1030.59, y: 1362.59, z: 10.8125, rotZ: -90.0 },
97+
{ modelId: 1341, name: "icescart_prop", x: 2125.13, y: 1442.08, z: 10.7031, rotZ: -90.0 },
98+
{ modelId: 1341, name: "icescart_prop", x: 2175.09, y: 1523.41, z: 10.7344, rotZ: -90.0 },
99+
{ modelId: 1342, name: "noodlecart_prop", x: -2515.79, y: -15.6172, z: 25.6328, rotZ: 325.0 },
100+
{ modelId: 1342, name: "noodlecart_prop", x: -2151.84, y: -435.562, z: 35.2891, rotZ: 314.564 },
101+
{ modelId: 1342, name: "noodlecart_prop", x: -2193.77, y: 605.188, z: 35.2109, rotZ: 285.0 },
102+
{ modelId: 1342, name: "noodlecart_prop", x: -2194.02, y: 613.406, z: 35.2109, rotZ: 85.0001 },
103+
{ modelId: 1342, name: "noodlecart_prop", x: -2197.59, y: 613.406, z: 35.2109, rotZ: 65.0 },
104+
{ modelId: 1342, name: "noodlecart_prop", x: -2181.48, y: 613.703, z: 35.2109, rotZ: 65.0 },
105+
{ modelId: 1342, name: "noodlecart_prop", x: -2187.15, y: 614.547, z: 35.2109, rotZ: 80.0001 },
106+
{ modelId: 1342, name: "noodlecart_prop", x: 2536.12, y: 2290.85, z: 10.8594, rotZ: 360.0 },
107+
];
108+
109+
// { modelID, name, x, y, z, rotZ }
110+
let luaTable = `local vendingMachines = {`;
111+
vendingMachines.forEach((machine, index) => {
112+
luaTable += `\n { modelID = ${machine.modelId}, name = "${machine.name}", x = ${machine.x}, y = ${machine.y}, z = ${machine.z}, rotZ = ${machine.rotZ} }`;
113+
if (index < vendingMachines.length - 1) {
114+
luaTable += ',';
115+
}
116+
});
117+
luaTable += `\n}\n`;
118+
119+
120+
---
121+
<StarlightPage frontmatter={{
122+
template: 'doc',
123+
title: 'Vending Machines',
124+
tableOfContents: false,
125+
}}>
126+
<p>List of San Andreas Vending machines:</p>
127+
<table>
128+
<thead>
129+
<tr>
130+
<th>Model ID</th>
131+
<th>Model Name</th>
132+
<th>X</th>
133+
<th>Y</th>
134+
<th>Z</th>
135+
<th>Rot Z</th>
136+
</tr>
137+
</thead>
138+
<tbody>
139+
{vendingMachines.map(machine => (
140+
<tr>
141+
<td>{machine.modelId}</td>
142+
<td>{machine.name}</td>
143+
<td>{machine.x}</td>
144+
<td>{machine.y}</td>
145+
<td>{machine.z}</td>
146+
<td>{machine.rotZ}</td>
147+
</tr>
148+
))}
149+
</tbody>
150+
</table>
151+
<p>Above list serialized in Lua:</p>
152+
153+
<Code code={luaTable} lang="lua" />
154+
155+
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksFromList([
156+
'reference:ID_Lists',
157+
])} currentId='' />
158+
</StarlightPage>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1515
<li><a href="/reference/ID_Lists/Garages">Garages</a></li>
1616
<li><a href="/reference/ID_Lists/Interiors">Interiors</a></li>
1717
<li><a href="/reference/ID_Lists/Vehicle_Colors">Vehicle Colors</a></li>
18+
<li><a href="/reference/ID_Lists/Vehicle_Paintjobs">Vehicle Paintjobs</a></li>
1819
<li><a href="/reference/ID_Lists/Vehicle_Variants">Vehicle Variants</a></li>
20+
<li><a href="/reference/ID_Lists/Vending_Machines">Vending Machines</a></li>
1921
<li><a href="/reference/ID_Lists/Weather">Weather</a></li>
2022
</ul>
2123

0 commit comments

Comments
 (0)