Suicide: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=This function kills the npc.| params=<syntaxhighlight lang="lua"> NoParams</syntaxhighlight> <poem></poem>| example= The following npc commits suicide if some one textes 'loser' to it. <source lang="lua"> function OnPlayerText(playerid, message) { if(message=="loser") { Suicide() } }</source>| relfuncs=*SetMyHealth *RequestClassAbs| returns=* true on success and false on failure (npc not spawned)| }}")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:
relfuncs=*[[SetMyHealth]]
relfuncs=*[[SetMyHealth]]
*[[RequestClassAbs]]|
*[[RequestClassAbs]]|
returns=* true on success and false on failure (npc not spawned)|
retvals=true on success and false on failure (npc not spawned)|
}}
}}

Latest revision as of 04:47, 6 September 2024


Description:
This function kills the npc.


Parameters:

NoParams


Return Values:
true on success and false on failure (npc not spawned)


Example The following npc commits suicide if some one textes 'loser' to it.

function OnPlayerText(playerid, message)
{
	if(message=="loser")
	{
	Suicide()
	}
}

Related Functions

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