Thread: Uhm...
View Single Post
  #12  
Old 12-16-2001, 04:20 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
NPC Code:

if(strequals(#g,FAQ)){
if(strtofloat(#s(starttime))<1){
setstring starttime,#v(timevar);
}else if((timevar- strtofloat(#s(starttime)))+ strtofloat(#s(server.#atimeontag)) > 60){ setstring server.#atimeontag,#v( strtofloat(#s(server.#atimeontag)) + (timevar- strtofloat(#s(starttime))));
setstring starttime,#v(timevar);
}else{
if(strtofloat(#s(starttime))<0){
setstring server.#atimeontag,#v(strtofloat(#s(server.#atimeo ntag))+(timevar-strtofloat(#s(starttime))));
}
}


SHOULD update the server.[accountname]timeontag string every five minutes, assuming it is indeed 5 seconds per click.
NPC Code:

if(playerenters&&strequals(#g,FAQ Chief)) toweapons FAQ Checker;
if(playerchats&&strequals(#w,FAQ Checker)){
setcharprop #n,#c;
this.clicks=strtofloat(#s(server.#ctimeontag));
this.minutes=(this.clicks/12)%60;
this.hours=(this.clicks/720);
setplayerprop #c,#c: #v(this.hours) : #v(this.minutes) : #v((this.clicks%12)*5);
//setstring server.#ctimeontag,0;
}


Should report the H:M:S assuming 5 seconds per click - otherwise you can redo the math however you like. Uncomment the last line and it'll reset the time since last check; either way you're gonna have to record it, either how much time they put in last time you checked or what the last time you checked was. It'd be rude if you checked it (thereby clearing it), then checked again five minutes later and fired them for not coming on at all!
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote