QUERY_NPC(L)

NAME
	query_npc - determine if living object is an NPC

SYNOPSIS
	int query_npc

LOCATION
	/obj/living.c

RETURN VALUE
	A zero value means the object is either a player or does not
	have the 'npc' variable set.  A non-zero value means object is
	an NPC (Non-Player Character, a role-playing term).

NOTES
	This is not always reliable.  A wizard can easily (by design or by
	mistake) create a monster who does not have the npc variable set
	to a true value.  The preferred method of testing if a living is
	a player is to use the external function interactive().  
	interactive(object) will determine whether the object has a player
	behind it typing away at a keyboard, or does not.

EXAMPLES
	int enter_castle(string str) {
	   if( this_player()->query_npc() ) {
	      write("The guard stops "+this_player()->query_name()+".\n"+
	            "The guard says: No NPC's allowed in here.\n");
	      return 1;
	   }
	   ...
	}

SEE ALSO
	interactive(E), living(E)

Help topics available:
add_hp add_money add_sp catch_tell heal_self
hit_player monster_died move_player query_max_sp query_money
query_attack query_npc query_objective query_gender query_possessive
query_pronoun query_gender_string query_sp query_worn query_hp
query_level query_living query_max_hp set_wet stop_fight

[START|BACK ]




[ NannyMuds main page | FAQ | Contact us ]

You are guest number 73 since March 2020.
This file was last modified: June 2000.