mapconfig pluginnal oldaottam meg a knife zone pluginnak a cvar-jait a mapokhoz Na de az a baj hogy aim crazyjumpnál nem tölti be a fájt...vagy ha be is tölti akkor nem minden cvart.
itt a kod és azt nem találom benne hogy mennyi a várakozási idő még betölti a cfg.t task-ot kerestem benne de nem találtam
Kód: #define PLUGIN_NAME "Mapconfig Extended" #define PLUGIN_VERSION "1.0.3" #define PLUGIN_AUTHORS "_KaszpiR_"
/* AMX Mod X script. * * Mapconfig Extended 1.0.3 * Execute map config depending on the defined prefix found in name of the map. * by _KaszpiR_ http://hlds.pl #hlds.pl @ quakenet.org * * Based on plugin by JustinHoMi (justin@justinmitchell.net) * http://www.modkillers.com #modkillers in irc.gamesnet.net * * * Changelog: * 1.0.3 - added cvar amx_mce_cfg that defines the file containing prefixess (default mapconfig.ini) - added cvar amx_mce_dir that defines the directory cintaining the configg files with prefixes by default 'maps' that is later finned to addons/amxmodx/configs/maps. Do not add any beginning or ending slashes. - changed the configs naming to load fies with _prefix.cfg where prefix is changed to the found text, like de_ cs_ etc so now for de_ prefix it loads _de_.cfg file - prefixes occurence in mapconfig.ini is important. - i suggest not to use more than 5 prefixes per map (in example if you got map named de_dust_blow2.cfg and you got the following prefixes de_ de_dust de_dust_blow then all of them will be executerd if the config files exist, respectively _de_.cfg _de_dust.cfg _de_dust_blow.cf
- optimizations suggested by Zenith77 and Xanimos - on map load i suggest looking at server status window via rcon to find any errors and warnings
* 1.0.2 - Complete change, it loads prefixes form file named addons/amxmodx/configs/mapconfig.ini and loads only prefix files * the custom map configs are not executed cause the amdin.sma allready do it. * 1.0.1 - Modified to support general map prefix configs like de_ aim_ fy_ - you must have de_.cfg aim_.cfg fy_.cfg * files in addons/amxmodx/configs/maps/ (modification by _KaszpiR_) * 1.0.0 - Ported to AMX MOD X (without translations) * 0.9.9 - Added translations support for AMX Mod 0.9.9 * 0.61 - Changes load delay to 6s (to work better with SQL ServerCfg) * 0.6 - Execs configs rather than loading file * - Delays execution for 5s after map changes * 0.5 - Initial release * */
#define PLUGIN_MOD "[AMXX] [MCE]" #define MAX_WORD_LENGTH 16 //#define DEBUG 1 #include <amxmodx> #include <amxmisc>
new currentmap[32] public plugin_init(){ register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHORS) register_cvar("amx_mce_cfg","mapconfig.ini") register_cvar("amx_mce_dir","maps")
new filename[128], filepath[64], filename_cfg[128], filepath_dir[64] get_configsdir( filepath, 63 ) get_cvar_string("amx_mce_cfg", filename, 31) // we read to the currentmap cvar the cvar that defines name of file containing proexies format(filename_cfg,127,"%s/%s", filepath, filename) // filename contains full path to the maps.ini get_cvar_string("amx_mce_dir", filename, 31) // we read to the currentmap cvar the cvar that defines direcotry for custom map configs format(filepath_dir, 63, "%s/%s", filepath, filename) //set porper file path
get_mapname(currentmap, 31) //set proper map name to the cvar /////////////////// if( !file_exists( filename_cfg ) ) { server_print("%s HIBA: File %s nemletezik, nincs mit tenni.", PLUGIN_MOD, filename_cfg) } else { new Float:f = 0.1 new i = 0, l = 0, pos = 0 new prefix[MAX_WORD_LENGTH] while( read_file( filename_cfg, pos++, prefix, MAX_WORD_LENGTH-1, l ) ) { if( prefix[0] == ';' || !l ) continue // skip comments and empty lines parse( prefix, prefix, MAX_WORD_LENGTH-1 ) #if defined DEBUG server_print("%s HIBAELHARITAS: '%s'", PLUGIN_MOD ,prefix) #endif if(containi(currentmap,prefix) == 0 ) { #if defined DEBUG server_print("%s DEBUG: %i, %s ? %s ", PLUGIN_MOD , i, currentmap, prefix ) #endif filename[0] = '^0' // clear string new len = format(filename, 127, "%s/_%s.cfg", filepath_dir, prefix) if(file_exists(filename)) { set_task(5.5 + f, "delayed_load", 14114 + i++, filename, len+1) #if defined DEBUG server_print("%s HIBAELHARITAS: tennivalo hozzaadva %f, %i, %s ", PLUGIN_MOD , f , i, filename) #endif f += 0.1
} else { server_print("%s VIGYAZAT: Elotag %s eszlelve de a %s file nem letezik", PLUGIN_MOD, prefix, filename) } } } }
///////////////////
}
public delayed_load(filename[]) { server_print("%s Egyedi Map Bealitasok Betoltese A %s-hoz (%s)",PLUGIN_MOD, currentmap, filename) server_cmd("exec %s",filename) }
// end of file
|