Jump to content

for .. do ?


Recommended Posts

Posted

Why it dont work?

for i = 0,65535, 1 do 
local huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90)  
local huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
local huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
local huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
setElementDimension (huette1, i) 
setElementDimension (huette2, i) 
setElementDimension (huette3, i) 
setElementDimension (huette4, i) 
end 

Posted
Why it dont work?
for i = 0,65535, 1 do 
local huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90)  
local huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
local huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
local huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
setElementDimension (huette1, i) 
setElementDimension (huette2, i) 
setElementDimension (huette3, i) 
setElementDimension (huette4, i) 
end 

Dude, you havent got event handler :lol: (Sry if u didnt post the full script.)

Posted

This is my full script!!

addEventHandler ("onResourceStart", getResourceRootElement(), function () 
for i = 0,65534, 1 do 
local huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90)  
local huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
local huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
local huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
setElementDimension (huette1, i) 
setElementDimension (huette2, i) 
setElementDimension (huette3, i) 
setElementDimension (huette4, i) 
end 
end) 

Posted
Why it dont work?
for i = 0,65535, 1 do 
local huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90)  
local huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
local huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
local huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
setElementDimension (huette1, i) 
setElementDimension (huette2, i) 
setElementDimension (huette3, i) 
setElementDimension (huette4, i) 
end 

Dude, you havent got event handler :lol: (Sry if u didnt post the full script.)

Why is an event needed here? The code is executed as soon as it is loaded.

I used to know how to code, but then I took an arrow in the knee.

Project Redivivus - Remaking Old School MTA With New Code

MTA 0.6 Nightly 1 released

Posted

you want to set the objects on random dimension?

if so, use this:

local huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90) 
local huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
local huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
local huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
setElementDimension (huette1, math.random(0,65535)) 
setElementDimension (huette2, math.random(0,65535)) 
setElementDimension (huette3, math.random(0,65535)) 
setElementDimension (huette4, math.random(0,65535)) 

Posted
addEventHandler ("onResourceStart", getResourceRootElement(),  
function () 
huette1 = createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90) 
huette2 = createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270) 
--local huette1 = createObject(11319, -2170.10791, 293.772, 35.398, 0, 0, 0) 
huette3 = createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270) 
huette4 = createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90) 
end 
) 
  
for i = 0,65534 do 
setElementDimension (huette1, i) 
setElementDimension (huette2, i) 
setElementDimension (huette3, i) 
setElementDimension (huette4, i) 
end 

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

That won't set it on all these dimensions, it only can be on one dimension at a time.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

And how i can create

createObject(11480, -2160.70508, 293.80402, 38.067, 0, 0, 90)

createObject(11480, -2160.72998, 293.80002, 34.292, 0, 180, 270)

createObject(11480, -2166.94702, 293.80099, 34.292, 0, 180, 270)

createObject(11480, -2166.94604, 293.80002, 38.092, 0, 0, 90)

in every dimension=?

Posted

You could set the dimension when the player dimension changes.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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