|
发表于 2015-10-12 20:11:29
|
显示全部楼层
来自 中国–江苏–泰州
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
register_plugin("precache", "1.0", "hjvl")
}
public plugin_precache()
{
new conffile[200]
new configdir[200]
get_configsdir(configdir,199)
format(conffile,199,"%s/precache.ini",configdir)
if(!file_exists(conffile))
{
log_amx("amxmodx/configs/precache.ini is missing!")
return 0
}
new lines = file_size(conffile,1)
new file[1024], len
for(new i=0;i<=lines;i++)
{
read_file(conffile,i,file,1023,len)
if(equal(file,"")) continue;
if(!equal(file,";",1)) precache_generic(file);
}
return PLUGIN_HANDLED
} |
|