Skip to content

Commit f09f385

Browse files
Merge branch 'main' of github.com:Fernando-A-Rocha/mta-add-models
2 parents 7388ab7 + e7c567a commit f09f385

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/doc/DOCUMENTATION.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ Remember, the model allocation happens only clientside, so the server has no con
4949

5050
See the [example resources](/[examples]/) to understand how to use the following methods.
5151

52+
### Server VS Client
53+
54+
All newmodels exported functions are shared, meaning you can use them in both client and server side scripts. Their behaviors are different.
55+
56+
The **server-side** functions, specifically for setting a custom model (or creating an element with a custom model) will save the custom models of elements present in your server in a `table`, then sync them using `triggerClientEvent` to all clients online. This means that, for example, creating a vehicle that is a new Helicopter, will automatically make it that model for all players in your server.
57+
58+
In contrast, **client-side** functions do not perform any synchronization of data with other clients. Custom models set by client-side scripts are only applied to the client that is running those scripts. This means that, for example, in a clothing store scenario you can change the player's model to any custom models using client-side functions, and only that player will see the model change in their game.
59+
60+
5261
### Importing functions
5362

5463
The easiest way is to use the following method in the beginning of your script to load the necessary functions.
@@ -77,6 +86,18 @@ Check the [`meta.xml`](/newmodels_azul/meta.xml) file to see the exported functi
7786
Example usage:
7887

7988
```lua
80-
-- The normal createVehicle would not work invented IDs such as -2
89+
-- The normal createVehicle would not work with invented IDs such as -2,
90+
-- so we call the available exported function
8191
local vehicle = exports['newmodels_azul']:createVehicle(id, x, y, z, rx, ry, rz, numberplate)
8292
```
93+
94+
## Important Tips ⚠️
95+
96+
These are good practices and general advice.
97+
98+
- Remember that your models must work well with GTA: San Andreas in terms of optimization.
99+
- Always test with several players and different PC specifications.
100+
- An element created serverside with a custom model will sync its custom model to all clients.
101+
- Useful for spawning vehicles, setting player and NPC skins.
102+
- An element created clientside with a custom model will not sync to other clients, meaning only the client that ran the code will see the custom model.
103+
- Useful for model previewing and object spawning which works best clientside.

0 commit comments

Comments
 (0)