Squirrel/Server/Functions/Ini/RemoveIniValue
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function removes a value from an .ini file. == Syntax == <code>bool RemoveIniValue( string file, string section, string key )</code> == Arguments == * '''file''' - The n...) |
|||
Line 14: | Line 14: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerPart( player, reason ) | |
+ | { | ||
+ | RemoveIniValue( "Accounts.ini", player.Name, "LoggedIn" ); | ||
+ | } | ||
</code> | </code> | ||
+ | |||
+ | This will remove the LoggedIn value under the section labeled with the players name in the Accounts.ini when the player leaves. | ||
=== Notes === | === Notes === | ||
− | + | The call [[Squirrel/Server/Events/Player/onPlayerPart|onPlayerPart]] was used in in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Ini}} | {{Squirrel/Server/Functions/Ini}} |
Revision as of 01:35, 8 March 2010
This function removes a value from an .ini file.
Syntax
bool RemoveIniValue( string file, string section, string key )
Arguments
- file - The name of the .ini file
- section - The section from where the ini value should be removed
- key - The key to the ini value to be removed
Example
function onPlayerPart( player, reason ) { RemoveIniValue( "Accounts.ini", player.Name, "LoggedIn" ); }
This will remove the LoggedIn value under the section labeled with the players name in the Accounts.ini when the player leaves.
Notes
The call onPlayerPart was used in in this example. More info about this in the corresponding page.
Related Functions
These functions are provided by the official module lu_ini.