Squirrel/Server/Functions/Ini/WriteIniString

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function writes a string value to an .ini file. If the file does not exist, the function will create it. == Syntax == <code>bool WriteIniString( string filename, string se...)

Revision as of 00:24, 4 March 2009

This function writes a string value to an .ini file. If the file does not exist, the function will create it.

Syntax

  1. bool WriteIniString( string filename, string section, string var, string value )

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 string value

Example

This example will save player's IP to file 'IPs.ini' when they join.

  1.  
  2. function OnPlayerJoin( id, name )
  3. {
  4. WriteIniString( "IPs.ini", "IP", GetPlayerName( id ), GetPlayerIP( id ) );
  5. }
  6.  

Notes

The call OnPlayerJoin was also used in in this example. More info about it in the corresponding page.

Related Functions

Template:Squirrel/Functions/Ini

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox