Scripting/Server/Functions/GetClosestPlayer
The nearest other player, or null.
Syntax
GetClosestPlayer(player)Arguments
- Player player
Returns
Player or null
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "getclosestplayer" )
{
local result = GetClosestPlayer( player );
MessagePlayer( "GetClosestPlayer returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- FindPlayer
- FindVehicle
- FindObject
- FindPickup
- FindSphere
- FindBlip
- FindNPC
- GetPlayers
- GetMaxPlayers
- GetVehicleCount
- GetObjectCount
- KickPlayer
Section: Finding and counting entities
Categories: Server functions | Finding and counting entities