PenUltima Online

It is currently Sat Oct 11, 2008 5:45 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Restricting a cmd to once every 24 hour period?
PostPosted: Thu Aug 31, 2006 3:44 am 
Offline

Joined: Thu Aug 10, 2006 9:59 am
Posts: 32
Hey, if I want a cmd to work once every 24 hour period and then give a message like "no no cant use for another bla bla bla".

Whats the easiest way to do it?should I write another function in time.inc or can I use one of the functions allready in there? Anyone have any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 5:06 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Heres a barter script i have, hope this helps you.

Code:
use uo;
use os;

CONST WAIT_TIME := 60;

program Barter(mobile, text)
   var last_barter := CInt(GetObjProperty(mobile, "#LastBarter"));
   
   if ( last_barter  && (Polcore().systime - last_barter) < WAIT_TIME )
      SendSysMessage(mobile, "You must wait at least "+WAIT_TIME+" seconds before bartering again.");
      return 0;
   else
      SetObjProperty(mobile, "#LastBarter", Polcore().systime);
   endif
   
Broadcast( mobile.name + " barters: " + text, 0, 41);
endprogram



So basicly, change the wait time, then add what you want it to do when they have no wait time right befor endprogram(in place of broadcast)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl