Squirrel/Server/Functions/Ini/ReadIniInteger

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|ReadIniInteger}}
 +
{{RequiresModule|lu_ini|Modules/Squirrel/lu_ini}}
 
This function reads an integer value from an .ini file.
 
This function reads an integer value from an .ini file.
  

Latest revision as of 10:28, 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 an integer value from an .ini file.

[edit] Syntax

  1. int ReadIniInteger( string filename, string section, string var )

[edit] Arguments

  • filename This is the name of the file
  • section The section that contains the value you want to read
  • var The name of the variable

[edit] Example

This example will restore the cash amount player had on a previous visit.

  1.  
  2. function onPlayerJoin( player )
  3. {
  4. local cash = ReadIniInteger( "PlayerCash.ini", "Cash", player.Name );
  5.  
  6. if ( cash )
  7. {
  8. player.Cash = cash;
  9. }
  10. }
  11.  

[edit] Notes

The function Player.Cash and call onPlayerJoin were also used in in this example. More info about them in corresponding pages.

[edit] Related Functions

These functions are provided by the official module lu_ini.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox