Hi AM community i have a bug or soemthing to report since AMXX latest build at the moment, i'm using this LOADING / SAVING API
https://forums.alliedmods.net/showthread.php?t=243202 and it work's fine with this version of AMXX
Code:
amxmodx-1.8.3-dev-git399
but with latest snapshot "atm" not anymore, no error responded but it's not saving strings to .ini file this one:
Code:
amxmodx-1.8.3-dev-git4156
the folowing function
PHP Code:
amx_save_setting_string_arr
And so a plugin huge like ZP it's not working anymore with latest snapshot
PHP Code:
public native_save_setting_string_arr(plugin_id, num_params)
{
// Retrieve and check params
new filename[32], setting_section[64], setting_key[64]
if (!RetrieveParams(filename, charsmax(filename), setting_section, charsmax(setting_section), setting_key, charsmax(setting_key)))
return false;
new Array:array_handle
if (!RetrieveArray(array_handle))
return false;
// Open file for read
new path[64], file
if (!OpenCustomFileRead(path, charsmax(path), filename, file, true))
return false;
// Try to find section
if (!SectionExists(file, setting_section))
{
// Section not found, append at the end
if (!CustomFileAppend(file, path)) return false;
WriteSection(file, setting_section)
WriteKeyValueArrayString(file, setting_key, array_handle)
fclose(file)
return true;
}
// Try to find key in section
new keypos_start, keypos_end, replace_values = true
if (!KeyExists(file, setting_key, keypos_start, keypos_end))
{
if (feof(file))
{
// End of file, append at the end
if (!CustomFileAppend(file, path)) return false;
WriteKeyValueArrayString(file, setting_key, array_handle)
fclose(file)
return true;
}
// End of section, add new key + value pair at the end
replace_values = false
}
// We have to use a second file (tempfile) to add data at an arbitrary position
new temppath[64], tempfile
if (!OpenTempFileWrite(temppath, charsmax(temppath), tempfile))
{
fclose(file)
return false;
}
// Copy new data into temp file
CopyDataBeforeKey(file, tempfile, keypos_start, keypos_end, replace_values)
WriteKeyValueArrayString(tempfile, setting_key, array_handle)
CopyDataAfterKey(file, tempfile)
// Replace original with new
if (!ReplaceFile(file, path, tempfile, temppath))
{
fclose(tempfile)
return false;
}
return true;
}
BUT THE OTHER FUNCTIONS WORK JUST FINE what shall i do ?
__________________