Scripting/Squirrel/Functions/ReadIniBool: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "__NOTOC__ This function reads a boolean value from an .ini file. == Syntax == <code>bool ReadIniBool( string filename, string section, string var )</code> == Arguments ==...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 28: Line 28:
=== Notes ===
=== 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.
The functions [[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/player.Name| player.Name ]], [[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/player.IsFrozen| player.IsFrozen]], [[http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/MessagePlayer| MessagePlayer]] and call [[OnPlayerJoin]] were also used in in this example. More info about them in the corresponding pages.


== Related Functions ==
== Related Functions ==


{{Scripting/Squirrel/Functions/INI Functions}}
{{Scripting/Squirrel/Functions/INI Functions}}
[[Category:Scripting/Squirrel/Functions/INI_Functions]]

Latest revision as of 18:15, 30 January 2017

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