Jump to content
  • 0

Question

Posted

I need help at this one, ex. i have 24 hours, i want that 24 hours to be reduced every time the player is online. So if I have 24 hours at the start, then ill go online for 3 hours then when i log out, it will be just 21 hours the next time I log on. Also if the time runs out when I am still online, I'll be notified. Is this one possible?

1 answer to this question

Recommended Posts

Posted

Haven't tested, some of the math might be off but this is the concept:

-    script    PlayerTimer    -1,{
OnPCLoginEvent:
   set @PlayerTimer, gettimetick(2);
   addtimer 86400-PlayerTimer,strnpcinfo(0)+"::OnFinish";
   end;

OnPCLogoutEvent:
   if (@PlayerTimer) set PlayerTimer, PlayerTimer+gettimetick(2)-@PlayerTimer;
   end;

OnFinish:
   dispbottom "Your time has run out.";
   set @PlayerTimer,0;
   set PlayerTimer,0;
   end;
}

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...