ManeXi Posted August 4, 2016 Share Posted August 4, 2016 (edited) I want to attach an event to only 1 certain marker, I have tried this: local eventMarker = createMarker(2031.0009765625, -1417.849609375, 18, "arrow", 2.0, 0, 255, 0, 200) addEventHandler("onPlayerMarkerHit", eventMarker, theFunction) but it doesn't work Edited August 4, 2016 by Guest Link to comment
Walid Posted August 4, 2016 Share Posted August 4, 2016 Replace "onPlayerMarkerHit" with "onMarkerHit" . Link to comment
EstrategiaGTA Posted August 4, 2016 Share Posted August 4, 2016 Use this: local eventMarker = createMarker(2031.0009765625, -1417.849609375, 18, "arrow", 2.0, 0, 255, 0, 200) addEventHandler("onPlayerMarkerHit", getRootElement(), theFunction) And in the function add a check like this, to see if the marker that was hit is eventMarker: theFunction (markerHit) if markerHit == eventMarker then --your code end end Link to comment
Bonus Posted August 4, 2016 Share Posted August 4, 2016 Better do what Walid told you, better for the performance. Link to comment
ManeXi Posted August 4, 2016 Author Share Posted August 4, 2016 It worked thanks alot Link to comment
EstrategiaGTA Posted August 4, 2016 Share Posted August 4, 2016 Better do what Walid told you, better for the performance. I gave him the solution for the event he was using, he did not ask for better perfomance... Link to comment
Bonus Posted August 4, 2016 Share Posted August 4, 2016 Better do what Walid told you, better for the performance. I gave him the solution for the event he was using, he did not ask for better perfomance... And I didn't say your solution is wrong. Just wanted to say that he should better use the other event Link to comment
Captain Cody Posted August 4, 2016 Share Posted August 4, 2016 When helping other people, try to give them solutions for better performance, while also fixing their original problems, so they can learn from what you've done. And use the better answer in the future. 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