GetHomebaseMaterial

Category: Player
Since engine version: 4.6.5.0 CP

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 iIndex and dwCategory are ignored. If id is 0, 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 GetHomebaseMaterial (int iPlr, id id, int iIndex, int dwCategory);

Parameters

iPlr:
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 iIndex and dwCategory are ignored.
iIndex:
[opt] List index of the buyable item to check.
dwCategory:
[opt] Category of buyable items you want to check.

Example

Message("Spieler %s kann %d Flintstones kaufen",0,GetPlayerName(0), GetHomebaseMaterial(0,FLNT));
Returns the number of flint stones the first player can buy.
var def=GetHomebaseMaterial(0,0,3,C4D_Vehicle());
Message("Der dritte kaufbare Fahrzeugtyp des Spielers ist %i",0,def);
Gives the notice "The third buyable vehicle of this player is a ..."
See also: C4D_All, C4D_Goal, C4D_Knowledge, C4D_Living, C4D_Object, C4D_Rule, C4D_StaticBack, C4D_Structure, C4D_Vehicle, DoHomebaseMaterial, DoHomebaseProduction, GetHomebaseProduction
Günther, Februar 2002