Recommended Posts

Hello. I want create a dx timer which when the player disconnect, and connect again to the server then not reset the timer. 

Sorry for my bad english :c

Share this post


Link to post

When player quit, save the timer details to database or XML or anywhere you want using getTimerDetails, this can be done on server side.

Then when player join the game, create the timer with timer details you saved it before.

Share this post


Link to post
3 hours ago, 50cent said:

Hello. I want create a dx timer which when the player disconnect, and connect again to the server then not reset the timer. 

Sorry for my bad english :c

 

So you want create timer on player ?This small example may help you :

 

addCommandHandler ( "Record", function ( player ) -- Create a command
	if not getAccountData ( getPlayerAccount ( player ),"Recorded" ) then -- Check if player hasn't data before
		setAccountData ( getPlayerAccount ( player ),"Recorded", getRealTime().timestamp ) -- give him a data
		else -- else - if he has a data 
		outputChatBox ( "Your data has recorded since "..(getAccountData ( getPlayerAccount ( player ),"Recorded" ) - getRealTime().timestamp).." seconds.", player ) -- out put record of data
-- we can get record of data by this way : (getAccountData ( getPlayerAccount ( player ),"Recorded" ) - getRealTime().timestamp)
	end
end )

 


 

  • Thanks 1

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.