Jump to content

help set time


yukitokun1996

Recommended Posts

Posted

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

Posted (edited)
setTimer(lowerWarningLevel, 86400000, 1, thePlayer)

1 Day = 86400000 Milliseconds

Edited by Walid
  • Like 1

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
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 ?

Posted

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.

  • Like 1

  

Posted
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

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