Scripting/Squirrel/Functions/WriteIniString: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "__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 filena...") |
No edit summary |
||
Line 30: | Line 30: | ||
{{Scripting/Squirrel/Functions/INI Functions}} | {{Scripting/Squirrel/Functions/INI Functions}} | ||
[[Category:Scripting/Squirrel/Functions/INI_Functions]] |
Latest revision as of 18:16, 30 January 2017
This function writes a string value to an .ini file. If the file does not exist, the function will create it.
Syntax
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.
function onPlayerJoin( player )
{
WriteIniString( "IPs.ini", "IP", player.Name, player.IP );
}
Notes
The functions Player.Name, Player.IP and call OnPlayerJoin were also used in in this example. More info about them in the corresponding pages.