Jump to content

help set time


yukitokun1996

Recommended Posts

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
Link to comment
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

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