Karuzo Posted February 16, 2014 Posted February 16, 2014 (edited) I have a problem. I want ,when i hit a marker, that then the marker destroy and a new marker is spawn. It doesn't work. function Flug1() outputChatBox("Los geht es in #FF7F24 Los Santos",138,43,226,true) guiSetVisible(Pilotpanel.window[1], false) showCursor(false) local pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0) end addEventHandler("onClientGUIClick", Pilotpanel.button[1], Flug1, false) addEventHandler("onClientMarkerHit", pl1m1, function(hitPlayer) if getElementType(hitPlayer) == "vehicle" and hitPlayer == localPlayer then destroyElement ( pl1m1 ) outputChatBox("Der nächste Stop erwartet dich in, San Fiero") end end) Edited February 16, 2014 by Guest
Moderators IIYAMA Posted February 16, 2014 Moderators Posted February 16, 2014 addEventHandler("onClientMarkerHit", pl1m1, function(hitPlayer) if getPedOccupiedVehicle(hitPlayer) and hitPlayer == localPlayer then destroyElement ( pl1m1 ) outputChatBox("Der nächste Stop erwartet dich in, San Fiero") end end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Karuzo Posted February 16, 2014 Author Posted February 16, 2014 Doesn't work , debugscript says nothin
Moderators IIYAMA Posted February 16, 2014 Moderators Posted February 16, 2014 local pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0) make it global pl1m1 = createMarker(2013.2075195313,-2593.7934570313,12.9565591812131, "cylinder", 5.0, 255, 0, 0) and: addEventHandler("onClientMarkerHit", root,--pl1m1 function(hitPlayer) if source == pl1m1 and getPedOccupiedVehicle(hitPlayer) and hitPlayer == localPlayer then destroyElement ( pl1m1 ) outputChatBox("Der nächste Stop erwartet dich in, San Fiero") end end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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