View Single Post
  #1  
Old 07-21-2008, 04:09 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
A Small showtext() Issue

It appears, there is an issue with my usage of showtext(). I haven't used it in a pretty long time so I'm sure it's either something ridiculously silly, or I'm just forgetting something simple but, I was hoping the forums might be able to answer the question the wiki wasn't able to.

I ask that you focus your attention on the "update()" function section of the script because that is where the "showtext()" lies. Thanks all!

PHP Code:
/*
  Written by Stan for the attempted making of his own little
  idea. Please don't delete.
        - Stan, :D

  Msg Setup:
    {text, by, msgtype}
*/
public function addmsg(textbytypeto) {
  
temp.sentby null;
  
temp.msg null;
  
temp.pl null;
  
  
sentby findplayerbycommunityname(by);
  
  switch (
type) {
    case 
"global":
      echo(
"global");
      
msg = (sentby.nick " (" sentby.communityname ") " " shouts: " text);
      for (
plallplayers) {
        if (
pl.level != null && !pl.isexternal) {
          echo(
pl);
          
//with (pl)
            
clientFunction2(thiso.name"addmsg", {msgbytype});
        } 
      }
    break;
    
    case 
"whisper":
    break;
  }
}
function 
onCreated() {
  
// Utilities
  
join("util_triggercontrol");
}
//#CLIENTSIDE
function onCreated() {
  
// How long the message will show up on the screen
  
this.messagetime 5;
  
  
setTimer(1);
}
function 
onPlayerChats() {
  
temp.toks null;
  
temp.com null;
  
temp.text null;
  
  if (
player.chat.starts("/")) {
    
toks player.chat.tokenize();
    
com toks[0].substring(1);
    
    switch (
com) {
      case 
"global":
        
text player.chat.substring(toks[0].length() + 1);
        
serverFunction2(this.name"addmsg"textplayer.communityname"global");
      break;
      
      case 
"whisper":
        
text player.chat.substring((toks[0].length() + toks[1].length() + 2));
        
serverFunction2(this.name"addmsg"textplayer.communityname"whisper"toks[1]);
      break;
    }
  }
}
function 
onTimeout() {
  
temp.0;

  
update();
  for (
0client.msgs.size(); i++) {
    if (
client.msgs[i][1] > 0) {
      
client.msgs[i][1] --;
      echo(
"MESSAGE " ": TIME: " client.msgs[i][1]);
    }
    else {
      echo(
"DELETING MSG");
      
client.msgs.delete(i);
      
client.msgupdate true;
    }
  }
  
setTimer(1);
}
public function 
update() {
  
temp.text null;
  echo(
"Updating");
  
hideimgs(200220);
  if (
client.msgupdate) {
    echo(
"MSGS HAVE BEEN UPDATED.");
    if (
client.msgs.size() > 0) {
      echo(
"lol");
      for (
0client.msgs.size(); i++) {
        
text client.msgs[i][0][0];
        echo(
"TEXT: " text);
        
showtext(200 i15, (GraalControl.height 15 + (10)), "Arial""c"text);
        
changeimgvis(200 i3);
        
//changeimgmode(200 + i, 1);
      
}
    }
    
client.msgupdate false;
  }
}
public function 
addmsg(data) {
  echo(
"DATA: " data);
  
client.msgs.add({datathis.messagetime});
  
client.msgupdate true;
}
public function 
clearmsgs() {
  
client.msgs.clear();
  
client.msgupdate true;

Reply With Quote