File: GetTaggedPlayerName.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (45 lines) | stat: -rw-r--r-- 1,916 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?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>() &amp; <funclink>OCF_CrewMember</funclink>)
		<funclink>Log</funclink>(&quot;%s of player %s got the golden crown!&quot;, obj-><funclink>GetName</funclink>(), GetTaggedPlayerName(obj-><funclink>GetOwner</funclink>()));
	// or something else?
	else
		<funclink>Log</funclink>(&quot;The golden crown is now in a %s&quot;, obj-><funclink>GetName</funclink>());
}

protected func Departure(object obj)
{
	// has exited something
	<funclink>Log</funclink>(&quot;The golden crown has been dropped!&quot;);
}</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>