Scripting/Squirrel/Functions/ReadIniInteger

From Vice City Multiplayer
Revision as of 05:13, 22 June 2016 by King (talk | contribs) (Created page with "__NOTOC__ This function reads an integer value from an .ini file. == Syntax == <code>int ReadIniInteger( string filename, string section, string var )</code> == Arguments =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

This function reads an integer value from an .ini file.

Syntax

int ReadIniInteger( string filename, string section, string var )

Arguments

  • filename This is the name of the file
  • section The section that contains the value you want to read
  • var The name of the variable

Example

This example will restore the cash amount player had on a previous visit.

function onPlayerJoin( player ) {

    local cash = ReadIniInteger( "PlayerCash.ini", "Cash", player.Name );
    if ( cash )
    {
         player.Cash = cash;
    }

}

Notes

The functions player.Name, player.Cash and call OnPlayerJoin were also used in in this example. More info about them in corresponding pages.

Related Functions