Here's the thing. I'm making a plugin to change player models as you might have known. I'm using two .INI files, one is for model list (let's say file1.ini) and second is for model data (as section) for team, gender, etc (let's say file2.ini). I'm using popular amx_settings_api to read those .INIs
But now i'm facing a problem. I have around 120 model list at file1.ini (i know it's a lot, bear with me) so as file2.ini have 120 sections. I want to add more, so i add a new list to file1 and new section to file2. When game is loading, it will show "MSG_ReadBitString: buffer overflow error". Then i tought maybe it's too much. So i'm replacing an existing line at file1 and replacing a section at file2. Started the game again, it's still giving same error. I even tried reducing by deleting ~5 lists + sections but nothing changed.
My code :
PHP Code:
public Read_PlayerModels()
{
new g_szConfigDir[64], sPath[64]
get_configsdir(g_szConfigDir, charsmax(g_szConfigDir))
format(sPath, charsmax(sPath), "%s/%s", g_szConfigDir, MODEL_DB);
if (!file_exists(sPath))
{
new text[64]
format(text, 63, "ERROR! Couldn't Open File: %s!", MODEL_DB)
set_fail_state(text);
}
new linedata[1024], iLine = 1;
new file = fopen(sPath, "rt");
while (file && !feof(file))
{
fgets(file, linedata, charsmax(linedata));
replace(linedata, charsmax(linedata), "^n", "");
if (!linedata[0] || linedata[0] == ';')
continue;
if (iLine > MAX_PLAYER)
{
set_fail_state("Error! Too Many Player Data.")
continue
}
copy(g_mdl_name[iLine], 63, linedata)
Read_PlayerModels_INI(iLine)
PrecacheModelData(iLine)
Read_Admin_Stuffs(iLine)
g_totalmdl = iLine
iLine++;
}
fclose(file);
}
public Read_PlayerModels_INI(iLine)
{
amx_load_setting_string(MODEL_CFG, g_mdl_name[iLine], "displayname", g_mdl_ign[iLine], 32)
amx_load_setting_int(MODEL_CFG, g_mdl_name[iLine], "sex", g_mdl_sex[iLine])
amx_load_setting_string(MODEL_CFG, g_mdl_name[iLine], "classtype", g_classtyp[iLine], 32)
amx_load_setting_int(MODEL_CFG, g_mdl_name[iLine], "handmodel", g_mdl_hand[iLine])
amx_load_setting_int(MODEL_CFG, g_mdl_name[iLine], "team", g_mdl_team[iLine])
amx_load_setting_string(MODEL_CFG, g_mdl_name[iLine], "extendedvox", g_extended_vox[iLine], 32)
}
If it's too much to handle, i'm ok if i have to reduce it. But why still gives same error even after rerducing it? What's wrong with my code? Is it need to reduce further like 50 section or what? Btw i'm using amxmodx 1.10.0 5467 latest and i'm not using this plugin for multiplayer, so no need to think abt that.
complete lists of my player models and source are attached below