Jump to content

FindNearestPlayerCrew

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: FindNearestPlayerCrew
Function Description: Finds the nearest player crew member by checking player list against a given position, returning the player ID if a matching crew is found, otherwise returns -1.
File Location: cmm.netFunctions.lua
Syntax: CMM.FindNearestPlayerCrew( table vec3 )
Return Value: table or number
Parameters: Name Description
vec3A table containing the 3D position {x, y, z} to locate the nearest player crew member.
Example: CMM.FindNearestPlayerCrew({x=150, y=250, z=50})
Example Description: Searches for the nearest player crew at position (150, 250, 50) and returns their player information or -1 if no match is found.
Related Functions:
Notes: