Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
24h hour online when server crash timer dissapear...
Author Message
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #11
RE: 24h hour online when server crash timer dissapear...
That's true, it does use resources. You could always go with Mordaunt's idea of using serv.time, which is accurate, and use f_onserver_timer in sphere.ini to trigger any instances of which players online can receive a reward, here's a little example assuming you set TIMERCALL=1 in sphere.ini:
Code:
[events e_reward_timer] //add this event to all the players
on=@login
serv.timercall=1 //let's just set timercall here in sphere.ini without having to change the settings manually.
if !(<tag0.reward_timer>)
  tag.reward_timer=<eval <serv.time> /600> //<serv.time> is based in miliseconds
endif

[function f_onserver_timer] //sphere.ini TIMERCALL=1
if (<serv.clients>)
  for x 0 <eval <serv.clients> +-1>
    if (<serv.client.<local.x>>)
      if (<serv.client.<local.x>.account.plevel> < 2) //is a player?
        if (<eval <eval <serv.time> /600> +-<serv.client.<local.x>.tag0.reward_timer>> >= 1440) //1 day passed
          serv.client.<local.x>.tag.reward_timer=<eval <serv.time> /600>
          trysrc <serv.client.<local.x>.uid> serv.client.<local.x>.message @67 You have been rewarded!
          //serv.newitem=your_reward_item
          //new.cont=<serv.client.<local.x>.findlayer.21> //pack? or findlayer.29 for bank?
        endif
      endif
    endif
  endfor
endif

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 09-14-2012 10:36 AM by Skul.)
09-14-2012 10:34 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)