Squirrel/Server/Functions/Ini/WriteIniBool
From Liberty Unleashed Wiki
This function writes a boolean value to an .ini file. If the file does not exist, the function will create it.
Syntax
bool WriteIniBool( string filename, string section, string var, bool 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 boolean true/false
Example
This example will freeze a player and store the control state to an ini file when they type '/freezeme'.
function OnPlayerCommand( player, command, text ) { if ( command = "freezeme" ) { SetPlayerFrozen( player, true ); WriteIniBool( "Players.ini", "Frozen", GetPlayerName( player ), true ); MessagePlayer( "Buhaha! You can't move anymore!", player ); } }
Notes
The functions SetPlayerFrozen, GetPlayerName, MessagePlayer and call OnPlayerCommand were also used in in this example. More info about them in the corresponding pages.