Scripting/Squirrel/Functions/RemoveIniValue
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
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.