DCS func getPlayerName

From DCS World Wiki - Hoggitworld.com
Revision as of 00:01, 21 March 2022 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Scripting Root

Envrioment: Mission Scripting
Function: getPlayerName Added with: 1.2.4
Member Of: Unit
Syntax: string Unit.getPlayerName(Class Self )
Description: Returns a string value of the name of the player if the unit is currently controlled by a player. If a unit is controlled by AI the function returns nil.


Return Value: string
Return Example: 'bob'
Examples:
Related Functions: Unit Functions: isActive, getPlayerName, getID, getNumber, getCategoryEx, getObjectID, getController, getGroup, getCallsign, getLife, getLife0, getFuel, getAmmo, getSensors, hasSensors, getRadar, getDrawArgumentValue, getNearestCargos, enableEmission, getDescentCapacity

Object Functions: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir

Coalition Object Functions: getCoalition, getCountry

Notes: As of DCS 1.5 this function works on both ground units and aircraft.