Scripting/Squirrel/Functions/RemoveIniValue: 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 deletes a selected value from an ini file. == Syntax == <code>RemoveIniValue( string FileName, string Section, string Value )</code> == Arguments ==...")
 
No edit summary
 
Line 53: Line 53:


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

Latest revision as of 18:16, 30 January 2017

This function deletes a selected value from an ini file.

Syntax

RemoveIniValue( string FileName, string Section, string Value )

Arguments

  • FileName - This is the file name
  • Section - The section name. Use without "[" and "]"
  • Value - What do you want delete

Example

To see how this works, let's create (again) a sample ini file 'numbers.ini'. You can copy and paste this: [no idea for name] 1 = 1 2 = fgh [spam] 2 = 1 asd = 69 [end] end = yeah

Now we want to delete the line where is '2 = 1'. Let's do this, when the server starts.

function onServerStart() {

    RemoveIniValue( "numbers.ini", "spam", "2" );

}

After this check the ini file. It should look like this: [no idea for name] 1 = 1 2 = fgh [spam] asd = 69 [end] end = yeah

Notes

The call OnServerStart was used in in this example. More info about this in the corresponding page.

Related Functions