GetPlayerName

Category: Player
Since engine version: 4.6.5.0 CP

Description

Returns the name of a player. If the specified player number is invalid, 0 is returned. Thus this function can also be used to determine whether a player of a given number exists.

Syntax

string GetPlayerName (int iPlayer);

Parameter

iPlayer:
Number of the player whose name to get

Example

protected func Activate(pClonk)
  {
  // Begrüßen
  Message("Moin, %s. Was macht %s?", this(), GetName(pClonk), GetPlayerName(GetOwner(pClonk)));
  // Fertig
  return(1);
  }
Object script: when activated, the clonk asks what the player is doing.
See also: GetName, GetOwner, GetPlayerCount, GetTaggedPlayerName
Sven2, August 2002