Jump to content

Element for all dimensions


Dreft

Recommended Posts

Well, thats not smart cause it exists 65535 dimensions, but heres your example.

https://wiki.multitheftauto.com/wiki/Dimension

local object = createObject(blablablabla [...])
for dimensionKey, 65535 do
setElementDimension (object, dimensionKey )
end

This doesn't work. This loops set dimension to:

object = 1 then object = 2, not 1.

After that object = 3, not 2

And at the end object = 65534, so if I won't be in 65534 dimension, i won't see it.

Link to comment

Ah now i know what you exactly mean

btw. dimensionKey was the startvalue, it should be starting with 1 or 0.

I cant find a function for this right now, but it should be possible if you create the Element/Object in every Dimension

Startdimensions = 0
 
for dimensionKey = Startdimensions, 65535 do
object = createObject(blablablabla [...])
setElementDimension (object, dimensionKey )
end

And this Loop does not stop at 65535.

For what do you need a Element for all dimensions ?

Sounds stupid for meh :roll:

Link to comment

No I'm not making it for 65k dimensions.. I just asked "for all possible" because I thought that there is some way without adding element > setting dimension > adding another element > setting dimension and so on.

Thx for help.

Link to comment

Server:

object = createObject(...)
setElementID(object,"alldim")

Client:

object = getElementByID("alldim")
addEventHandler("onClientRender",getRootElement(),
function()
setElementDimension(object,getElementDimension(getLocalPlayer()))
end
)

If you want to make this work with multiple objects, you can create an abstract element and make it a parent of objects.

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