View Single Post
  #3  
Old 02-20-2007, 07:13 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Kristi View Post
Showing the scripts involved helps a tad!
lol, I was going to come back to this and add them, and completely forgot.

Here is some code that sets up the gani to an attr and some sample attrs that the ganis uses:
PHP Code:
player.attr[10] = "opan_playerstats.gani";
player.attr[11] = "15/15";
player.attr[12] = "0/0"
Here is the gani script:
PHP Code:
function onPlayerEnters() {
  
temp.i;
  
temp.stattemp.stats
  
stats = {"nick""hp""armor"};
  
  
0;
  for (
statstats) { 
    
with (findimg(201 i)) {
      
font "Verdana";
      
style "cb";
      
zoom = (stat == "nick") ? 0.7:0.5;
      
layer 1;
      
textshadow true;
      
shadowcolor = {111};
      
shadowoffset = {0.10.1};
      if (
stat == "armor") {
        
red 0;
        
green 0;
        
blue 1;
      }
      
thiso.(stat "img") = this;
    }
    
i++;
  }

  
setTimer(0.05);
}

function 
onTimeOut() {
  
this.nickimg.player.1.5;
  
this.nickimg.player.3.2;
  
this.nickimg.text player.nick;

  
this.hpimg.player.1.5;
  
this.hpimg.player.1;
  
this.hpimg.text "HP: " player.attr[11];
  
temp.colors hpColor(player.attr[11]);
  
this.hpimg.red temp.colors[0];
  
this.hpimg.green temp.colors[1];
  
this.hpimg.blue temp.colors[2];

  
this.armorimg.player.1.5;
  
this.armorimg.player.4;
  
this.armorimg.text "Armor: " player.attr[12];
  
setTimer(0.05);
}

function 
hpColor(pattr) {
  
temp.hp temp.pattr.substring(0temp.pattr.pos("/"));
  if (
temp.hp >= 7) {
    return {
0,1,0,1};
  }
  else if (
temp.hp >= 4) {
    return {
1,1,0,1};
  }
  else {
    return {
1,0,0,1};
  }

__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.

Last edited by napo_p2p; 02-20-2007 at 10:44 AM..
Reply With Quote