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?
Restricting a cmd to once every 24 hour period?
Heres a barter script i have, hope this helps you.
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)
Code: Select all
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);
endprogramSo 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)