Cfg(key:Str, [player:Int]):Any
Access host configuration. The first parameter is the name of a configuration option as used in pconfig.src, such as "AllowHiss" or "UnitsPerTorpRate". The function returns the value of this option, an integer, boolean or string.
If the option is an array option, the second parameter can be specified to determine which player's value to get. When the second parameter is not specified for an array option, the return value is the value for your race.
Version Differences: The detail behaviour for array options differs between versions. In PCC2 Web, the following rules apply:
- for regular per-player options, the second argument is optional and defaults to the current player. If EMPTY is given, the result is empty;
- for string array options (Language, ExperienceLevelNames), if an index is given, returns the respective element; otherwise, returns all elements as comma-separated string;
- for other array options, the argument is mandatory; passing EMPTY yields empty;
- PCC2 Web does not distinguish between boolean and integer options, and will always return integers (1=true, 0=false).
See also: Functions