WASSIm. Posted September 29, 2013 Share Posted September 29, 2013 hi guys. have question about createElement. i want make create gate in file map like this id="1" model="3276" posX="-1436.30005" posY="-971.59998" posZ="200.60001" rotX="0" rotY="0" rotZ="0" interior="0" dimension="0">> i know i can make this with createElement but how fixed post ? Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 What do you mean by "fixed post"? Link to comment
WASSIm. Posted September 29, 2013 Author Share Posted September 29, 2013 What do you mean by "fixed post"? like them model="3276" posX="-1436.30005" posY="-971.59998" posZ="200.60001" rotX="0" rotY="0" rotZ="0" interior="0" dimension="0" Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 local gate = createElement ( "gate" ) setElementData ( gate, "posX", 0 ) setElementData ( gate, "posY", 0 ) setElementData ( gate, "posZ", 0 ) setElementData ( gate, "rotX", 0 ) setElementData ( gate, "rotY", 0 ) setElementData ( gate, "rotZ", 0 ) setElementData ( gate, "interior", 0 ) setElementData ( gate, "dimension", 0 ) Link to comment
WASSIm. Posted September 29, 2013 Author Share Posted September 29, 2013 local gate = createElement ( "gate" ) setElementData ( gate, "posX", 0 ) setElementData ( gate, "posY", 0 ) setElementData ( gate, "posZ", 0 ) setElementData ( gate, "rotX", 0 ) setElementData ( gate, "rotY", 0 ) setElementData ( gate, "rotZ", 0 ) setElementData ( gate, "interior", 0 ) setElementData ( gate, "dimension", 0 ) thank you Link to comment
Blaawee Posted September 29, 2013 Share Posted September 29, 2013 In case if you will ask about how to get the element data, loop it -- It's just an example. local gObjects = { } local gGateID = 50 -- change it to the perfect gate ID. addEventHandler ( "onResourceStart", resourceRoot, function( ) for key, gates in ipairs ( getElementsByType( 'gate' ) ) do if getElementData( gates, "posX" ) and getElementData( gates, "posY" ) and getElementData( gates, "posZ" ) then gObjects[ key ] = createObject( gGateID, getElementData( gates, "posX" ), getElementData( gates, "posY" ), getElementData( gates, "posZ" ) ); end end end ); Link to comment
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