View Single Post
  #1  
Old 01-10-2006, 07:53 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
Suggestion: Clientside Class

Clientside TStaticVar CAN'T join classes. In a former thread it was said it was due to security risk. However, why can't classes be scripted in the Weapon NPC and make the scripts truly class-oriented?

PHP Code:
class item
{
  function 
itemid 0quant // Constructor
  
{
    
this.index id;
    
this.quant quant;
  }
  function 
dropquant )
  {
    if (
quant this.quantquant this.quant;
    if (
quant 1) return false;
    
triggeraction(00"serverside""Items"this.idthis.quant);
  }

Or, even more in depth, more functions to the actual classes:

PHP Code:
class wearableitem : public item
{
  function 
wearableitemid 0quant 1) : item:itemidquant );

  function 
wear()
  {
    if (
this.worn) return true;
 
    
player.wear ++;
    
this.worn true;

    return 
true;
  }
  function 
remove()
  {
    if (!
this.worn) return true;

    
player.wear --;
    
this.worn false;
    return 
true;
  }