Jump to content

some help over here


Machine

Recommended Posts

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
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
Guest Guest4401
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...