SkatCh Posted September 10, 2014 Share Posted September 10, 2014 guys please i need some i create a command to attach a marker to player then i create destroy function , check this it's a part from my script: function destroyMarker (player) for index, m in ipairs ( markers ) do if isElement(markers[index][1]) and markers[index][2] == player then destroyElement (markers[index][1]) break end end end the problems is i want to destroy the marker when the player logout or when the player die . i tried this but didn't work function loggedOut (player) destroyMarker (player) end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) addEventHandler( "onPlayerWasted", getRootElement( ),loggedOut) addEventHandler ( "onPlayerQuit", getRootElement(), loggedOut ) Note i tried the same funtion with CommandHandler and it's working fine. i'm sorry about my english Link to comment
Castillo Posted September 10, 2014 Share Posted September 10, 2014 function loggedOut (player) destroyMarker (player) end Remove 'player' from the function name, and change 'player' to 'source' in destroyMarker. Link to comment
SkatCh Posted September 10, 2014 Author Share Posted September 10, 2014 thx castilo nvm i alredy fixed it ... anyways thx for your help. 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