yukitokun1996 Posted October 10, 2016 Share Posted October 10, 2016 i need a function settimer , so that for new day i mean : function resetDailyQuest(thePlayer) setElementData(thePlayer,"dailyquest", 0) end -- i need settimer for it reset on new day my english is bad , thanks Link to comment
Walid Posted October 10, 2016 Share Posted October 10, 2016 (edited) setTimer(lowerWarningLevel, 86400000, 1, thePlayer) 1 Day = 86400000 Milliseconds Edited October 10, 2016 by Walid 1 Link to comment
yukitokun1996 Posted October 11, 2016 Author Share Posted October 11, 2016 13 hours ago, Walid said: setTimer(lowerWarningLevel, 86400000, 1, thePlayer) 1 Day = 86400000 Milliseconds does it start my function in 00:00 AM ? Link to comment
iPrestege Posted October 11, 2016 Share Posted October 11, 2016 You want to make it with player real time? or ingame time? Link to comment
yukitokun1996 Posted October 11, 2016 Author Share Posted October 11, 2016 26 minutes ago, FaHaD said: You want to make it with player real time? or ingame time? ingame time Link to comment
iPrestege Posted October 11, 2016 Share Posted October 11, 2016 Then u can use this function : getTime So what are you trying to do if the time is 00:00 ? Link to comment
yukitokun1996 Posted October 11, 2016 Author Share Posted October 11, 2016 1 minute ago, FaHaD said: Then u can use this function : getTime So what are you trying to do if the time is 00:00 ? i want start my function : function resetDailyQuest(thePlayer) setElementData(thePlayer,"dailyquest", 0) end on 0:00 , i need a full example , can you help me ? Link to comment
iPrestege Posted October 11, 2016 Share Posted October 11, 2016 Here's an simple example : function aDailyUpdate ( ) -- Create function local aHour,aMinute = getTime ( ) -- get ingame time if ( aHour == 00 and aMinute == 00 ) then -- check if the time is 00:00 removeEventHandler ( 'onClientRender',root,aDailyUpdate ) -- remove the function handler aCall ( ) -- call the function we need outputChatBox ( 'Time now is 00:00' ) -- make a chat box note setTimer ( function ( ) addEventHandler ( 'onClientRender',root,aDailyUpdate ) -- we add the event again so make an update daily end,5000,1 ) end end addEventHandler ( 'onClientRender',root,aDailyUpdate ) -- add the function handler function aCall ( ) -- called function outputChatBox ( 'Hello world!' )-- chat box message end It's a client side code. 1 Link to comment
yukitokun1996 Posted October 11, 2016 Author Share Posted October 11, 2016 1 minute ago, FaHaD said: Here's an simple example : function aDailyUpdate ( ) -- Create function local aHour,aMinute = getTime ( ) -- get ingame time if ( aHour == 00 and aMinute == 00 ) then -- check if the time is 00:00 removeEventHandler ( 'onClientRender',root,aDailyUpdate ) -- remove the function handler aCall ( ) -- call the function we need outputChatBox ( 'Time now is 00:00' ) -- make a chat box note setTimer ( function ( ) addEventHandler ( 'onClientRender',root,aDailyUpdate ) -- we add the event again so make an update daily end,5000,1 ) end end addEventHandler ( 'onClientRender',root,aDailyUpdate ) -- add the function handler function aCall ( ) -- called function outputChatBox ( 'Hello world!' )-- chat box message end It's a client side code. thanks very munch <3 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