dragonofdark Posted June 19, 2011 Posted June 19, 2011 Hello, Here is my problem : I have this line : setElementPosition( veh, getElementPosition( other ) ) I would like to add 2 to z, how can I make that ? (other is a teleporter's marker, and the vehicles spawn througt the ground. Thanks.
DarkLink Posted June 19, 2011 Posted June 19, 2011 If u want to put Z for the element u have to put all the arguments before, u cant define an argument after the ones that werent declared. did u understand ? setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] ) The function gets an element, a float x, a float y , a float z.. and an optional argument. So if u want to declare only the float z, u also need to declare the float x and y and ofc the element. But if u dont want to change the X and Y, put the same . Sorry if u didnt understand, I am portuguese and my english sucks EDIT: Nevermind I didnt understand u, u want this: local x,y,z = getElementPosition (other) setElementPosition(veh, x, y, z +2) try it
Chlorek Posted June 19, 2011 Posted June 19, 2011 Maybe make variables be4? =] like this local x,y,z2 = getElementPosition( other ) local z = z2+2 setElementPosition( veh, x,y,z )
DarkLink Posted June 19, 2011 Posted June 19, 2011 Maybe make variables be4? =] like this local x,y,z2 = getElementPosition( other ) local z = z2+2 setElementPosition( veh, x,y,z ) he can make the + 2 inside the function
Chlorek Posted June 19, 2011 Posted June 19, 2011 I know DarkLink but I don't know is dragonofdark beggining scripter so I wanted he understand it.
DarkLink Posted June 19, 2011 Posted June 19, 2011 I know DarkLink but I don't know is dragonofdark beggining scripter so I wanted he understand it. didnt know sorry eheh I see :b
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now