Squirrel/Server/Functions/Ini/ReadIniIndex

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|ReadIniIndex}}
 +
{{RequiresModule|lu_ini|Modules/Squirrel/lu_ini}}
 
This function reads the data name at the specified index from an .ini file.
 
This function reads the data name at the specified index from an .ini file.
  

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 reads the data name at the specified index from an .ini file.

[edit] Syntax

  1. bool ReadIniIndex( string filename, string section, int index )

[edit] Arguments

  • filename This is the name of the file
  • section The section that contains the value you want read
  • index The index in the ini (starting at 0)

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "readindex" )
  5. {
  6. if ( text )
  7. {
  8. local message = ReadIniIndex( text, player.Name, 0 );
  9. MessagePlayer( message, player );
  10. }
  11. }
  12. }
  13.  

This will message the player with the index 0, from the section labeled as their name in the file that they specify.

[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