ReadIniString

From Liberty Unleashed Wiki
Revision as of 15:48, 7 August 2012 by Shadow (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
Note: This function requires the external module lu_ini.

This function reads a string saved to an .ini file.

Syntax

  1. string ReadIniString( string filename, string section, string var )

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

Example

This example will check whether the player connects from the same IP than earlier and auto-logs them in.

  1.  
  2. function onPlayerJoin( player )
  3. {
  4. if ( ReadIniString( "IPs.ini", "IP", player.Name ) == player.IP )
  5. {
  6. /* some nice autologin stuff here */
  7. MessagePlayer( "You have auto-logged in successfully!", player );
  8. }
  9. }
  10.  

Notes

The functions Player.IP, MessagePlayer and call onPlayerJoin were also used in in this example. More info about them in corresponding pages.

Related Functions

These functions are provided by the official module lu_ini.

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox