View Single Post
  #1  
Old 05-11-2008, 04:58 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
Problem with Custom Inventory

PHP Code:
//#CLIENTSIDE
function onCreated(){ setTimer(0.05); disableselectweapons(); }

function 
onKeyPressed( code, key )
{
  if (
key == "q")
  {
    
client.qo = 1 - client.qo;
  }
}

function 
onTimeout()
{
  if (
client.qo = NULL)
    
hideMenu();
  else 
showMenu();
  
    if(
client.qo = 1)
    {
      
mx = int( mousescreenx - thiso.qx + 620);
      
my = int( mousescreeny - thiso.qy + 225);
      for(
temp.j=0;temp.j<player.weapons.size();temp.j++;) {
      
temp.i = findimg(201 + temp.j);
      if ( 
mx in | temp.i.x, temp.i.x + 16 | && my in | temp.i.y, temp.i.y + 16 | )
      {
        
showtext(301,temp.i.x+16,temp.i.y+36,"Arial","bc",thiso.item_name[this.temp_count]);
        
changeimgvis(301,6);
        
changeimgzoom(301,0.5);
      }
      else 
hideimg(301);
      }
    }
  
  
setTimer(0.05);
}

function 
showMenu()
{
  
thiso.qx = screenwidth / 2 + 180;
  
thiso.qy = screenheight / 2 - 100;  
  
with (findimg(200))
  {
    
image = "cyn_inventory_gui.gif";
    
x = thiso.qx;
    
y = thiso.qy;
    
layer = 4;
  }
  
thiso.item_name = NULL;
  
thiso.item_image = NULL;
  
thiso.item_pos = NULL;
  
thiso.item_list = NULL;
  
thiso.item_count = 0;
  
hideimgs(201,221);
  for (
temp.i: player.weapons)
  {
    if (
temp.i.name.starts("-")==0) {
      
thiso.item_name.add(temp.i.name);
      
thiso.item_image.add(temp.i.image);
      
thiso.item_pos.add(temp.i);
    }
  }
  for(
thiso.i=0; thiso.i<5; thiso.i++;)
  {
    for(
thiso.j=0; thiso.j<4; thiso.j++;)
    {
      
with(findimg(201 + thiso.item_count))
      {
        
image = thiso.item_image[thiso.item_count];
        
x = thiso.qx + 76 + (thiso.j * 45);
        
y = thiso.qy + 52 + (45*thiso.i);
        
layer = 5;
        
thiso.item_list[item_count] = findimg(201 + thiso.item_count);
        
thiso.item_count += 1;
      }
    }
  }
}

function 
hideMenu()
{
  
hideimgs(200,250);
  
hideimgs(300,350);
} 
When i put my mouse on the items I have, the text don't appear. Anyone know why?
Reply With Quote