GetTaggedPlayerName

Category: Player
Since engine version: 1.0 OC

Description

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

Syntax

string GetTaggedPlayerName(int player);

Parameter

player:
Number of the player whose name to get.

Remark

The markup color is chosen so the player name will be readable on black background. Dark player names are brightened up.

Example

protected func Entrance(object obj)
{
	// has entered a clonk
	if(obj->GetOCF() & OCF_CrewMember)
		Log("%s of player %s got the golden crown!", obj->GetName(), GetTaggedPlayerName(obj->GetOwner()));
	// or something else?
	else
		Log("The golden crown is now in a %s", obj->GetName());
}

protected func Departure(object obj)
{
	// has exited something
	Log("The golden crown has been dropped!");
}
Object script for a valuable "golden crown". If it is collected by a clonk, a message is displayed in the log that draws attention to the player that collected it.
See also: GetPlayerName
Sven2, 2006-03