Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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 
onKeyPressedcodekey )
{
  if (
key == "q")
  {
    
client.qo client.qo;
  }
}

function 
onTimeout()
{
  if (
client.qo NULL)
    
hideMenu();
  else 
showMenu();
  
    if(
client.qo 1)
    {
      
mx intmousescreenx thiso.qx 620);
      
my intmousescreeny thiso.qy 225);
      for(
temp.j=0;temp.j<player.weapons.size();temp.j++;) {
      
temp.findimg(201 temp.j);
      if ( 
mx in temp.i.xtemp.i.16 | && my in temp.i.ytemp.i.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 180;
  
thiso.qy screenheight 100;  
  
with (findimg(200))
  {
    
image "cyn_inventory_gui.gif";
    
thiso.qx;
    
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.iplayer.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=0thiso.i<5thiso.i++;)
  {
    for(
thiso.j=0thiso.j<4thiso.j++;)
    {
      
with(findimg(201 thiso.item_count))
      {
        
image thiso.item_image[thiso.item_count];
        
thiso.qx 76 + (thiso.45);
        
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:48 PM.


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