Jump to content

FindPlayerUnitID: Difference between revisions

From CMM Wiki
FindPlayerUnitID – created via PowerShell script (2025-11-11T21:12:28Z)
Tag: Recreated
 
m FindPlayerUnitID – created via PowerShell script (2026-06-24T22:27:02Z)
 
Line 1: Line 1:
{{Template:FunctionInfo|fName=          FindPlayerUnitID|fDescription=  Retrieves the unitID (or slotID) of a player by their name from the mission player list, returning the unitID if found or -1 if not present.|parentFile=    cmm.netFunctions.lua|syntax=        CMM.FindPlayerUnitID(PlayerName <string>)|return=        number|returnDesc=    Returns the unitID or slotID of the player if found, otherwise returns -1.|example=        CMM.FindPlayerUnitID("OzDeaDMeaT")|exampleDesc=    Looks up the unitID for the player named "OzDeaDMeaT" in the player list and returns it if found, otherwise returns -1.|related=        |note=          |envType= CMM|par1=        string PlayerName|reqType1=    string|reqName1=    PlayerName|desc1=      The name of the player as it appears in the mission editor or in-game.}}
{{Template:FunctionInfo|fName=          FindPlayerUnitID|fDescription=  Retrieves the unitID (or slotID) of a player by their name from the mission player list, returning the unitID if found or -1 if not present.|parentFile=    cmm.netFunctions.lua|syntax=        CMM.FindPlayerUnitID(PlayerName <string>)|return=        number or string|returnDesc=    Returns the unitID or slotID of the player if found, otherwise returns -1.|example=        CMM.FindPlayerUnitID("OzDeaDMeaT")|exampleDesc=    Looks up the unitID for the player named "OzDeaDMeaT" in the player list and returns it if found, otherwise returns -1.|related=        |note=          |envType= CMM|par1=        string PlayerName|reqType1=    string|reqName1=    PlayerName|desc1=      The name of the player as it appears in the mission editor or in-game.}}

Latest revision as of 12:27, 24 June 2026

Return to CMM Command Reference
Environment: Mission Scripting
Function: FindPlayerUnitID
Function Description: Retrieves the unitID (or slotID) of a player by their name from the mission player list, returning the unitID if found or -1 if not present.
File Location: cmm.netFunctions.lua
Syntax: CMM.FindPlayerUnitID( string PlayerName )
Return Value: number or string
Parameters: Name Description
PlayerNameThe name of the player as it appears in the mission editor or in-game.
Example: CMM.FindPlayerUnitID("OzDeaDMeaT")
Example Description: Looks up the unitID for the player named "OzDeaDMeaT" in the player list and returns it if found, otherwise returns -1.
Related Functions:
Notes: