Interface IConfigService
Provides typed access to the open.mp server config (config.json / runtime values).
public interface IConfigService
Methods
GetBool(string)
Gets a boolean config value.
bool? GetBool(string key)
Parameters
keystringThe config key.
Returns
GetFloat(string)
Gets a floating-point config value.
float? GetFloat(string key)
Parameters
keystringThe config key.
Returns
GetInt(string)
Gets an integer config value.
int? GetInt(string key)
Parameters
keystringThe config key.
Returns
GetOptions()
Retrieves a read-only collection of available configuration options and their associated types.
IReadOnlyDictionary<string, ConfigOptionType> GetOptions()
Returns
- IReadOnlyDictionary<string, ConfigOptionType>
An IReadOnlyDictionary<TKey, TValue> containing the names and types of all available configuration options.
GetString(string)
Gets a string config value.
string? GetString(string key)
Parameters
keystringThe config key.
Returns
GetStrings(string)
Gets a string-array config value.
string?[] GetStrings(string key)
Parameters
keystringThe config key.
Returns
- string[]
The value array; an empty array if the key is missing.
GetValueType(string)
Gets the type of the value stored under the given key.
ConfigOptionType GetValueType(string key)
Parameters
keystringThe config key.
Returns
- ConfigOptionType
The value type.