NULL

From UODemo Wiki
Revision as of 21:00, 24 January 2010 by Batlin (talk | contribs) (Protected "NULL" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))

Jump to: navigation, search

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!");
}