Squirrel/Server/Functions/Ini/ReadIniString

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function reads a string saved to an .ini file. == Syntax == <code>string ReadIniString( string filename, string section, string var )</code> == Arguments == * '''filenam...)

Revision as of 00:56, 4 March 2009

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 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, name )
  3. {
  4. if ( ReadIniString( "IPs.ini", "IP", name ) == GetPlayerIP( player ) )
  5. {
  6. /* some nice autologin stuff here */
  7. MessagePlayer( "You have auto-logged in successfully!", player );
  8. }
  9. }
  10.  

Notes

The functions GetPlayerIP, MessagePlayer and call OnPlayerJoin were also used in in this example. More info about them in the corresponding pages.

Related Functions

Template:Squirrel/Functions/Ini

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox