fernando-a-rocha / mta-add-models Goto Github PK
View Code? Open in Web Editor NEWLibrary for Multi Theft Auto: San Andreas that lets you add new models to your server
License: GNU General Public License v3.0
Library for Multi Theft Auto: San Andreas that lets you add new models to your server
License: GNU General Public License v3.0
Can you create a database and adjust it with owlgaming backup?
I wanted to know if it is possible to add these vehicles in the concessionaire, because I want to add new vehicles, because vehicles 4 doors of my server are already finished, if you can take me this doubt I would thank you very much (:
Newmodel vehicles mainly lose the following states when the model is changed (happens intentionally clientside with setElementModel & also automatically with engineFreeModel):
This is particularly bad because these are related to visual damage, so it's like they always get repaired.
Some vehicle model may have custom handing in order to make the use of it, i think we should add the support for it as well =)
Found issues in version 1.1.0
Moved suggestions to: #3
https://forum.mtasa.com/topic/133212-rel-add-new-models-library/#comment-1003406
I wanted to know if it is possible to add these vehicles in the concessionaire, because I want to add new vehicles, because vehicles 4 doors of my server are already finished, if you can take me this doubt I would thank you very much (:
o freeroam (painel f1) não ta dando spawn nos veiculos, como consigo fazer ele dar spawn?
Everyone has a server written differently and this can help, for example, someone changes their clothes in the setElementModel store, so why should I add a removeElementData to take a custom skin
i wanted to know if it's possible to add weapons ? tried to add it as a object but it needs a collision file.
The skin is removed on player respawn (looks like CJ) but element data is still set.
At https://github.com/Fernando-A-Rocha/mta-add-models/blob/main/newmodels/client.lua#L137
addEventHandler( "onClientElementDataChange", root,
function (theKey, oldValue, newValue)
local et = getElementType(source)
if isElementTypeSupported(et) and tonumber(newValue) then
local id = tonumber(newValue)
if isCustomModID(et, id) then
In a previous revision you were checking the theKey parameter for the correct one based on ped/player/object element type association but you are not doing that anymore. This results in triggering of the model adjustment logic for just about any element data of the supported elements that is a number.
If a streamed-in element is destroyed (for example using destroyElement) and it has a custom model association, then that custom model is not released. This is peculiar because your resource is releasing custom models on element-stream-out if these models are not used anymore. How about you try using the onClientElementDestroy event, too?
The trailer wheel doesn't engage, the truck responsible for pulling the trailer can't engage anything if it's in the newmodels! Trailers can be on newmodels that work normally, but wheelies cannot!
Explained here: testing script line 71 (where it says NOT OK)
The added unittest_newmodels
resource is for stress-testing everything and trying to find issues like this one :)
Special thanks to @httpRick for helping out
STEPS TO REPRODUCE:
Looking at the code, this seems to be similar to the issue with the handling, which you approached already. I can apply a similar fix to this if it's okey to you!
I will update this issue with any progress I make.
Hi, I would really like to read your feedback if you've tested the resource(s) or even just read the documentation. Thank you! ❤️
Hi there! About a month ago I found this resource-library for adding models to new custom IDs
. I'm not very good at coding in the MTA, my resources were a simple usage of engineReplaceModel
, the CEF panels etc.
So, more to the point, after seeing this project, I decided to port some vehicles from my copy of San Andreas with objects on new IDs
on local MTA server.
Added a few of them, works great, thanks for such a great resource! Can you please help me create a simple MTA guiGridlist
for vehicle spawns with a custom ID
? Just a piece of code with an example of how spawn "vehicle1" with not defualt ID
by clicking on it in list, such as in the freeroam vehicle create menu. From this, I myself will figure out how to finish everything to an acceptable form for me.
Anyway, somewhere this week, when I have a free minute, I'll try it myself. Thanks in advance!
Hey,
I recommend you to verify if elem data's such as vehicle handling etc. changes on the client and then kicking/flaging/banning player as it could be used from trainers to force unexpected behaviors.
U can do it using handle on event onElementDataChange and checking client parameter (so then its elem data changed on cside) along with key and indexing the table with protected serverside element datas such as handling.
My kindest regards,
Jakub
add a custom model cache based on usage frequency, API hinting (setCustomModelAlwaysLoaded) or database flag so that MTA does not have to perform the expensive disk loading of model data as frequently (improves FPS)
add statistics API about the number of custom models loaded, their usage details (frequency, number of elements with the model, etc) and the general performance of the resource. You could even add a debug dashboard using some hidden key combination (very important to build user-trust into your resource workings)
(DONE) add a way to register custom models from other storage resources. This way custom models could potentially be downloaded from the server on-demand by a second resource and - after finishing the download - be registered as custom model inside of your own resource. Could be really fun!
(( Edit: added number for each suggestion ))
(( Edit 2: marked suggestion 3 as done ))
At 678691c
File newmodels_reborn/scripts/core/shared_importfunc.lua, line 13:
exportScriptString = fileRead(f, fileGetSize(f))
This can cause lua injection, when other resources "loadstring" the "import()" result.
Use fileGetContents instead
Reported by xAzke on Discord
TO INVESTIGATE
Ability to use new model IDs that newmodels has loaded in map editor
WIP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.