Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A Small showtext() Issue (https://forums.graalonline.com/forums/showthread.php?t=80668)

TheStan 07-21-2008 04:09 AM

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;



cbk1994 07-21-2008 04:38 AM

I believe the screen layers are 4 and up ... try putting it on layer 4.

TheStan 07-21-2008 06:49 PM

Worked, thank you.


All times are GMT +2. The time now is 10:08 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.