Squirrel/Server/Functions/Ini/DeleteIniSection
From Liberty Unleashed Wiki
(Difference between revisions)
(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...) |
|||
Line 13: | Line 13: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | 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 === | ||
− | + | 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}} |
Revision as of 01:28, 8 March 2010
This function removes a whole section from an .ini file.
Syntax
bool DeleteIniSection( string file, string section )
Arguments
- file - The name of the .ini file
- section - The section which should be deleted
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "delsection" ) { if ( text ) DeleteIniSection( text, player.Name ); } }
This will delete the section labeled as the players name in the given ini file.
Notes
The call onPlayerCommand 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.