Squirrel/Server/Functions/Ini/WriteIniInteger

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|WriteIniInteger}}
 +
{{RequiresModule|lu_ini|Modules/Squirrel/lu_ini}}
 
This function writes an integer value to an .ini file. If the file does not exist, the function will create it.
 
This function writes an integer value to an .ini file. If the file does not exist, the function will create it.
  

Latest revision as of 10:29, 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 writes an integer value to an .ini file. If the file does not exist, the function will create it.

[edit] Syntax

  1. bool WriteIniInteger( string filename, string section, string var, int value )

[edit] Arguments

  • filename This is the name of the file
  • section The section that contains the value you want to create/edit
  • var The name of the variable
  • value The integer value for the variable

[edit] Example

This example will save player's cash to a file 'PlayerCash.ini' when they leave the game.

  1.  
  2. function onPlayerPart( player, name, reason )
  3. {
  4. WriteIniInteger( "PlayerCash.ini", "Cash", player.Name, player.Cash );
  5. }
  6.  

[edit] Notes

The functions Player.Name, Player.Cash and call onPlayerPart were also used in in this example. More info about them in the corresponding pages.

[edit] Related Functions

These functions are provided by the official module lu_ini.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox