/// es_yaggl_es // mrYoung Automatic GunGame Loader (EventScripts) // $purpose$ Load or Unload GunGame MOD depending on map prefixes // block yaggl_es_conf // $purpose$ Provides a configuration block for EndUser block yaggl_es_conf { // yaggl_es_gg_mapsprefixes - a comma separated list of gun game maps prefixes es_xsetinfo yaggl_es_gg_mapsprefixes "gg,gungame" // yaggl_es_mani_warmup_timer - time of mani warmup (should be equal to mani_warmup_timer from mani_server.cfg) // should only be used when mani admin plugin, or any other script/plugin managing warmup, is installed es_xsetinfo yaggl_es_mani_warmup_timer 90 // yaggl_es_gg_script - name of the script to load es_xsetinfo yaggl_es_gg_script "gungame4" // yaggl_es_gg_map_setup - setup for the map // should be equal to gg_map_setup from gg config alias yaggl_es_gg_map_setup "mp_timelimit 30; mp_winlimit 0; mp_maxrounds 0; mp_fraglimit 0; sv_alltalk 1; mp_chattime 18; mp_friendlyfire 0; mani_vote_allow_extend 0; ma_unrestrictall" } // block load // $purpose$ Triggered when script is loaded block load { // yaggl_es_ver es_xsetinfo yaggl_es_ver 0.2b1 es_makepublic yaggl_es_ver // loading configuration es_xdoblock yaggl_es/yaggl_es_conf // misc. var. init. es_xsetinfo yaggl_es_gg_status 0 } // event es_map_start // $purpose$ Triggered on map start event es_map_start { if (server_var(yaggl_es_gg_status) equalto 1) do { // if gg was previously loaded // then if (server_var(yaggl_es_mani_warmup_timer) > 0) do { // if we use mani warmup feature // then, unloading gg es_xsetinfo yaggl_es_gg_status 0 es_unload server_var(yaggl_es_gg_script) } } // getting map prefix es_xsetinfo yaggl_es_cmapprefix 0 es_token yaggl_es_cmapprefix server_var(eventscripts_currentmap) 1 "_" // checking whether we should load gg or not es_xsetinfo yaggl_es_gg_shouldbeloaded 0 es_xsetinfo yaggl_es_ctoken 0 es foreach token yaggl_es_ctoken server_var(yaggl_es_gg_mapsprefixes) "," "es_xdoblock yaggl_es/yaggl_es_check_gg_status" if (server_var(yaggl_es_gg_status) equalto 0) do { // if gg is not loaded // then if (server_var(yaggl_es_gg_shouldbeloaded) equalto 1) do { // if we should load gg // then if (server_var(yaggl_es_mani_warmup_timer) > 0) do { // if we're using mani warmup feature // computing delay value as warmup_timer - 5 seconds es_setinfo yaggl_es_loaddelay server_var(yaggl_es_mani_warmup_timer) es_xmath yaggl_es_loaddelay - 5 } else do { // computing delay as 3 seconds es_xsetinfo yaggl_es_loaddelay 3 } // then, enabling gg es_delayed server_var(yaggl_es_loaddelay) es_xsetinfo yaggl_es_gg_status 1 es_delayed server_var(yaggl_es_loaddelay) es_xmsg #multi #greenyAGGL_ES#default: Loading #lightgreen server_var(yaggl_es_gg_script) #default! es_delayed server_var(yaggl_es_loaddelay) es_xmsg #multi #greenyAGGL_ES#default: (expect some lags during loading part)! es_delayed server_var(yaggl_es_loaddelay) es_load server_var(yaggl_es_gg_script) es_delayed server_var(yaggl_es_loaddelay) yaggl_es_gg_map_setup } } else do { // else, if gg is loaded // then if (server_var(yaggl_es_gg_shouldbeloaded) equalto 0) do { // if we should unload gg // then, unloading gg es_xsetinfo yaggl_es_gg_status 0 es_xmsg #multi #greenyAGGL_ES#default: Unloading #lightgreen server_var(yaggl_es_gg_script) #default! es_unload server_var(yaggl_es_gg_script) } } } // block yaggl_es_check_gg_status // $purpose$ Check whether GunGame should be enabled or not block yaggl_es_check_gg_status { // compare current token with current map prefix es_xsetinfo yaggl_es_strcmpresult 0 es_strcmp yaggl_es_strcmpresult server_var(yaggl_es_cmapprefix) server_var(yaggl_es_ctoken) // if there's a match, we should load gg if (server_var(yaggl_es_strcmpresult) equalto 0) then es_xsetinfo yaggl_es_gg_shouldbeloaded 1 }