Markeloff Posted September 13, 2013 Share Posted September 13, 2013 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? Link to comment
Castillo Posted September 13, 2013 Share Posted September 13, 2013 You can store the timer timeleft and re-create it when they login. Link to comment
Markeloff Posted September 13, 2013 Author Share Posted September 13, 2013 Well, how to know how much time is left? Link to comment
Markeloff Posted September 13, 2013 Author Share Posted September 13, 2013 How to re-create it? Link to comment
Castillo Posted September 13, 2013 Share Posted September 13, 2013 The same way you created it in the first place... Link to comment
Markeloff Posted September 13, 2013 Author Share Posted September 13, 2013 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) Link to comment
Castillo Posted September 13, 2013 Share Posted September 13, 2013 getTimerDetails returns several values, the first one is the time left of the timer in milliseconds, save that value in account data. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now