You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-11Lines changed: 26 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
-

1
+

2
2
3
3
# Introduction
4
4
5
5
## About
6
6
7
-
**mta-add-models** is a MTA resource that acts as a library, making use of [engineRequestModel](https://wiki.multitheftauto.com/wiki/EngineRequestModel) function to add new peds (skins), vehicles and objects
7
+
**mta-add-models** is a MTA resource that acts as a library, making use of [engineRequestModel](https://wiki.multitheftauto.com/wiki/EngineRequestModel) function to add new peds (skins), vehicles and objects:
8
+
8
9
- syncs all added models with all players
9
10
- minimalistic, optimized and bug free
10
11
@@ -14,7 +15,7 @@ MTA forum topic: [here](https://forum.mtasa.com/topic/133212-rel-add-new-models-
14
15
15
16
Contact (author): Nando#7736**(Discord)**
16
17
17
-
## Your opinion matters!
18
+
## Your opinion matters
18
19
19
20
Click the button to check the project's feedback page:
20
21
@@ -24,7 +25,7 @@ Click the button to check the project's feedback page:
24
25
25
26
## Prerequisites
26
27
27
-
- Required minimum MTA Server & Client version `1.5.9-9.21125.0`
28
+
- Required minimum MTA Server & Client version `1.5.9-9.21437.0`
28
29
- Get the installers from [nightly.mtasa.com](https://nightly.mtasa.com/)
@@ -35,7 +36,7 @@ Click the button to check the project's feedback page:
35
36
36
37
-[newmodels](/newmodels): main library resource
37
38
- (optional) [newmodels-example](/[examples]/newmodels-example): an example implementation to add new objects/skins/etc to your server
38
-
- (optional) [sampobj_reloaded](/[examples]/sampobj_reloaded): a resource that adds all SA-MP objects to your server
39
+
- (optional) [sampobj_reloaded](/[examples]/sampobj_reloaded): a resource that adds all SA-MP object models to your server
39
40
- 👉 [Download](https://www.mediafire.com/file/mgqrk0rq7jrgsuc/models.zip/file)`models.zip` containing all dff/txd/col files required
40
41
- (optional) [unittest_newmodels](/[examples]/unittest_newmodels): a resource for testing the main scripts
41
42
@@ -50,12 +51,14 @@ Click the button to check the project's feedback page:
50
51
51
52
- Place mod files [newmodels/models](/newmodels/models) (dff & txd (& col for objects))
52
53
- List them in [newmodels/meta.xml](/newmodels/meta.xml) like the example
54
+
- As of version 2.0, files have the `download="false"` attribute, causing newmodels to handle downloading them later only when needed
53
55
- Define them in [newmodels/mod_list.lua](/newmodels/mod_list.lua) inside `modList` like the example
54
56
- Use the [commands](#commands) to test, have fun!
55
57
56
58
## Commands
57
59
58
60
Main testing commands in `newmodels`:
61
+
59
62
- /listmods **lists all defined mods**
60
63
- /allocatedids **shows all allocated mod IDs in realtime**
61
64
- /selements **lists all streamed in elements for debugging purposes**
@@ -87,21 +90,26 @@ This library lets you load mods stored within the `newmodels` resource, and also
87
90
Check the [quick testing](#quick-testing) to understand how to load mods from within the `newmodels` resource (easier).
88
91
89
92
You have at your disposal the following exported functions, [see code to understand](/newmodels/server.lua) and [example to see implementation](/[examples]/newmodels-example/server.lua):
(**serverside**) Adding a mod from your own resource:
196
+
184
197
```lua
185
198
-- make sure the main library resource is started before executing this code
186
199
@@ -202,7 +215,8 @@ end
202
215
203
216
## Example #6
204
217
205
-
(**serverside**) Spawning a vehicle and setting its handling
218
+
(**serverside**) Spawning a vehicle and setting its handling:
219
+
206
220
```lua
207
221
-- you could fetch this data from database, here we use static values:
208
222
localx,y,z, rx,ry,rz, int,dim=0,0,5, 0,0,0, 0,0
@@ -226,6 +240,10 @@ for property,var in pairs(handling) do
226
240
end
227
241
```
228
242
243
+
# Generating Collision Files
244
+
245
+
There's a tool to generate a `.col` file from a given `.dff` model. Check out the tutorial [here](https://github.com/Fernando-A-Rocha/mta-samp-maploader/blob/main/TUTORIAL_COL.md).
246
+
229
247
# Plugins
230
248
231
249
## NandoCrypt
@@ -234,29 +252,26 @@ This library supports encrypted models using the [NandoCrypt](https://github.com
234
252
235
253
You can configure everything related to it in the [global config file](/newmodels/_config.lua).
- Clientside peds in character selection screen [account/c_characters.lua](https://github.com/OwlGamingCommunity/MTA/blob/main/mods/deathmatch/resources/account/c_characters.lua)
246
264
- Serverside character spawning [account/s_characters.lua](https://github.com/OwlGamingCommunity/MTA/blob/main/mods/deathmatch/resources/account/s_characters.lua)
247
265
- Serverside player skin saving [saveplayer-system/s_saveplayer_system.lua](https://github.com/OwlGamingCommunity/MTA/blob/main/mods/deathmatch/resources/saveplayer-system/s_saveplayer_system.lua)
248
266
249
267
For new skin images used in the inventory, place them in [account/img](https://github.com/OwlGamingCommunity/MTA/tree/main/mods/deathmatch/resources/account/img) as ID.png with a minimum of 3 digits.
250
268
251
269
You will find a lot more scripts that need to be changed if you want to use new IDs to the maximum potential, for example:
270
+
252
271
- Shops/NPCs having custom skin IDs
253
272
- Supporting custom skins in the [clothes](https://github.com/OwlGamingCommunity/MTA/tree/main/mods/deathmatch/resources/clothes) system
254
273
- ...
255
274
256
-
# Generating Collision Files
257
-
258
-
There's a tool to generate a `.col` file from a given `.dff` model. Check out the tutorial [here](https://github.com/Fernando-A-Rocha/mta-samp-maploader/blob/main/TUTORIAL_COL.md).
259
-
260
275
# Final Note
261
276
262
277
Feel free to update this README.md if you wish to provide tutorial(s) for other implementations, or generally improve the current documentation.
0 commit comments