IsPlayerNPC: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=Checks if a player is an NPC| params=<syntaxhighlight lang="lua">(playerid)</syntaxhighlight> <poem>::playerid: The id of the player to be check. </poem>| retv...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
params=<syntaxhighlight lang="lua">(playerid)</syntaxhighlight>
params=<syntaxhighlight lang="lua">(playerid)</syntaxhighlight>
<poem>::playerid: The id of the player to be check. </poem>|
<poem>::playerid: The id of the player to be check. </poem>|
retval= *1 The player is an NPC
retvals= '''true''', if the player is an NPC; '''false''', otherwise.|
*0 The player is not an NPC|
example=<source lang="lua">
example=<source lang="lua">
function onPlayerJoin(player)
function onPlayerJoin(player)
Line 12: Line 11:
}
}
</source>|
</source>|
relfuncs=*[[IsPlayerNPC]]
relfuncs=*[[ConnectNPC]]
}}
}}

Latest revision as of 16:35, 1 April 2022


Description:
Checks if a player is an NPC


Parameters:

(playerid)

playerid: The id of the player to be check.


Return Values:
true, if the player is an NPC; false, otherwise.


Example

function onPlayerJoin(player)
{
	if(IsPlayerNPC(player.ID))
		print("An NPC connected");
}

Related Functions

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