Squirrel/Server/Functions/Ini/ReadIniInteger
From Liberty Unleashed Wiki
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", GetPlayerName( player ) ); if ( cash ) { SetPlayerCash( player, cash ); } }
Notes
The function SetPlayerCash and call OnPlayerJoin were also used in in this example. More info about them in corresponding pages.