LiOneLMeSsIShoT Posted December 16, 2013 Share Posted December 16, 2013 in this script when the player be wasted in the first time the script move correct and destroy the elements. but in the second time with wasting i get error in destroyElement and the elements don't be removed: function onWasted () destroyElement (lowrider) destroyElement (mission1BLIP) destroyElement (mission1Marker) end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) error: Bad argument @ 'destroyElement' expected element at argument 1 help please. thanks Link to comment
PaiN^ Posted December 16, 2013 Share Posted December 16, 2013 That's because when you destroy an element ( lowrider for e.g. ) it's removed from that variable, So you must re-define it using that same variable at each time you create it. Link to comment
xXMADEXx Posted December 17, 2013 Share Posted December 17, 2013 use this: function onWasted () if ( isElement ( lowrider ) ) then destroyElement (lowrider) end if ( isElement ( mission1BLIP ) ) then destroyElement (mission1BLIP) end if ( isElement ( mission1Marker ) ) then destroyElement (mission1Marker) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) 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