Squirrel/Server/Functions/Ini/RemoveIniValue

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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 ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
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 ===
  
-- Example notes here
+
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

  1. 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

  1.  
  2. function onPlayerPart( player, reason )
  3. {
  4. RemoveIniValue( "Accounts.ini", player.Name, "LoggedIn" );
  5. }
  6.  

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.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox