forked from Mirrors/openclonk
46 lines
1.9 KiB
XML
46 lines
1.9 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<!DOCTYPE funcs
|
|
SYSTEM '../../../clonk.dtd'>
|
|
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
|
<funcs>
|
|
<func>
|
|
<title>GetTaggedPlayerName</title>
|
|
<category>Player</category>
|
|
<version>5.1 OC</version>
|
|
<syntax>
|
|
<rtype>string</rtype>
|
|
<params>
|
|
<param>
|
|
<type>int</type>
|
|
<name>player</name>
|
|
<desc>Number of the player whose name to get.</desc>
|
|
</param>
|
|
</params>
|
|
</syntax>
|
|
<desc>Returns the name of a player, including color markup using the player color. If the specified player number is invalid, <code>nil</code> is returned. Thus this function can also be used to determine whether a player of a given number exists.</desc>
|
|
<remark>The markup color is chosen so the player name will be readable on black background. Dark player names are brightened up.</remark>
|
|
<examples>
|
|
<example>
|
|
<code>protected func Entrance(object obj)
|
|
{
|
|
// has entered a clonk
|
|
if(obj-><funclink>GetOCF</funclink>() & <funclink>OCF_CrewMember</funclink>)
|
|
<funclink>Log</funclink>("%s of player %s got the golden crown!", obj-><funclink>GetName</funclink>(), GetTaggedPlayerName(obj-><funclink>GetOwner</funclink>()));
|
|
// or something else?
|
|
else
|
|
<funclink>Log</funclink>("The golden crown is now in a %s", obj-><funclink>GetName</funclink>());
|
|
}
|
|
|
|
protected func Departure(object obj)
|
|
{
|
|
// has exited something
|
|
<funclink>Log</funclink>("The golden crown has been dropped!");
|
|
}</code>
|
|
<text>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.</text>
|
|
</example>
|
|
</examples>
|
|
<related><funclink>GetPlayerName</funclink></related>
|
|
</func>
|
|
<author>Sven2</author><date>2006-03</date>
|
|
</funcs>
|