Jump to content

Send Serversite Timer to Clientsite DxDraw


Alex1002

Recommended Posts

How i can show the Timer Clientside in 02:00 -> 01:59 -> 01:58… ¿¿¿

Serversite:

function teamMemberGroupTimer () 
  if (countPlayersInTeam(getTeamFromName("TeamOne")) >= 1) and (countPlayersInTeam(getTeamFromName("TeamTwo")) >= 1) then 
     if not isTimer (playTimerOneTwo) then 
       playTimerOneTwo = setTimer(function() outputChatBox("Timer Works") end, 6000, 9) 
       triggerClientEvent("timeOneTwoRecieve", source, playTimerOneTwo) 
    end 
  end 
end 

Client

addEvent("timeOneTwoRecieve", true) 
addEventHandler("timeOneTwoRecieve", root, function() 
  outputChatBox("Timer Clientsite") -- <--  It Works 
    addEventHandler("onClientRender", root, function() 
      local tone, ttwo, tthree = getTimerDetails(playTimerOneTwo) 
      if (tone) then 
      dxDrawText(tone, 874, 20, 1179, 74, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) 
    end 
  end) 
end) 

M.f.G

Alex.W

Link to comment

So it Works.

Serversite

local  sekunde = 10 --Times to Count here 10 Sec. 
        playTime = setTimer(function() 
        triggerClientEvent("timeRecieve",resourceRoot, sekunde) 
        sekunde = sekunde -1 
      end,1000,0) 

Clientsite

local savedSekunde = 10 -- Times to Count(Control) here 10 Sec. 
addEvent("timeRecieve", true) 
addEventHandler("timeRecieve", resourceRoot, function(newSekunde) 
  savedSekunde = newSekunde 
end) 
  
addEventHandler("onClientRender",root, function() 
  dxDrawText(savedSekunde, 400, 400, 0, 0) 
end) 

M.f.G

Alex.W

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...