GetPlayerVal

Category: Get*Val
Since engine version: 4.9.1.0 GWE

Description

Retrieves properties of a player by way of the name under which they are stored in the Game.txt component of a savegame

Syntax

any GetPlayerVal (string strEntry, string strSection, int iPlayer, int iEntryNr);

Parameters

strEntry:
Name of the entry to be retrieved
strSection:
[opt] Section of the entry to be retrieved. If 0, all sections will be searched for an entry of the specified name.
iPlayer:
[opt] Number of the player of which you want to retrieve an entry.
iEntryNr:
[opt] Index of the value to be retrieved if an entry contains multiple values.

Remarks

Warning: the retrieved values may not be synchronization safe, meaning they may differ from computer to computer in a network game. Using these values may cause sync loss in a network game.
Most useful applications for strEntry are already implemented in System.c4g/GetXVal.c

Example

Log("Spieler %d hat %d Objekte!", iPlr, GetPlrObjectsOwned(iPlr));
Writes the number of objects owned by this player into the log file.
See also: GetActMapVal, GetDefCoreVal, GetObjectInfoCoreVal, GetObjectVal, GetPlayerInfoCoreVal, GetScenarioVal
PeterW, April 2002