NULL

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


Return to the Command List.