The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






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: 2 Guest(s)