Jump to content

[Question] dx


The Killer

Recommended Posts

this code when you hit the marker the count will show but the other players can see it to

i want when someone hit the marker the count show, only the player who hit the marker can see it.

local count = 10 
local x,y = guiGetScreenSize( ) 
local left,top,right,bottom = x*351/1360,y*166/768,x*999/1360,y*454/768 
  
setTimer (  
 function ( ) 
   count = count -1  
   if ( count == 0 )  then 
    removeEventHandler("onClientRender",root,DrawTheText) 
   triggerServerEvent("give", getLocalPlayer()) 
  end 
 end,500,0 
) 
  
function DrawTheText( ) 
          dxDrawText( "Wait [ " .. count .. " ]",left,top,right,bottom, tocolor(0,255,0,255), 2.00, "default-bold", "center", "top", false, false, false, false, false ) 
  end 
  
local marker = createMarker(1956.6, -2486, 13.5-1, "cylinder", 2, 255, 0, 0) 
addEventHandler("onClientMarkerHit", marker, 
function () 
count = 10 
 addEventHandler("onClientRender",root,DrawTheText) 
end 
) 
Link to comment
local count = 10 
local x,y = guiGetScreenSize( ) 
local left,top,right,bottom = x*351/1360,y*166/768,x*999/1360,y*454/768 
  
setTimer ( 
 function ( ) 
   count = count -1 
   if ( count == 0 )  then 
    removeEventHandler("onClientRender",root,DrawTheText) 
   triggerServerEvent("give", getLocalPlayer()) 
  end 
 end,500,0 
) 
  
function DrawTheText( ) 
          dxDrawText( "Wait [ " .. count .. " ]",left,top,right,bottom, tocolor(0,255,0,255), 2.00, "default-bold", "center", "top", false, false, false, false, false ) 
  end 
  
local marker = createMarker(1956.6, -2486, 13.5-1, "cylinder", 2, 255, 0, 0) 
addEventHandler("onClientMarkerHit", marker, 
function (p) 
if p == localPlayer then 
count = 10 
 addEventHandler("onClientRender",root,DrawTheText) 
end 
end 
) 

Link to comment
local x,y = guiGetScreenSize( ) 
local left,top,right,bottom = x*351/1360,y*166/768,x*999/1360,y*454/768 
  
function DrawTheText() 
    if isTimer(tt) then 
        _, count = getTimerDetails(tt) 
        dxDrawText("Wait [ "..tostring(count).." ]",left,top,right,bottom, tocolor(0,255,0,255), 2.00, "default-bold", "center", "top", false, false, false, false, false) 
    else 
        removeEventHandler("onClientRender", root, DrawTheText) 
        triggerServerEvent("give", getLocalPlayer()) 
    end 
end 
  
local marker = createMarker(1956.6, -2486, 13.5-1, "cylinder", 2, 255, 0, 0) 
addEventHandler("onClientMarkerHit", marker, 
function (p) 
    if p == localPlayer and not isTimer(tt) then 
        tt = setTimer(function() end, 1000, 10) 
        addEventHandler("onClientRender", root, DrawTheText) 
    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...