AmISpawned

From NPC for VCMP 0.4 Servers
Revision as of 05:05, 6 September 2024 by Habi (talk | contribs) (Created page with "{{Welcome| desc=This function checks whether the npc is currently spawned.| params=NoParams| example=<source lang="lua"> function OnPlayerText(playerid, message) { if(message== "John") { if(AmISpawned()) { SendChat("Yes dear."); } else { SendChat("I'm not spawned lilly"); } } } </source>| relfuncs=*RequestSpawn| retvals=Returns true if the npc is spawned, false otherwise.| }}")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Description:
This function checks whether the npc is currently spawned.


Parameters: NoParams


Return Values:
Returns true if the npc is spawned, false otherwise.


Example

function OnPlayerText(playerid, message)
{
	if(message== "John")
	{
		if(AmISpawned())
		{
			SendChat("Yes dear.");
		}
		else
		{
			SendChat("I'm not spawned lilly");
		}
	}
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.