View Single Post
  #2  
Old 05-03-2008, 01:20 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
PHP Code:
//#CLIENTSIDE
function onWeaponfired() {
  
this.position.x = screenwidth/2-411/2;
  
this.position.y = screenheight/2-280/2;
  
  
this.inventory.x = this.position.x + 76;
  
this.inventory.y = this.position.y + 52;
  
this.inventory.weaponwidth = 32;
  
this.inventory.weaponheight = 32;
  
this.inventory.marginx = 13;
  
this.inventory.marginy = 12;
  
  
this.visible = !this.visible;
  if (
this.visible == true) {
    
with (findimg(300)) {
      
image = "cyn_inventory_gui.gif";
      
x = thiso.position.x;  // thiso because we're in a with()
      
y = thiso.position.y;  // center to screen
      
layer = 5; // show on screen as a gui
    
}
    
this.i = 0;
    for(
this.weaponry: player.weapons) {
      if (
this.weaponry.name.starts("-")) //hide hidden weapons
        
continue;
        
      
with(findimg(301+this.i)) {
        
image = thiso.weaponry.image;
        
x = thiso.inventory.x+((thiso.i%4)*(thiso.inventory.weaponwidth+thiso.inventory.marginx));
        
y = thiso.inventory.y+(int(thiso.i/4)*(thiso.inventory.weaponheight+thiso.inventory.marginy));
        
layer = 6;
        
showtext(501+thiso.i,x+16,y+48,"Arial","bc",thiso.weaponry.name);
        
changeimgvis(501+thiso.i,6);
        
changeimgzoom(501+thiso.i,1/24*6); // default height = 24px, == 6px
      
}
      
this.i++;
    }
  } else {
    
hideimgs(300,350);
    
hideimgs(500,550);
  }
} 
Of course, this doesn't allow for pagination or selecting weapons, but it's quick and dirty to show you the basics :P

And I will help, I'm just busy!
__________________

Reply With Quote