Squirrel/Server/Functions/Ini/DeleteIniSection

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function removes a whole section from an .ini file. == Syntax == <code>bool DeleteIniSection( string file, string section )</code> == Arguments == * '''file''' - The nam...)
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|DeleteIniSection}}
 +
{{RequiresModule|lu_ini|Modules/Squirrel/lu_ini}}
 
This function removes a whole section from an .ini file.
 
This function removes a whole section from an .ini file.
  
Line 13: Line 14:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( player, cmd, text )
 +
{
 +
if ( cmd == "delsection" )
 +
{
 +
if ( text ) DeleteIniSection( text, player.Name );
 +
}
 +
}
 
</code>
 
</code>
 +
 +
This will delete the section labeled as the players name in the given ini file.
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes here
+
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] 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}}

Latest revision as of 10:27, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
Note: This function requires the external module lu_ini.

This function removes a whole section from an .ini file.

[edit] Syntax

  1. bool DeleteIniSection( string file, string section )

[edit] Arguments

  • file - The name of the .ini file
  • section - The section which should be deleted

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "delsection" )
  5. {
  6. if ( text ) DeleteIniSection( text, player.Name );
  7. }
  8. }
  9.  

This will delete the section labeled as the players name in the given ini file.

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.


[edit] Related Functions

These functions are provided by the official module lu_ini.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox