GetClosestPlayer: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "__NOTOC____NOEDITSECTION__<big> NPC Scripts have the following functions too. {| style=height:1em |scope="col" style="width: 300px; text-align:left; vertical-align: top;"| *[...")
 
No edit summary
 
Line 1: Line 1:
__NOTOC____NOEDITSECTION__<big>
{{Welcome| desc= Gets the closest player to an NPC|
NPC Scripts have the following functions too.
retvals=The playerid of the closest player according to the parameters specified or 255 if there is no such closest player. It checks only players streamed in.|
{| style=height:1em
params=<syntaxhighlight lang="lua">(checkteam=false)</syntaxhighlight>
|scope="col" style="width: 300px; text-align:left; vertical-align: top;"|  
<poem>::checkteam: If this optional parameter is provided true, the id of the closest player whose team id is not that of npc will be returned.</poem>|
*[[GetClosestPlayer]]
}}
|}</big>

Latest revision as of 05:26, 27 December 2022


Description:
Gets the closest player to an NPC


Parameters:

(checkteam=false)

checkteam: If this optional parameter is provided true, the id of the closest player whose team id is not that of npc will be returned.


Return Values:
The playerid of the closest player according to the parameters specified or 255 if there is no such closest player. It checks only players streamed in.