LabiVila Posted September 7, 2014 Share Posted September 7, 2014 function timePassed () if not systemUpTime then systemUpTime = getTickCount () end current = getTickCount () local res = math.floor((current - systemUpTime)/1000) dxDrawText (res, x/3, y/3, x, y, tocolor (255, 255, 255, 255), 1.5, "clear") addEventHandler ("onClientMarkerHit", getRootElement(), function () outputChatBox (getPlayerName (localPlayer).." has finished the map in: "..res.." mins.", source) end ) end addEventHandler ("onClientRender", getRootElement(), timePassed) the problem is that there is not just one outputChatBox like: mysticguy has won the map in .. minutes, but there are a lot of those like this: http://www.upload.ee/image/4249449/sss.png Link to comment
koeno100 Posted September 7, 2014 Share Posted September 7, 2014 That's because you've put the outputChatBox within onClientRender, so it will output the string every time the client renders. Take the addEventHandler("onClientMarkerHit") out of the onClientRender event and put it underneath it like this: function timePassed () if not systemUpTime then systemUpTime = getTickCount () end current = getTickCount () local res = math.floor((current - systemUpTime)/1000) dxDrawText (res, x/3, y/3, x, y, tocolor (255, 255, 255, 255), 1.5, "clear") end addEventHandler ("onClientMarkerHit", getRootElement(), function () outputChatBox (getPlayerName (localPlayer).." has finished the map in: "..res.." mins.", source) end ) Link to comment
LabiVila Posted September 7, 2014 Author Share Posted September 7, 2014 Solved, thank you so much 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