Library for Multi Theft Auto: San Andreas that lets you add new models to your server
The previous implementation would cause severe server lag if used in many vehicles & with many players online. This is safe now.
Enjoy !! ❤️
As always don't forget to leave feedback. Check out the MTA forum thread that links to an active Discord discussion thread.
This release doesn't break anything. The previous 3.0.0 release remains stable, although I recommend updating :-)
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).
Rick for suggesting these enhancements.
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.
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.
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.
https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.1.0...v2.2.0
⚠️ 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.
newmodels
:
Added newmodels-engine
resource (thanks @httpRick for the inspiration)
Updated all documuentation
newmodels-engine
for simpler usageFull Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.4...v2.1.0
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
Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.2...v2.0.3
Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.1...v2.0.2
Full Changelog: https://github.com/Fernando-A-Rocha/mta-add-models/compare/v2.0.0...v2.0.1