Machine Posted August 11, 2012 Share Posted August 11, 2012 hello i just made this script local marker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit ( hitPlayer, matchingDimension ) dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) setTimer ( MarkerHit, 1000, 10 ) end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) it dont have bugs but problem is that text come and disappear i wanna when player hit marker text come and when he leave it text disappear can help? Link to comment
Guest Guest4401 Posted August 11, 2012 Share Posted August 11, 2012 local marker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end Link to comment
Machine Posted August 11, 2012 Author Share Posted August 11, 2012 it work good but how can i make onplayer leave mark ,do i must use something like this? function markerLeave ( leavingPlayer, matchingDimension ) addEventHandler ( "onClientMarkerLeave", getRootElement(), markerLeave ) Link to comment
Guest Guest4401 Posted August 11, 2012 Share Posted August 11, 2012 local marker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) addEventHandler("onClientMarkerHit",root, function(h) if h == localPlayer and source == marker then addEventHandler("onClientRender",root,drawText) end end ) function drawText() dxDrawText("Prees F To Exit!",423.0,601.0,623.0,637.0,tocolor(255,255,255,255),2.0,"clear","left","top",false,false,false) end addEventHandler("onClientMarkerLeave",root, function(h) if h == localPlayer and source == marker then removeEventHandler("onClientRender", root,drawText) end end ) 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