Mta Add Models Versions Save

Library for Multi Theft Auto: San Andreas that lets you add new models to your server

v3.3.0

8 months ago

Changelog

Fixed vehicle handling sync for added models!

The previous implementation would cause severe server lag if used in many vehicles & with many players online. This is safe now.

Updated isDefaultID with MTA 1.6 new skin IDs (ped models)

Added 2 missing aclrequest permissions to newmodels

Enjoy !! ❤️

v3.2.0

8 months ago

Changelog

  • refreshStreamedInElements fix => frees all allocated IDs when mod list is received to prevent conflicts
  • added engineLoadTXD optional param (default true): filteringEnabled
  • added engineReplaceModel optional param (default false): alphaTransparency
  • updated minimum client & server version to MTA 1.6 🥳

As always don't forget to leave feedback. Check out the MTA forum thread that links to an active Discord discussion thread.

v3.1.0

1 year ago

This release doesn't break anything. The previous 3.0.0 release remains stable, although I recommend updating :-)

Revamped Exported Functions

⚡️ Cleaner & Easier to Use

✔️ Backwards Compatible

  • addExternalMods_IDFilenames
  • addExternalMod_IDFilenames
  • addExternalMods_CustomFileNames
  • addExternalMod_CustomFilenames
  • removeExternalMods

Changes the format of the modInfo list passed as argument to addExternalMods_IDFilenames and addExternalMods_CustomFileNames.

Adds a new optional argument "onFinishEvent" to addExternalMods_IDFilenames, addExternalMods_CustomFileNames and removeExternalMods.

Functions addExternalMod_IDFilenames and addExternalMod_CustomFilenames can now receive a table with options instead of all the argument variables.

Using the old argument formats in the functions will output a warning to the debug console.

Updated sampobj_reloaded and vehicle_manager examples to reflect these changes and use the new function formats.

Updated documentation (please read).

Thank you

Rick for suggesting these enhancements.

v3.0.0

1 year ago

Release Notes

⚠️ Check your custom code (need to update)

This update permenantly fixes element model logic.

Now, client or server newmodels scripts never listen to element model change. You are responsible for using setElementModel in your scripts, and setting custom model ID element data.

Some explanations

In the past, the element model was being altered by newmodels (using performance-heavy debug hooks) because I thought that it was necessary due to how the engineRequestModel & engineFreeModel features worked. This belief was wrong.

Model serverside always remains the same for an element. It is changed on the client to the allocated/requested ID when set, and it restores the parent/base model ID when the allocated ID is freed automatically. Before, I thought that it didn't restore the parent/base model ID clientside and the element stayed with an "allocated/requested" model ID even after it was freed, this was proved incorrect by time and testing.

What to do

For example, If you have a player with custom skin ID data set, and you want to switch it to a default skin ID, you need to set the custom skin data to nil and do setElementModel. This used to be handled "automatically", however it was unnecessarily performance-heavy.

Check this example for how to spawn a player properly because the use of spawnPlayer requires special attention.

⚠️Please read the documentation, in particular the examples which use newmodels-engine to simplify the implementation process.

Changes

  • Removed unnecessary & breaking element model change logic (such as doing set element model refresh, it only caused additional issues)
  • Replaced newmodels-example with vehicle_manager

v2.2.0

1 year ago

Improvements

  • removed thisRes variable to use hidden var resource
  • added example of path table usage in modList (mod id 80006)
  • replace client request mods logic with onPlayerResourceStart with clientsWaiting queue
  • moved start/stop messages from testing_server.lua to server.lua
  • improved clientside debug overlay & fixed /listmods GUI not showing mod paths correctly
  • slight refactor in updater_s.lua
  • modList can now be optional (mod_list.lua can be removed if u dont want mods defined in newmodels
  • added test mods & reorganized modList
  • added model LOD distance optional mod parameter
  • added removeExternalMods(ids_list) exported function
  • improved the file downloading functions
  • cited some mod sources in README credits

Fixes

  • :warning: fixed small typo in newmodels-engine setElementModel function - it was setting the base model data incorrectly
  • fixed mod list checks not cancelling the resource because they were inside an Async function
  • (edge case) fixed startFreeingMod(...) not doing tonumber(data_id) to compare with id, so people who set id element data string had problems

Documentation

  • documented functions & events in new .MD files for newmodels & newmodels-example!

Full Changelog

https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.1.0...v2.2.0

v2.1.0

1 year ago

⚠️ The previous 2.0.4 version remains semi-stable, but it is highly recommended that you update your newmodels resource to this version, as well as make use of the new resource added (see below). ⚠️

PLEASE CHECK THE UPDATED README AND THE OTHER UPDATED DOCUMENTATION PAGES.

Changes

  • newmodels:

    • Fixed problem with modList table not copying properly
    • Fixed editor custom funcs & create element base ID
    • Added editor custom pickup support
    • Fixed freeing functions
    • Added disableAutoFree modList setting & add functions parameter
    • Added forceFreeAllocated exported function
    • Added isModAllocated exported function
    • Fixed test commands
    • Fixed setElementModel refresh in server.lua and client.lua
    • Added checkModelID exported function
    • Remade test_server.lua examples
  • Added newmodels-engine resource (thanks @httpRick for the inspiration)

    • 7 exported functions
    • 1 optional test command
  • Updated all documuentation

    • improved descriptions and links
    • rewrote Lua examples which now use newmodels-engine for simpler usage

Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.4...v2.1.0

v2.0.4

1 year ago

Changes

This version brings a new feature, it doesn't fix anything from the previous version.

Add custom pickup support! createPickup + setElementData. It uses setPickupType to change the pickup model clientside. Thanks @httpRick for the idea

Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.3...v2.0.4

v2.0.3

1 year ago

⚠️ Fixed the following exported functions (there was a problem with sourceResource variable):

  • addExternalMod_IDFilenames
  • addExternalMods_IDFilenames
  • addExternalMod_CustomFilenames
  • addExternalMods_CustomFileNames

Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.2...v2.0.3

v2.0.2

1 year ago

Changes

  • Added Async library for some foreach loops
    • Replaces the bad use of coroutines I made in server.lua
  • Updated newmodels-example startup function
    • Now uses the add external mods list instead of adding 1 by 1
  • Fixed newmodels-example /testvehicles
    • It was spawning vehs with incorrect parent/base model ID
  • Fixed newmodels exported function removeExternalMod wrong variable name
    • You can test it by using /removemod from newmodels-example

Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.1...v2.0.2

v2.0.1

1 year ago

Changes

  • fixed version string, was 2.0 instead of 2.0.0 (missing last 0) => causing error in updater_s.lua, now it's 2.0.1 anyway
  • added STARTUP_VERIFICATIONS setting that allows u to skip the startup mod list checks
  • added OTHER_RESOURCES setting list that allows you start/stop resources within newmodels (very useful), it has sampobj_reloaded in the list as an example
  • added coroutines in some loops in server.lua to prevent "infinite running script" error in case of too many iterations

Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.0...v2.0.1