Jump to content

Recommended Posts

Posted

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

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted

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.

Open for cooperation.

Discord: idarrr#7935

Posted
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

Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة

ليس عليك اسعاد الجميع ,
ولكن عليك بإن لا تؤذي أحداً 

=========
You do not have to make everyone happy,
But you should not hurt anyone

 

Want to contact with me?

 

Discord: JustCarry#2616 (Always there)
Skype: Live:JustCarry10 (Not always)

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