源代码在此---------- /*
- * AMXMODX script
- * simple precaching script
- * depends on amxmodx/configs/precache.ini
- */
- #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
- }
复制代码 |