<?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>GetHomebaseMaterial</title>
    <category>Player</category>
    <version>5.1 OC</version>
    <syntax>
      <rtype>int</rtype>
      <params>
        <param>
          <type>int</type>
          <name>player</name>
          <desc>Number of the player whose buying options to determine.</desc>
        </param>
        <param>
          <type>id</type>
          <name>id</name>
          <desc>If specified, the function returns the number of objects of the given type which the player can buy at his home base. In this case index and category are ignored.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>index</name>
          <desc>List index of the buyable item to check.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>category</name>
          <desc>Category of buyable items you want to check.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>With id specified, the function returns the number of objects of that type which the player can buy at his home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category buyable at the players home base. This will return object types which are generally buyable, even if currently no object of that type is available.</desc>
    <examples>
      <example>
        <code><funclink>Log</funclink>(&quot;Player %s can buy %d firestones!&quot;,<funclink>GetPlayerName</funclink>(0), GetHomebaseMaterial(0,Firestone));</code>
        <text>Returns the number of fire stones the first player can buy.</text>
        <code>var def = GetHomebaseMaterial(0,nil,3,<funclink>C4D_Vehicle</funclink>);
<funclink>Log</funclink>(&quot;The third buyable vehicle of this player is a %i&quot;,def);</code>
        <text>Gives the notice "The third buyable vehicle of this player is a ..."</text>
      </example>
    </examples>
    <related>
      <funclink>DoHomebaseMaterial</funclink>
      <funclink>GetHomebaseProduction</funclink>
      <funclink>DoHomebaseProduction</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>
