Jump to content

getElementParent or getElementData


dodo11

Recommended Posts

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

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