Git Product home page Git Product logo

mta-add-models's Introduction

mta-add-models's People

Contributors

fernando-a-rocha avatar insigne avatar mimimiguel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mta-add-models's Issues

Freeroam

o freeroam (painel f1) não ta dando spawn nos veiculos, como consigo fazer ele dar spawn?

How to add Weapons (method)

i wanted to know if it's possible to add weapons ? tried to add it as a object but it needs a collision file.

Element models not released by destroyElement (issue?)

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?

Not checking the element-data key during onClientElementDataChange

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.

This resource is potentially insecure

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

Problem with setElementModel

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

The trailer wheel won't engage!

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!

can possible add cars in conce system?

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 (:

possible to add vehicles to concessionaria?

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 (:

[Help] Implement new models in gridlist

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!

Newmodel vehicle door & panel states are lost

Newmodel vehicles mainly lose the following states when the model is changed (happens intentionally clientside with setElementModel & also automatically with engineFreeModel):

  • door states
  • panel states

This is particularly bad because these are related to visual damage, so it's like they always get repaired.

Script security issue

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

One issue

Found issues in version 1.1.0

  • if there are two peds synced for the player and both have the same custom model assigned to them, then if one of them streams out your syncer attempts to release the custom model for both of the ped elements, especially the one already streamed in. While the documentation of engineFreeModel does not mention what happens in this case, I assume that the request fails. This scenario is a potential model ID leak (the client will run out of available real model IDs at some point). Even worse: the client could run out of RAM very quickly.

Moved suggestions to: #3

https://forum.mtasa.com/topic/133212-rel-add-new-models-library/#comment-1003406

Some suggestions

  1. 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)

  2. 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)

  3. (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 ))

Bug: Vehicle upgrades are lost on model change

STEPS TO REPRODUCE:

  • Spawn any new car with this resource
  • Add upgrades to it (addVehicleUpgrade...)
  • Trigger a vehicle replacement, ex: reconnect, unload models, etc
  • Get closer back to the car
  • Upgrade is lost

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.