Jump to content

Question about setElementData & getElementData


Overkillz

Recommended Posts

Well, It could help me, but not at all. For example. If Im specting to some player who is in any vehicle and that vehicle has nitro and nitro is being used. If u switch to another player and switch back to the previous player and try to get the nitro level with the funciton GetVehicleNitroLevel you are not going to get the real nitro level. It gets restarted everytime. Thats why I want to use setElementData on a render (I want to do a draw with the real nitro level).

Regards.

Link to comment
10 minutes ago, Overkillz said:

Well, It could help me, but not at all. For example. If Im specting to some player who is in any vehicle and that vehicle has nitro and nitro is being used. If u switch to another player and switch back to the previous player and try to get the nitro level with the funciton GetVehicleNitroLevel you are not going to get the real nitro level. It gets restarted everytime. Thats why I want to use setElementData on a render (I want to do a draw with the real nitro level).

Regards.

getElementData and set are totally safe to use upon rendering. In fact they should be faster since they only sync upon change.

You may also use MTA  functions in renders and heavier map distance calculations. Panel rendering is going to eat your FPS a bit though, but there is no other way around unless you find a custom sort of way to load things like I did which fits your needs.

  • Like 1
Link to comment
  • Moderators

Even if you disable the sync argument, it probably will trigger the onClientElementDataChange event.

But it shouldn't be too bad if you use it. But I do recommend you to set the elementdata only when it isn't the same as the previous value.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...