diff --git a/.github/img/ss1.png b/.github/img/ss1.png deleted file mode 100644 index f60e74b..0000000 Binary files a/.github/img/ss1.png and /dev/null differ diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 13d346c..a797b14 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -15,4 +15,4 @@ jobs: - name: Lint mta resources run: | echo 'ignore = {"512", "122","142","111","341","112","113","143","321","631","211","212","213","611","612","621"}' > config.lua - luacheck --config config.lua ./ + luacheck --exclude-files '**/*async.lua' --config config.lua ./ diff --git a/README.md b/README.md index 847ea01..8345d3f 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,37 @@ -# `Newmodels v5 Azul 💙` +# `Newmodels v6 Red 🍒` This MTA resource makes use of the clientside allocated models ([engineRequestModel](https://wiki.multitheftauto.com/wiki/EngineRequestModel) and related features) to add new peds (skins), vehicles and objects: -- place your mods (dff/txd/col files) in designated folders that are automatically detected +- there are 3 methods to add new models: + - [1] place mod files (dff/txd/col files) in designated folders that are automatically scanned + - [2] place mod files anywhere you want and list them in the mod list lua script + - [3] dynamically load new models from external resources using exported functions - the system syncs all added models with all players -- use a simple trick in your existing scripts to work with the new model IDs +- use a simple trick in your existing scripts to work with the new model IDs, or use the provided exported functions - it's minimalistic, optimized and robust -With this resource you can make scripts or change your existing scripts to add new skin, vehicle and object IDs to your server! For example, you may add all SA-MP object models! +With this resource you can make scripts or change your existing scripts to add new skin, vehicle and object models to your server! For example, you may add all SA-MP object models! ## Docs/Tutorial -🚀 **Are you new to this resource?** Start here: [Documentation file](/.github/doc/DOCUMENTATION.md) +🚀 **Are you new to this resource?** + +Start here: [DOCUMENTATION.md file](/newmodels_red/DOCUMENTATION.md) ## Download -⚠️ **Before you download and install this resource**, ensure you meet the requirements specified in the [Documentation](/.github/doc/DOCUMENTATION.md). +⚠️ **Before you download and install this resource**, ensure you meet the requirements specified in the **Documentation** linked above. Get the [Latest Version](https://github.com/Fernando-A-Rocha/mta-add-models/releases/latest) from the **Releases** section. -## Older versions - -It is easy to migrate to v5 from newmodels v4 (not from v3; the architecture of that version is no longer used). The **models folder structure remains the same**, but the scripts have changed in the way models are applied to elements. +## Migrating from Older versions -This resource no longer uses and relies on the **MTA Element Data system** (`setElementData`) to sync the models to all clients! Instead, newmodels makes use of Lua tables and MTA events. This major change was made to **improve performance** and control the sync of models more efficiently. +Please refer to the **Migration Guide** in the [MIGRATION.md file](/newmodels_red/MIGRATION.md). ## Community Visit the [Thread on the MTA Forum](https://forum.mtasa.com/topic/133212-rel-add-new-models-library/) to get in touch with fellow users and developers. -## Media - -![Screenshot 1](/.github/img/ss1.png) - ## Final Note Feel free to update the documentation in this repository, and contribute to the code via pull requests. diff --git a/[examples]/sampobj_red/README.md b/[examples]/sampobj_red/README.md new file mode 100644 index 0000000..4d1cb73 --- /dev/null +++ b/[examples]/sampobj_red/README.md @@ -0,0 +1,20 @@ +# `sampobj_red`: SA-MP Objects for Newmodels v6 + +With [`newmodels_red`](https://github.com/Fernando-A-Rocha/mta-add-models) (and `sampobj_red` resource) you can add all of [SA-MP's object models](https://dev.prineside.com/en/gtasa_samp_model_id/tag/2-sa-mp/) to your server, so you can use them to create custom maps, or spawn objects using Lua scripts. + +## Large Size ⚠️ + +There are over 1,400 SA-MP object models! It is recommended to keep `download="false"` in the resource's `meta.xml` as well as `metaDownloadFalse=true` in `server.lua` to prevent clients from downloading all the models when they join your server. + +## How to install + +1. [Download](https://www.mediafire.com/file/mgqrk0rq7jrgsuc/models.zip/file) `models.zip` containing all dff/txd/col files required (total of 4,297 files; 404 MB when extracted) +2. Extract the contents of the zip to [sampobj_red/models/]([examples]/sampobj_red/models/) folder. + +You're done! Newmodels will load the new models automatically when you start the `sampobj_red` resource. Their IDs are exactly the same as the IDs used in SA-MP. + +You may test spawning a SA-MP object using the newmodels test commands. E.g. `11686` ([is a bar counter](https://dev.prineside.com/en/gtasa_samp_model_id/model/11686-CBarSection1/)). + +## Media + +![Example](./sampobj.png) diff --git a/[examples]/sampobj_red/meta.xml b/[examples]/sampobj_red/meta.xml new file mode 100644 index 0000000..e0a3ed0 --- /dev/null +++ b/[examples]/sampobj_red/meta.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + +