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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
<?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>GetPlrKnowledge</title>
<category>Player</category>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>player</name>
<desc>Player whose construction plans you want to determine.</desc>
</param>
<param>
<type>id</type>
<name>type</name>
<desc>If specified, the function returns <code>true</code>, if the player has the construction plan of the specified object.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>index</name>
<desc>If <code>type</code> is not specified, this is the index of the construction plan from the list of construction plans.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>category</name>
<desc>If <code>type</code> is not specified, this narrows down the category of the construction plans.</desc>
<optional />
</param>
</params>
</syntax>
<desc>With <code>type</code> specified the function returns <code>true</code> if the player has the construction plan of the specified object. In this case <code>index</code> and <code>category</code> are ignored. Otherwise, the function returns the indicated construction plan of the specified category.</desc>
<examples>
<example>
<code><funclink>if</funclink>(GetPlrKnowledge(0,WindGenerator))
<funclink>Log</funclink>("Player %s can construct a %s",<funclink>GetPlayerName</funclink>(0),WindGenerator-><funclink>GetName</funclink>());</code>
<text>Displays a message if the first player has the construction plan for wind generators.</text>
<code>var def = GetPlrKnowledge( 0,nil,4,<funclink>C4D_Structure</funclink>);
<funclink>Log</funclink>("The fifth construction plan of the first player is for ID "%i"",def);</code>
<text />
</example>
</examples>
<related>
<funclink>SetPlrKnowledge</funclink>
<funclink>C4D_All</funclink>
<funclink>C4D_Goal</funclink>
<funclink>C4D_Living</funclink>
<funclink>C4D_Object</funclink>
<funclink>C4D_Rule</funclink>
<funclink>C4D_StaticBack</funclink>
<funclink>C4D_Structure</funclink>
<funclink>C4D_Vehicle</funclink>
</related>
</func>
<author>Günther</author><date>2002-02</date>
</funcs>
|