GetPlayerVal
Category: Script/Getter/Player
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:
-
[optional] Section of the entry to be retrieved. If 0, all sections will be searched for an entry of the specified name.
- iPlayer:
-
[optional] Number of the player of which you want to retrieve an entry.
- iEntryNr:
-
[optional] Index of the value to be retrieved if an entry contains multiple values.
Remark
s
Warning: the retrieved values may differ from computer to computer and thus cause synchronization problems in network games.
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.
PeterW, April 2002