AmISpawned: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(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.| }}")
 
No edit summary
 
Line 1: Line 1:
{{Welcome|
{{Welcome|
desc=This function checks whether the npc is currently spawned.|
desc=This function checks whether the npc is currently spawned.|
params=NoParams|
params=<source>NoParams</source>|
example=<source lang="lua">
example=<source lang="lua">
function OnPlayerText(playerid, message)
function OnPlayerText(playerid, message)

Latest revision as of 05:06, 6 September 2024


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.