Difference between revisions of "NULL"

From UODemo Wiki
Jump to: navigation, search
(Created page with 'object '''NULL'''(void); This returns an object with a fixed serial of 0. It is important to note that this is a function so you must use it with round brackets (). This is diff...')
 
m (Protected "NULL" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
(No difference)

Revision as of 21:00, 24 January 2010

object NULL(void);

This returns an object with a fixed serial of 0. It is important to note that this is a function so you must use it with round brackets (). This is different from the C language!


Therefor the following 2 code examples are equal:

// Example 1
if(getWeapon(this) == NULL () ) // Notice the () after NULL !!!
{
  systemMessage(this, "I am unarmed!");
}
else
{
  systemMessage(this, "I am armed!");
}
// Example 2
if(objtoint(getWeapon(this)) == 0)
{
  systemMessage(this, "I am unarmed!");
}
else
{
  systemMessage(this, "I am armed!");
}