Jump to content

Timer Saving


Markeloff

Recommended Posts

Posted

Well, I tried and tried but i failed.

Can we save a running timer if a player quit then load it when he login?

Can we save the timer in his account data then load his data when he login?

Any solution to save a timer and load it onPlayerLogin?

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

Posted

You can store the timer timeleft and re-create it when they login.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

The same way you created it in the first place... :roll:

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function SAVE() 
if getElementData ( source, "isPlayerJailed" ) then 
if isTimer(JTime) then 
getTimerDetails ( JTime ) 
setAccountData(getAccountName(source),----What do i write here to save ? 
end 
end 
end 
addEventHandler( "onPlayerQuit", root, SAVE) 

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

Posted

getTimerDetails returns several values, the first one is the time left of the timer in milliseconds, save that value in account data.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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