GetPlrKnowledge

Category: Player
Since engine version: 1.0 OC

Description

With type specified the function returns true if the player has the construction plan of the specified object. In this case index and category are ignored. Otherwise, the function returns the indicated construction plan of the specified category.

Syntax

int GetPlrKnowledge(int player, id type, int index, int category);

Parameters

player:
Player whose construction plans you want to determine.
type:
[opt] If specified, the function returns true, if the player has the construction plan of the specified object.
index:
[opt] If type is not specified, this is the index of the construction plan from the list of construction plans.
category:
[opt] If type is not specified, this narrows down the category of the construction plans.

Example

if(GetPlrKnowledge(0,WindGenerator))
	Log("Player %s can construct a %s",GetPlayerName(0),WindGenerator->GetName());
Displays a message if the first player has the construction plan for wind generators.
var def = GetPlrKnowledge( 0,nil,4,C4D_Structure);
Log("The fifth construction plan of the first player is for ID "%i"",def);
See also: C4D_All, C4D_Goal, C4D_Living, C4D_Object, C4D_Rule, C4D_StaticBack, C4D_Structure, C4D_Vehicle, SetPlrKnowledge
Günther, 2002-02