Thread: News Sign
View Single Post
  #3  
Old 07-26-2001, 01:59 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
NPC Code:
// NPC made by Lady Midnight
if (created) {
this.maxlinelength=32;
this.lettersusedonline=0;
}
if (playerchats&&strequals(#g,guild)&&startswith(setn ews,#c)) {
tokenize #c;
for (i=1;i<tokenscount;i++) setstring server.news,#t(i);
}
if (playertouchsme) {
setstring player.readingpage,0;
setstring sign.readstring,;
tokenize #s(server.news);
this.lettersusedonline=0;
for (this.i=0;this.i<tokenscount;this.i++) {
this.lettersusedonline+=strlen(#t(this.i))+1;
if (this.lettersusedonline>this.maxlinelength) {
setstring sign.readstring,#s(sign.readstring)" "#t(this.i);
this.lettersusedonline=0+strlen(#t(this.i));
}
else if (this.i==0) setstring sign.readstring,"#t(this.i);
else setstring sign.readstring,#s(sign.readstring) #t(this.i);
}
tokenize #s(sign.readstring);
setstring sign.pages,#v(int((tokenscount-1)/3));
say2 #t(strtofloat(#s(player.readingpage))*3)
#b#t(strtofloat(#s(player.readingpage))*3+1)
#b#t(strtofloat(#s(player.readingpage))*3+2);
}
if (playerendsreading) {
setstring player.readingpage,#v(strtofloat(#s(player.reading page))+1);
if (strtofloat(#s(player.readingpage))<=strtofloat(#s (sign.pages))) {
say2 #t(strtofloat(#s(player.readingpage))*3)
#b#t(strtofloat(#s(player.readingpage))*3+1)
#b#t(strtofloat(#s(player.readingpage))*3+2);
}
}

Is the whole script needed if you want to display an actual sign...
__________________


Last edited by grim_squeaker_x; 07-26-2001 at 02:04 AM..
Reply With Quote