zetox1 Posted December 8, 2016 Share Posted December 8, 2016 Hi gyus I'm new here and can you tell me if it's possible to make counter which will be counting down 10.9.8.7.6.....to 0 and again. 10.9.8.7.6.... and after map loading it will start counting down again. And one important thing it have start always after 3.2.1.GO Link to comment
zetox1 Posted December 8, 2016 Author Share Posted December 8, 2016 I think about something like this I have found it on other topic but it have to restart after map loading: local sX,sY = guiGetScreenSize() local counter = 10 local r,g,b = 0,255,0 function drawCounterSHI() dxDrawText("Your vehicle will change in: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end function startEverything() addEventHandler("onClientRender",root,drawCounterSHI) setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) end addEvent("onCounterStart",true) addEventHandler("onCounterStart",getRootElement(),startEverything) Any ideas how to solve it ? I tried use but i dont know how to do it resetTimer Link to comment
Abu-Solo Posted December 8, 2016 Share Posted December 8, 2016 29 minutes ago, zetox1 said: I think about something like this I have found it on other topic but it have to restart after map loading: local sX,sY = guiGetScreenSize() local counter = 10 local r,g,b = 0,255,0 function drawCounterSHI() dxDrawText("Your vehicle will change in: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end function startEverything() addEventHandler("onClientRender",root,drawCounterSHI) setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) end addEvent("onCounterStart",true) addEventHandler("onCounterStart",getRootElement(),startEverything) Any ideas how to solve it ? I tried use but i dont know how to do it resetTimer g getTimerDetails Link to comment
zetox1 Posted December 8, 2016 Author Share Posted December 8, 2016 can you help me a bit with getTimerDetails Link to comment
zetox1 Posted December 9, 2016 Author Share Posted December 9, 2016 refresh any ideas ? Link to comment
LoPollo Posted December 10, 2016 Share Posted December 10, 2016 On 8/12/2016 at 4:28 PM, zetox1 said: it have to restart after map loading: What do you mean? Link to comment
marty000123 Posted December 10, 2016 Share Posted December 10, 2016 1 minute ago, LoPollo said: What do you mean? I think he means the timer restarts after a new map has loaded. Link to comment
LoPollo Posted December 10, 2016 Share Posted December 10, 2016 (edited) If marty is right then you must assign the timer to a variable, and reset the counter variable to the default value (10 or 15, dunno) when the map start. Resetting the timer does nothing since it is build on the variable and not the timer itself, but it will "sync" the start time with the map start, so if you want reset the timer on new map start Edited December 10, 2016 by LoPollo Link to comment
zetoxx Posted December 16, 2016 Share Posted December 16, 2016 hi I forgot my password by the way it's me LoPollo could you make this for me what's you have written in your latest reply ? I have a bit problem with harder codes 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