View Single Post
  #3  
Old 01-31-2008, 07:18 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Well, it's not a problem with playerenters, since I'm not using that. Most of the scripts aren't entirely mine, but rather old maloria script, but I edited them.

The Heart display script:
PHP Code:
function onCreated() {
  
showimg(200"mal_heartanim.gif", (player.0.5)%64, (player.2)%64);
  
setTimer(0.05);
}

function 
onTimeout() {
  
findimg(200).player.0.5;
  
findimg(200).player.2;

  if (
player.attr[8] == NULL) {
    
temp.healthcheck 0;

    
findimg(100).player.0.5;
    
findimg(100).player.2;
  
    
temp.healthcheck player.attr[4] * 100;

    if (
temp.healthcheck in |96100|) findimg(200).red 0.1;
    else if (
temp.healthcheck in |9195|) findimg(200).red 0.2;
    else if (
temp.healthcheck in |8690|) findimg(200).red 0.3;
    else if (
temp.healthcheck in |8185|) findimg(200).red 0.4;
    else if (
temp.healthcheck in |7680|) findimg(200).red 0.5;
    else if (
temp.healthcheck in |7175|) findimg(200).red 0.6;
    else if (
temp.healthcheck in |6670|) findimg(200).red 0.7;
    else if (
temp.healthcheck in |6165|) findimg(200).red 0.8;
    else if (
temp.healthcheck in |5660|) findimg(200).red 0.9;
    else if (
temp.healthcheck in |5155|) findimg(200).red 1;
    else if (
temp.healthcheck in |4650|) findimg(200).green 0.9;
    else if (
temp.healthcheck in |4145|) findimg(200).green 0.8;
    else if (
temp.healthcheck in |3640|) findimg(200).green 0.7;
    else if (
temp.healthcheck in |3135|) findimg(200).green 0.6;
    else if (
temp.healthcheck in |2630|) findimg(200).green 0.5;
    else if (
temp.healthcheck in |2125|) findimg(200).green 0.4;
    else if (
temp.healthcheck in |1620|) findimg(200).green 0.3;
    else if (
temp.healthcheck in |1115|) findimg(200).green 0.2;
    else if (
temp.healthcheck in |610|) findimg(200).green 0.1;
    else if (
temp.healthcheck in |15|) findimg(200).green 0;
  }
  else if (
player.attr[8] == "black") {
    
with (findimg(200)) {
      
mode red green blue 0;
    }
  }
  else if (
player.attr[8] == "white") {
    
with (findimg(200)) {
      
mode red green blue 1;
    }
  }
    
  
  
setTimer(0.05);

player.attr[4] is hp/maxhp (ignore the part with player.attr[8], I'm probably gonna remove it)

Here's the nickname display script:
PHP Code:
function onCreated() onTimeOut();
function 
onTimeOut() {
  if (!
clientr.stealth) {
    
temp.nick player.attr[10].tokenize("(");
    
temp.width1 = (temp.nick[0].length()*6)/16;
    
temp.width2 = (player.attr[11].length()*6)/16;
    
showtext(200player.x+1.5-(temp.width1/2), player.y+3"Verdana""b"temp.nick[0]);
    
changeimgcolors(200111.85);
    
changeimgzoom(200.6);
    
showtext(201player.x+1.5-(temp.width2/2), player.y+3.75"Verdana""b"player.attr[11]);
    
changeimgcolors(201111.85);
    
changeimgzoom(201.6);
  }
  else 
hideimgs(200201);
  
setTimer(0.05);

player.attr[10] is the players nickname

And then this is the chat display script. (It's quite messy, the guy who originally made it wasn't the best scripter)
PHP Code:
function onPlayerEnters() Init();
function 
onTimeOut() Init();
function 
Init() {
  if (
player.chat.length() > 0) {
    if(
this.mode != 1)
      
this.mode=1;
    if(
this.char != player.attr[16].length()) {
      
this.char player.attr[16].length();
      
hideimgs(200,400);
    }
    if(
this.text != player.attr[16] || this.chatx != (player.x) ||this.chaty != (player.y+2) || this.chatz != (player.z+2.5)) {
      
this.text player.attr[16];
      
temp.tokens wraptext(56,NULL,player.chat);
      
this.chatx player.x;
      
this.chaty player.y+2;
      
this.chatz player.z+2.5;
      for(
i=0;i<temp.tokens.size();i++) {
    
temp.width = (temp.tokens[i].length()*4)/16;
        
showtext2(200+i,this.chatx-(temp.width/2),this.chaty,this.chatz+(temp.tokens.size()-1)-i,"Comic Sans","b",temp.tokens[i]);
        
//Temporary color
        
changeimgcolors(200+i,1,1,1,1);
        
changeimgzoom(200+i,client.textsize);
        
findImg(200+i).layer++;
        
showtext2(300+i,this.chatx+.2-(temp.width/2),this.chaty+.2,this.chatz+(temp.tokens.size()-1)-i,"Comic Sans","b",temp.tokens[i]);
        
changeimgcolors(300+i,0,0,0,.5);
        
changeimgzoom(300+i,client.textsize);
      }
    }
  }
  else {
    if(
this.mode == 1) {
      
this.mode 0;
      
hideimgs(200,400);
    }
  }
  
setTimer(0.05);

I do, however, use onPlayerEnters() in the main system script. I do something like this:
PHP Code:
player.attr[7] = "";
player.attr[7] = "ganiname.gani"
To reset the gani script.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote