dodo11 Posted October 30, 2012 Share Posted October 30, 2012 When are use getElementParent or getElementData ? Link to comment
Anderl Posted October 30, 2012 Share Posted October 30, 2012 getElementParent returns the parent of an element. You can set an element parent of other using setElementParent. getElementData returns the data that you specify that you saved with setElementData on some element. Link to comment
dodo11 Posted October 30, 2012 Author Share Posted October 30, 2012 (edited) then setElementParent for thePlayer set one value ? setElementData several ? Edited October 30, 2012 by Guest Link to comment
Anderl Posted October 30, 2012 Share Posted October 30, 2012 No, you didn't get me. setElementParent puts an element as parent of other. setElementData sets a data on an element. Both "values" will disappear when the main element is destroyed. Example: local ped1 = createPed( ... ); local ped2 = createPed( ... ); setElementParent( ped1, ped2 ); -- sets 'ped2' as parent of 'ped1' destroyElement( ped1 ); -- now ped2 is destroyed because it's a parent ( or child, whatever you want to call it ) of 'ped1' -- local ped3 = createPed( ... ); setElementData( ped3, "isNormalPed", true ); if ( getElementData( ped3, "isNormalPed" ) ) then outputChatBox( "Ped is a civillian!", ... ); 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