GetBaseMaterial

Category: Player
Since engine version: 1.0 OC

Description

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.

Syntax

int GetBaseMaterial(int player, id id, int index, int category);

Parameters

player:
Number of the player whose buying options to determine.
id:
[opt] 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.
index:
[opt] List index of the buyable item to check.
category:
[opt] Category of buyable items you want to check.

Example

Log("Player %s can buy %d firestones!",GetPlayerName(0), GetBaseMaterial(0,Firestone));
Returns the number of fire stones the first player can buy.
var def = GetBaseMaterial(0,nil,3,C4D_Vehicle);
Log("The third buyable vehicle of this player is a %i",def);
Gives the notice "The third buyable vehicle of this player is a ..."
See also: C4D_All, C4D_Goal, C4D_Living, C4D_Object, C4D_Rule, C4D_StaticBack, C4D_Structure, C4D_Vehicle, DoBaseMaterial, DoBaseProduction, GetBaseProduction, SetBaseMaterial, SetBaseProduction
Maikel, 2014-04