Hello. It's my first time trying to use containi so I am not yet very familiar with it, I know it's like that native containi(const source[],const string[]); where source is the ini file and string is the string. The real problem is how can I read only specific text from every line from the ini, in this case the models, and not anything else that goes after them? Any help will be apreciated, thanks!
Code:
public plugin_precache()
{
new conffile_mdl[200]
new configdir_mdl[200]
get_configsdir(configdir_mdl,199)
format(conffile_mdl,199,"%s/models.ini",configdir_mdl)
if(!file_exists(conffile_mdl))
{
log_amx("amxmodx/configs/models.ini is missing!")
return 0
}
new lines = file_size(conffile_mdl,1)
new name[128], len
new model_path[128]
for(new i=0;i<=lines;i++)
{
read_file(conffile_mdl,i,name,127,len)
if(equal(name,"")) continue;
if(!equal(name,";",1)) {
// log_amx("precache: %s", file)
format(model_path, charsmax(model_path), "models/player/%s/%s.mdl",name,name)
precache_model(model_path);
}
}
return PLUGIN_HANDLED;
}