Alex1002 Posted July 15, 2016 Share Posted July 15, 2016 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
N3xT Posted July 15, 2016 Share Posted July 15, 2016 do you mean make it like a countdown? Link to comment
Tomas Posted July 15, 2016 Share Posted July 15, 2016 Why don't you use getTickCount? Link to comment
Alex1002 Posted July 15, 2016 Author Share Posted July 15, 2016 Yes, like a Countdown. I dont know and how can i use my Code with getTickCount M.f.G Alex.W Link to comment
N3xT Posted July 15, 2016 Share Posted July 15, 2016 See that, It may help you. https://forum.multitheftauto.com/viewtopic.php?f ... wn#p898568 Link to comment
Alex1002 Posted July 15, 2016 Author Share Posted July 15, 2016 Okay, has not helped me I would leave only one timer with the client by DxDrawText. Server-Timer -> Send To Client -> DxDrawText , like (02:00, 01:59, 01:58…) No one who knows, how i can do that¿¿¿ M.f.G Alex.W Link to comment
Alex1002 Posted July 15, 2016 Author Share Posted July 15, 2016 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
Et-win Posted July 15, 2016 Share Posted July 15, 2016 I wouldn't use setTimer, since it wouldn't be exactly the same for every client? Why not triggering a start time to count from to the client, and from there getTickCount? Link to comment
Alex1002 Posted July 15, 2016 Author Share Posted July 15, 2016 Okay, show me a alternativ M.f.G Alex.W 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