View Single Post
  #10  
Old 02-24-2007, 06:09 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The class
PHP Code:
function onActionBuyWep()
{
  
player.chat "trigger2";
}
//#CLIENTSIDE
function onCreated()
{
  
setshape13232 );
  
setimgthis.image );
  
setTimer0.05 );
}
function 
onActionMouseClick()
{
  
showGui();
  
client.shopid this.id;
}
function 
onMouseDownbutton )
{
  if ( 
button == "left" )
  {
    
triggeractionmousexmousey"MouseClick"player.account );
  }
}
function 
onTimeOut()
{
  
chat this.stockamm;
  if ( 
this.stock == true )
  {
    
this.stockamm makevarthis.stockvar );
  }
  
setTimer0.05 );
}
function 
showGUI()
{
 
// GUI is here, works fine
}

function 
Shop_Buy.onAction()
{
  if ( 
client.shopid == this.id )
  {
    if ( 
player.rupees >= this.realprice )
    {
      
triggeractionthis.xthis.y"BuyWep");
    }
    else
    {
      
player.chat "You cannot afford this!";
    }
  }

The local NPC that joins it ...
PHP Code:
join"shoptest" );
//#CLIENTSIDE
function onCreated()
{
  
this.image "block.png";
  
this.weaponname "Items/Explosives";
  
this.itemname "Plastic Explosives";
  
this.itemprice 100;

__________________
Reply With Quote