Scripting/Squirrel/Functions/Ini/ReadIniBool

From VC-MP Wiki

Jump to: navigation, search

This function reads a boolean value from an .ini file.

Syntax

bool ReadIniBool( 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 has been frozen earlier and if so, freezes them on join.

function onPlayerJoin( player )
{
     if ( ReadIniBool( "Players.ini", "Frozen", player.Name ) )
     {
          player.IsFrozen = true;
          MessagePlayer( "Sorry, you have been frozen earlier! :)", player );
     }
}

Notes

The functions player.Name, player.IsFrozen, MessagePlayer and call onPlayerJoin were also used in in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
squirrel scripting