Squirrel/Server/Functions/Ini/CountIniSection

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|CountIniSection}}
 +
{{RequiresModule|lu_ini|Modules/Squirrel/lu_ini}}
 
This function counts the items in the given .ini file section.
 
This function counts the items in the given .ini file section.
  

Latest revision as of 10:26, 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 counts the items in the given .ini file section.

[edit] Syntax

  1. int CountIniSection( string file, string section )

[edit] Arguments

  • file - The name of the .ini file
  • section - The section from which the items should be counted

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "clountsection" )
  5. {
  6. if ( text ) MessagePlayer( "Section Count: " + CountIniSection( text, player.Name ), player );
  7. }
  8. }
  9.  

This will count the section which is labeled as the players name in the given ini file and return it in a message to that player.

[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