Squirrel/Server/Functions/Ini/WriteIniBool

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

Revision as of 00:56, 27 November 2009

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

Syntax

  1. 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'.

  1.  
  2. function OnPlayerCommand( player, command, text )
  3. {
  4. if ( command = "freezeme" )
  5. {
  6. SetPlayerFrozen( player, true );
  7. WriteIniBool( "Players.ini", "Frozen", GetPlayerName( player ), true );
  8.  
  9. MessagePlayer( "Buhaha! You can't move anymore!", player );
  10. }
  11. }
  12.  

Notes

The functions SetPlayerFrozen, GetPlayerName, MessagePlayer and call OnPlayerCommand 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