Multimod - no ejecuta los plugins
#1
Hola puse el multimod configure todo bien

Lo que carga es -config.cfg y -maps.ini

lo sa q de aca
https://forums.alliedmods.net/showthread.php?t=95568

multimod.ini
Código:
[Normal Clasico]:[clasico]:[clasico-config.cfg]

[Una en la recamara]:[recamara]:[recamara-config.cfg]

[La mancha]:[lamancha]:[lamancha-config.cfg]

[Aim]:[aim]:[aim-config.cfg]

[Surf]:[surf]:[surf-config.cfg]

[Death Run]:[deathrun]:[deathrun-config.cfg]

[Death Race]:[deathrace]:[deathrace-config.cfg]

[Base Builder]:[basebuilder]:[basebuilder-config.cfg]

;[Zombie Escape]:[zombieescape]:[zombieescape-config.cfg]

[The Hidden]:[thehidden]:[thehidden-config.cfg]

Archivos
Código:
aim-config.cfg
aim-maps.ini
aim-plugins.ini

basebuilder-config.cfg
basebuilder-maps.ini
basebuilder-plugins.ini

clasico-config.cfg
clasico-maps.ini
clasico-plugins.ini

deathrace-config.cfg
deathrace-maps.ini
deathrace-plugins.ini

deathrun-config.cfg
deathrun-maps.ini
deathrun-plugins.ini

lamancha-config.cfg
lamancha-maps.ini
lamancha-plugins.ini

recamara-config.cfg
recamara-maps.ini
recamara-plugins.ini

surf-config.cfg
surf-maps.ini
surf-plugins.ini

thehidden-config.cfg
thehidden-maps.ini
thehidden-plugins.ini

zombieescape-config.cfg
zombieescape-maps.ini
zombieescape-plugins.ini

multimod.sma v2.2
Código PHP:
/*

--- multimod.ini ---
[Gun Game]:[gungame-plugins.ini]:[gungame-config.cfg]
[Paint Ball]:[paintball-plugins.ini]:[paintball-config.cfg]
[Hid'N Seek]:[hns-plugins.ini]:[hns-config.cfg]
[Death Run]:[deathrun-plugins.ini]:[deathrun-config.cfg]
[Zombie Plague]:[zombieplague-plugins.ini]:[zombieplague-config.cfg]
[Biohazard]:[biohazard-plugins.ini]:[biohazard-config.cfg]
--------------------

TODO
* add some commands for admins

v0.1
* The very first release
v0.2
* Fixed warning 204 with one unused symbol
v0.3
* Fixed wrong use of cvar amx_nextmod instead of amx_mm_nextmod
* Added admin command amx_votemod
v0.4
* Added hud message every 15 seconds to display current mod name
* Added check for connected players before mod votting
* Added control to remove task avoiding duplicate amx_votemod commands
v0.5
* Added say nextmod command
* Added say /votemod command
* Execute cfg files in first round instead of game_commencing
v0.6
* Added multilangual support (thanks crazyeffect!)
* Added intermission at map change to show scoreboard
* Added timer to execute *.cfg
* Modified where I do sv_restart
* Deleted unused cvar amx_mm_nextmap
* Changed cvar amx_mm_nextmod to amx_nextmod
v0.8
* Added 30 seconds of warmup to avoid conflict/crash with other plugins
* Changed all cvars to amx_xxx format (removed _mm_ part)
* Fixed and improved pcvar usage
v2.0
* Removed a lot of code
* Removed map voting code
* Added compatibility with galileo
* Added semi-compatibility with mapchooser (requires mapchooser patch)
v2.1
* Tested under czero
* Fixed all issues with languaje change
* Pending tests withing Galileo
v2.2
* Fixed votemod DoS
* Fixed galileo plugin lookup problem
* Fixed mapchooser_multimod plugin lookup problem
* Fixed nextmod client command problem
* Added currentmod client command
* Added cvar to disallow votemod client command

Credits:

fysiks: The first to realize the idea and some code improvements
crazyeffect: Colaborate with multilangual support
dark vador 008: Time and server for testing under czero

*/

#include <amxmodx>
#include <amxmisc>

#define PLUGIN_NAME    "MultiMod Manager"
#define PLUGIN_AUTHOR    "JoRoPiTo"
#define PLUGIN_VERSION    "2.2"

#define AMX_MULTIMOD    "amx_multimod"
#define AMX_PLUGINS    "amxx_plugins"
#define AMX_MAPCYCLE    "mapcyclefile"
#define AMX_LASTCYCLE    "lastmapcycle"

#define AMX_DEFAULTCYCLE    "mapcycle.txt"
#define AMX_DEFAULTPLUGINS    "addons/amxmodx/configs/plugins.ini"
#define    AMX_BASECONFDIR        "multimod"

#define TASK_VOTEMOD 2487002
#define TASK_CHVOMOD 2487004
#define MAXMODS 10
#define LSTRING 193
#define SSTRING 33

new g_menuname[] = "MENU NAME"
new g_votemodcount[MAXMODS]
new 
g_modnames[MAXMODS][SSTRING]    // Per-mod Mod Names
new g_filemaps[MAXMODS][LSTRING]    // Per-mod Maps Files
new g_fileplugins[MAXMODS][LSTRING]    // Per-mod Plugin Files

new g_fileconf[LSTRING]
new 
g_coloredmenus
new g_modcount = -1            // integer with configured mods count
new g_alreadyvoted
new gp_allowedvote
new g_nextmodid
new g_currentmodid
new g_multimod[SSTRING]
new 
g_nextmap[SSTRING]
new 
g_currentmod[SSTRING]
new 
g_confdir[LSTRING]

new 
gp_mintime
new gp_voteanswers
new gp_timelimit

new gp_mode
new gp_mapcyclefile

// galileo specific cvars
new gp_galileo_nommapfile
new gp_galileo_votemapfile

public plugin_init()
{
    new 
MenuName[63]

    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar("MultiModManager"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY)
    
register_dictionary("mapchooser.txt")
    
register_dictionary("multimod.txt")

    
    
gp_mode register_cvar("amx_multimod_mode""2")    // 0=auto ; 1=mapchooser ; 2=galileo
    
gp_mintime register_cvar("amx_mintime""15")
    
gp_allowedvote register_cvar("amx_multimod_voteallowed""0")

    
get_configsdir(g_confdircharsmax(g_confdir))

    
register_clcmd("amx_votemod""start_vote"ADMIN_MAP"Vote for the next mod")
    
register_clcmd("say nextmod""user_nextmod")
    
register_clcmd("say_team nextmod""user_nextmod")
    
register_clcmd("say currentmod""user_currentmod")
    
register_clcmd("say /votemod""user_votemod")
    
register_clcmd("say_team /votemod""user_votemod")

    
format(MenuNamecharsmax(MenuName), "%L"LANG_PLAYER"MM_VOTE")
    
register_menucmd(register_menuid(g_menuname), 1023"player_vote")
    
g_coloredmenus colored_menus()
}

public 
plugin_cfg()
{
    
gp_voteanswers get_cvar_pointer("amx_vote_answers")
    
gp_timelimit get_cvar_pointer("mp_timelimit")
    
gp_mapcyclefile get_cvar_pointer(AMX_MAPCYCLE)

    if(!
get_pcvar_num(gp_mode))
    {
        if(
find_plugin_byfile("mapchooser_multimod.amxx") != -1)
            
set_pcvar_num(gp_mode1)
        else if(
find_plugin_byfile("galileo.amxx") != -1)
            
set_pcvar_num(gp_mode2)
    }
    
get_localinfo(AMX_MULTIMODg_multimodcharsmax(g_multimod))
    
load_cfg()

    if(!
equal(g_currentmodg_multimod) || (g_multimod[0] == 0))
    {
        
set_multimod(0)
        
get_firstmap(0)
        
server_print("Server restart - First Run")
        
server_cmd("changelevel %s"g_nextmap)
    }
    else
    {
        
server_cmd("exec %s"g_fileconf)
    }
}

public 
load_cfg()
{
    new 
szData[LSTRING]
    new 
szFilename[LSTRING]

    
formatex(szFilenamecharsmax(szFilename), "%s/%s"AMX_BASECONFDIR"multimod.ini")

    new 
fopen(szFilename"rt")
    new 
szTemp[SSTRING],szModName[SSTRING], szTag[SSTRING], szCfg[SSTRING]
    while(!
feof(f)) {
        
fgets(fszDatacharsmax(szData))
        
trim(szData)
        if(!
szData[0] || szData[0] == ';' || (szData[0] == '/' && szData[1] == '/')) continue

        if(
szData[0] == '[') {
            
g_modcount++
            
replace_all(szDatacharsmax(szData), "[""")
            
replace_all(szDatacharsmax(szData), "]""")

            
strtok(szDataszModNamecharsmax(szModName), szTempcharsmax(szTemp), ':'0)
            
strtok(szTempszTagcharsmax(szTag), szCfgcharsmax(szCfg), ':'0)

            if(
equal(szModNameg_multimod)) {
                
formatex(g_fileconf192"%s/%s"AMX_BASECONFDIRszCfg)
                
copy(g_currentmodcharsmax(g_currentmod), szModName)
                
g_currentmodid g_modcount
                server_print
("[AMX MultiMod] %L"LANG_PLAYER"MM_WILL_BE"g_multimodszTagszCfg)
            }
            
formatex(g_modnames[g_modcount], 32"%s"szModName)
            
formatex(g_filemaps[g_modcount], 192"%s/%s-maps.ini"AMX_BASECONFDIRszTag)
            
formatex(g_fileplugins[g_modcount], 192"%s/%s-plugins.ini"AMX_BASECONFDIRszTag)
            
server_print("MOD Loaded: %s %s %s"g_modnames[g_modcount], g_filemaps[g_modcount], g_fileconf)
        }
    }
    
fclose(f)
    
set_task(10.0"check_task"TASK_VOTEMOD""0"b")
}

public 
get_firstmap(modid)
{
    new 
ilen

    
if(!file_exists(g_filemaps[modid]))
        
get_mapname(g_nextmapcharsmax(g_nextmap))
    else
        
read_file(g_filemaps[modid], 0g_nextmapcharsmax(g_nextmap), ilen)
}

public 
set_multimod(modid)
{
    
server_print("Setting multimod to %i - %s"modidg_modnames[modid])
    
set_localinfo("amx_multimod"g_modnames[modid])
    
server_cmd("localinfo amxx_plugins ^"^"")
    
server_cmd("localinfo lastmapcycle ^"^"")
    
set_localinfo(AMX_PLUGINSfile_exists(g_fileplugins[modid]) ? g_fileplugins[modid] : AMX_DEFAULTPLUGINS)
    
set_localinfo(AMX_LASTCYCLEfile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)
    
set_pcvar_string(gp_mapcyclefilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)


    switch(
get_pcvar_num(gp_mode))
    {
        case 
2:
        {
            if(
gp_galileo_nommapfile)
                
set_pcvar_string(gp_galileo_nommapfilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)

            if(
gp_galileo_votemapfile)
                
set_pcvar_string(gp_galileo_votemapfilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)
        }
        case 
1:
        {
            
callfunc_begin("plugin_init""mapchooser_multimod.amxx");
            
callfunc_end();
        }
    }
}

public 
check_task()
{
    new 
timeleft get_timeleft()
    if(
timeleft || timeleft 180)
        return

    
start_vote()
}

public 
start_vote()
{
    
g_alreadyvoted true
    remove_task
(TASK_VOTEMOD)
    
remove_task(TASK_CHVOMOD)

    new 
menu[512], mkeysi
    
new pos format(menu511g_coloredmenus "\y%L:\w^n^n" "%L:^n^n"LANG_PLAYER"MM_CHOOSE")

    for(
i=0i<= g_modcounti++) {
        
pos += format(menu[pos], 511"%d. %s^n"1g_modnames[i])
        
g_votemodcount[i] = 0
        mkeys 
|= (1<<i)
    }

    new 
szMenuName[63]
    
formatex(szMenuNamecharsmax(szMenuName), "%L"LANG_PLAYER"MM_VOTE")
    
server_print("show menu %s %s %i"menug_menunamemkeys)
    
show_menu(0mkeysmenu15g_menuname)
    
client_cmd(0"spk Gman/Gman_Choose2")

    
set_task(15.0"check_vote"TASK_CHVOMOD)
    return
}

public 
user_nextmod(id)
{
    
client_print(0print_chat"%L"LANG_PLAYER"MM_NEXTMOD"g_modnames[g_nextmodid])
    return 
PLUGIN_HANDLED
}

public 
user_currentmod(id)
{
    
client_print(0print_chat"%L"LANG_PLAYER"MM_NEXTMOD"g_currentmod)
    return 
PLUGIN_HANDLED
}

public 
user_votemod(id)
{
    if(
gp_allowedvote)
        return 
PLUGIN_HANDLED

    
if(g_alreadyvoted)
    {
        
client_print(0print_chat"%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[g_nextmodid])
        return 
PLUGIN_HANDLED
    
}

    new 
Float:elapsedTime get_pcvar_float(gp_timelimit) - (float(get_timeleft()) / 60.0)
    new 
Float:minTime
    minTime 
get_pcvar_float(gp_mintime)

    if(
elapsedTime minTime) {
        
client_print(0print_chat"[AMX MultiMod] %L"LANG_PLAYER"MM_PL_WAIT"floatround(minTime elapsedTimefloatround_ceil))
        return 
PLUGIN_HANDLED
    
}

    new 
timeleft get_timeleft()
    if(
timeleft 180)
        return 
PLUGIN_HANDLED

    start_vote
()
    return 
PLUGIN_HANDLED
}

public 
player_vote(idkey)
{
    if(
key <= g_modcount)
    {
        if(
get_pcvar_num(gp_voteanswers))
        {
            new 
player[SSTRING]
            
get_user_name(idplayercharsmax(player))
            
client_print(0print_chat"%L"LANG_PLAYER"X_CHOSE_X"playerg_modnames[key])
        }
        
g_votemodcount[key]++
    }
}

public 
check_vote()
{
    new 
0
    
for(new 0<= g_modcounta++)
        if(
g_votemodcount[b] < g_votemodcount[a]) a

    client_print
(0print_chat"%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[b])
    
server_print("%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[b])
    if(
!= g_currentmodid)
        
set_multimod(b)

    
callfunc_begin("doVoteNextmap""mapchooser_multimod.amxx");
    
callfunc_end();
    
g_nextmodid b

Responder
#2
Fijate si te sirve mi comentario, y si tenes bien colocado todo (es una referencia a un multimod q hice y funcionaba con ese mismo)

(14/01/2020, 06:00 PM)Pan Bimbo (? escribió: Si te pusieras a leer un poco, y no hacer las cosas alpedo... (me paso en su dia y me puse a leer, se ve que no lees nada ni investigas, un inútil total) (ando enojado x otra cosa asi que el post va asi con puteos etc, al fin al cabo te sirve)

Multimod.ini: (ejemplo) (amxmodx/configs)
Cita:; Multi Mod Manager - Archivos

multimod/thehidden-maps.ini
multimod/thehidden-plugins.ini

multimod/soccerjam-maps.ini
multimod/soccerjam-plugins.ini

multimod/plantitaslocas-maps.ini
multimod/plantitaslocas-plugins.ini

multimod/paintball-maps.ini
multimod/paintball-plugins.ini

multimod/oneinthechamber-maps.ini
multimod/oneinthechamber-plugins.ini

multimod/dodgeball-maps.ini
multimod/dodgeball-plugins.ini

multimod/deathrace-maps.ini
multimod/deathrace-plugins.ini

multimod/arenamod-maps.ini
multimod/arenamod-plugins.ini

Archivos en amxmodx/configs/multimod:
[Imagen: mslzgLX8Rv_Fse1ex_Vl-A.png]

Contenido de alguno:
-arenamod-maps.ini:
Cita:; Multi Mod Manager (Configuraciones)
; Arena MOD - MAPS

am_ramp
am_glass
am_dust
am_colors
amx_boxes

-arenamod-plugins.ini:
Cita:; Multi Mod Manager (Configuraciones)
; Arena MOD - Plugins

adv_vault.amxx debug
round_terminator.amxx debug

th_main.amxx debug
th_heatvision.amxx debug
th_hidden_nade.amxx debug
th_hudinfo.amxx debug
th_mapfix.amxx debug
th_objective_remover.amxx debug
th_replacements.amxx debug
th_round_winner.amxx debug
th_software.amxx debug
th_sonicmine.amxx debug
th_sounds.amxx debug
th_team_management.amxx debug
th_weapon_menu.amxx debug
Responder
#3
(20/03/2020, 09:51 PM)Pan Bimbo (? escribió: Fijate si te sirve mi comentario, y si tenes bien colocado todo (es una referencia a un multimod q hice y funcionaba con ese mismo)

(14/01/2020, 06:00 PM)Pan Bimbo (? escribió: Si te pusieras a leer un poco, y no hacer las cosas alpedo... (me paso en su dia y me puse a leer, se ve que no lees nada ni investigas, un inútil total) (ando enojado x otra cosa asi que el post va asi con puteos etc, al fin al cabo te sirve)

Multimod.ini: (ejemplo) (amxmodx/configs)
Cita:; Multi Mod Manager - Archivos

multimod/thehidden-maps.ini
multimod/thehidden-plugins.ini

multimod/soccerjam-maps.ini
multimod/soccerjam-plugins.ini

multimod/plantitaslocas-maps.ini
multimod/plantitaslocas-plugins.ini

multimod/paintball-maps.ini
multimod/paintball-plugins.ini

multimod/oneinthechamber-maps.ini
multimod/oneinthechamber-plugins.ini

multimod/dodgeball-maps.ini
multimod/dodgeball-plugins.ini

multimod/deathrace-maps.ini
multimod/deathrace-plugins.ini

multimod/arenamod-maps.ini
multimod/arenamod-plugins.ini

Archivos en amxmodx/configs/multimod:
[Imagen: mslzgLX8Rv_Fse1ex_Vl-A.png]

Contenido de alguno:
-arenamod-maps.ini:
Cita:; Multi Mod Manager (Configuraciones)
; Arena MOD - MAPS

am_ramp
am_glass
am_dust
am_colors
amx_boxes

-arenamod-plugins.ini:
Cita:; Multi Mod Manager (Configuraciones)
; Arena MOD - Plugins

adv_vault.amxx debug
round_terminator.amxx debug

th_main.amxx debug
th_heatvision.amxx debug
th_hidden_nade.amxx debug
th_hudinfo.amxx debug
th_mapfix.amxx debug
th_objective_remover.amxx debug
th_replacements.amxx debug
th_round_winner.amxx debug
th_software.amxx debug
th_sonicmine.amxx debug
th_sounds.amxx debug
th_team_management.amxx debug
th_weapon_menu.amxx debug

no sirve al hacer eso me sale esto

Server restart - First Run
Server restart - First Run
Server restart - First Run
Server restart - First Run
Server restart - First Run
Server restart - First Run
Server restart - First Run
Responder
#4
Si no pasas plugins.ini ni logs ni lo que contiene los files ni nada no puedo hacer magia capo
Responder
#5
Yo creo q te estas basando en otro plugin yo uso otro el MultiMod v2.2

me dices que lo ponga en amxmodx/configs pero el mismo plugin sale en raiz/cstrike/multimod

diria que lo veas otra vez...

Código PHP:
#define    AMX_BASECONFDIR        "multimod"
public load_cfg()
{
    new 
szData[LSTRING]
    new 
szFilename[LSTRING]

    
formatex(szFilenamecharsmax(szFilename), "%s/%s"AMX_BASECONFDIR"multimod.ini")

    new 
fopen(szFilename"rt")
    new 
szTemp[SSTRING],szModName[SSTRING], szTag[SSTRING], szCfg[SSTRING]
    while(!
feof(f)) {
        
fgets(fszDatacharsmax(szData))
        
trim(szData)
        if(!
szData[0] || szData[0] == ';' || (szData[0] == '/' && szData[1] == '/')) continue

        if(
szData[0] == '[') {
            
g_modcount++
            
replace_all(szDatacharsmax(szData), "[""")
            
replace_all(szDatacharsmax(szData), "]""")

            
strtok(szDataszModNamecharsmax(szModName), szTempcharsmax(szTemp), ':'0)
            
strtok(szTempszTagcharsmax(szTag), szCfgcharsmax(szCfg), ':'0)

            if(
equal(szModNameg_multimod)) {
                
formatex(g_fileconf192"%s/%s"AMX_BASECONFDIRszCfg)
                
copy(g_currentmodcharsmax(g_currentmod), szModName)
                
g_currentmodid g_modcount
                server_print
("[AMX MultiMod] %L"LANG_PLAYER"MM_WILL_BE"g_multimodszTagszCfg)
            }
            
formatex(g_modnames[g_modcount], 32"%s"szModName)
            
formatex(g_filemaps[g_modcount], 192"%s/%s-maps.ini"AMX_BASECONFDIRszTag)
            
formatex(g_fileplugins[g_modcount], 192"%s/%s-plugins.ini"AMX_BASECONFDIRszTag)
            
server_print("MOD Loaded: %s %s %s"g_modnames[g_modcount], g_filemaps[g_modcount], g_fileconf)
        }
    }
    
fclose(f)
    
set_task(10.0"check_task"TASK_VOTEMOD""0"b")



Código PHP:
/*

--- multimod.ini ---
[Gun Game]:[gungame-plugins.ini]:[gungame-config.cfg]
[Paint Ball]:[paintball-plugins.ini]:[paintball-config.cfg]
[Hid'N Seek]:[hns-plugins.ini]:[hns-config.cfg]
[Death Run]:[deathrun-plugins.ini]:[deathrun-config.cfg]
[Zombie Plague]:[zombieplague-plugins.ini]:[zombieplague-config.cfg]
[Biohazard]:[biohazard-plugins.ini]:[biohazard-config.cfg]
--------------------

TODO
* add some commands for admins

v0.1
* The very first release
v0.2
* Fixed warning 204 with one unused symbol
v0.3
* Fixed wrong use of cvar amx_nextmod instead of amx_mm_nextmod
* Added admin command amx_votemod
v0.4
* Added hud message every 15 seconds to display current mod name
* Added check for connected players before mod votting
* Added control to remove task avoiding duplicate amx_votemod commands
v0.5
* Added say nextmod command
* Added say /votemod command
* Execute cfg files in first round instead of game_commencing
v0.6
* Added multilangual support (thanks crazyeffect!)
* Added intermission at map change to show scoreboard
* Added timer to execute *.cfg
* Modified where I do sv_restart
* Deleted unused cvar amx_mm_nextmap
* Changed cvar amx_mm_nextmod to amx_nextmod
v0.8
* Added 30 seconds of warmup to avoid conflict/crash with other plugins
* Changed all cvars to amx_xxx format (removed _mm_ part)
* Fixed and improved pcvar usage
v2.0
* Removed a lot of code
* Removed map voting code
* Added compatibility with galileo
* Added semi-compatibility with mapchooser (requires mapchooser patch)
v2.1
* Tested under czero
* Fixed all issues with languaje change
* Pending tests withing Galileo
v2.2
* Fixed votemod DoS
* Fixed galileo plugin lookup problem
* Fixed mapchooser_multimod plugin lookup problem
* Fixed nextmod client command problem
* Added currentmod client command
* Added cvar to disallow votemod client command

Credits:

fysiks: The first to realize the idea and some code improvements
crazyeffect: Colaborate with multilangual support
dark vador 008: Time and server for testing under czero

*/

#include <amxmodx>
#include <amxmisc>

#define PLUGIN_NAME    "MultiMod Manager"
#define PLUGIN_AUTHOR    "JoRoPiTo"
#define PLUGIN_VERSION    "2.2"

#define AMX_MULTIMOD    "amx_multimod"
#define AMX_PLUGINS    "amxx_plugins"
#define AMX_MAPCYCLE    "mapcyclefile"
#define AMX_LASTCYCLE    "lastmapcycle"

#define AMX_DEFAULTCYCLE    "mapcycle.txt"
#define AMX_DEFAULTPLUGINS    "addons/amxmodx/configs/plugins.ini"
#define    AMX_BASECONFDIR        "multimod"

#define TASK_VOTEMOD 2487002
#define TASK_CHVOMOD 2487004
#define MAXMODS 10
#define LSTRING 193
#define SSTRING 33

new g_menuname[] = "MENU NAME"
new g_votemodcount[MAXMODS]
new 
g_modnames[MAXMODS][SSTRING]    // Per-mod Mod Names
new g_filemaps[MAXMODS][LSTRING]    // Per-mod Maps Files
new g_fileplugins[MAXMODS][LSTRING]    // Per-mod Plugin Files

new g_fileconf[LSTRING]
new 
g_coloredmenus
new g_modcount = -1            // integer with configured mods count
new g_alreadyvoted
new gp_allowedvote
new g_nextmodid
new g_currentmodid
new g_multimod[SSTRING]
new 
g_nextmap[SSTRING]
new 
g_currentmod[SSTRING]
new 
g_confdir[LSTRING]

new 
gp_mintime
new gp_voteanswers
new gp_timelimit

new gp_mode
new gp_mapcyclefile

// galileo specific cvars
new gp_galileo_nommapfile
new gp_galileo_votemapfile

public plugin_init()
{
    new 
MenuName[63]

    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar("MultiModManager"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY)
    
register_dictionary("mapchooser.txt")
    
register_dictionary("multimod.txt")

    
    
gp_mode register_cvar("amx_multimod_mode""0")    // 0=auto ; 1=mapchooser ; 2=galileo
    
gp_mintime register_cvar("amx_mintime""15")
    
gp_allowedvote register_cvar("amx_multimod_voteallowed""1")

    
get_configsdir(g_confdircharsmax(g_confdir))

    
register_clcmd("amx_votemod""start_vote"ADMIN_MAP"Vote for the next mod")
    
register_clcmd("say nextmod""user_nextmod")
    
register_clcmd("say_team nextmod""user_nextmod")
    
register_clcmd("say currentmod""user_currentmod")
    
register_clcmd("say /votemod""user_votemod")
    
register_clcmd("say_team /votemod""user_votemod")

    
format(MenuNamecharsmax(MenuName), "%L"LANG_PLAYER"MM_VOTE")
    
register_menucmd(register_menuid(g_menuname), 1023"player_vote")
    
g_coloredmenus colored_menus()
}

public 
plugin_cfg()
{
    
gp_voteanswers get_cvar_pointer("amx_vote_answers")
    
gp_timelimit get_cvar_pointer("mp_timelimit")
    
gp_mapcyclefile get_cvar_pointer(AMX_MAPCYCLE)

    if(!
get_pcvar_num(gp_mode))
    {
        if(
find_plugin_byfile("mapchooser_multimod.amxx") != -1)
            
set_pcvar_num(gp_mode1)
        else if(
find_plugin_byfile("galileo.amxx") != -1)
            
set_pcvar_num(gp_mode2)
    }
    
get_localinfo(AMX_MULTIMODg_multimodcharsmax(g_multimod))
    
load_cfg()

    if(!
equal(g_currentmodg_multimod) || (g_multimod[0] == 0))
    {
        
set_multimod(0)
        
get_firstmap(0)
        
server_print("Server restart - First Run")
        
server_cmd("changelevel %s"g_nextmap)
    }
    else
    {
        
server_cmd("exec %s"g_fileconf)
    }
}

public 
load_cfg()
{
    new 
szData[LSTRING]
    new 
szFilename[LSTRING]

    
formatex(szFilenamecharsmax(szFilename), "%s/%s"AMX_BASECONFDIR"multimod.ini")

    new 
fopen(szFilename"rt")
    new 
szTemp[SSTRING],szModName[SSTRING], szTag[SSTRING], szCfg[SSTRING]
    while(!
feof(f)) {
        
fgets(fszDatacharsmax(szData))
        
trim(szData)
        if(!
szData[0] || szData[0] == ';' || (szData[0] == '/' && szData[1] == '/')) continue

        if(
szData[0] == '[') {
            
g_modcount++
            
replace_all(szDatacharsmax(szData), "[""")
            
replace_all(szDatacharsmax(szData), "]""")

            
strtok(szDataszModNamecharsmax(szModName), szTempcharsmax(szTemp), ':'0)
            
strtok(szTempszTagcharsmax(szTag), szCfgcharsmax(szCfg), ':'0)

            if(
equal(szModNameg_multimod)) {
                
formatex(g_fileconf192"%s/%s"AMX_BASECONFDIRszCfg)
                
copy(g_currentmodcharsmax(g_currentmod), szModName)
                
g_currentmodid g_modcount
                server_print
("[AMX MultiMod] %L"LANG_PLAYER"MM_WILL_BE"g_multimodszTagszCfg)
            }
            
formatex(g_modnames[g_modcount], 32"%s"szModName)
            
formatex(g_filemaps[g_modcount], 192"%s/%s-maps.ini"AMX_BASECONFDIRszTag)
            
formatex(g_fileplugins[g_modcount], 192"%s/%s-plugins.ini"AMX_BASECONFDIRszTag)
            
server_print("MOD Loaded: %s %s %s"g_modnames[g_modcount], g_filemaps[g_modcount], g_fileconf)
        }
    }
    
fclose(f)
    
set_task(10.0"check_task"TASK_VOTEMOD""0"b")
}

public 
get_firstmap(modid)
{
    new 
ilen

    
if(!file_exists(g_filemaps[modid]))
        
get_mapname(g_nextmapcharsmax(g_nextmap))
    else
        
read_file(g_filemaps[modid], 0g_nextmapcharsmax(g_nextmap), ilen)
}

public 
set_multimod(modid)
{
    
server_print("Setting multimod to %i - %s"modidg_modnames[modid])
    
set_localinfo("amx_multimod"g_modnames[modid])
    
server_cmd("localinfo amxx_plugins ^"^"")
    
server_cmd("localinfo lastmapcycle ^"^"")
    
set_localinfo(AMX_PLUGINSfile_exists(g_fileplugins[modid]) ? g_fileplugins[modid] : AMX_DEFAULTPLUGINS)
    
set_localinfo(AMX_LASTCYCLEfile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)
    
set_pcvar_string(gp_mapcyclefilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)


    switch(
get_pcvar_num(gp_mode))
    {
        case 
2:
        {
            if(
gp_galileo_nommapfile)
                
set_pcvar_string(gp_galileo_nommapfilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)

            if(
gp_galileo_votemapfile)
                
set_pcvar_string(gp_galileo_votemapfilefile_exists(g_filemaps[modid]) ? g_filemaps[modid] : AMX_DEFAULTCYCLE)
        }
        case 
1:
        {
            
callfunc_begin("plugin_init""mapchooser_multimod.amxx");
            
callfunc_end();
        }
    }
}

public 
check_task()
{
    new 
timeleft get_timeleft()
    if(
timeleft || timeleft 180)
        return

    
start_vote()
}

public 
start_vote()
{
    
g_alreadyvoted true
    remove_task
(TASK_VOTEMOD)
    
remove_task(TASK_CHVOMOD)

    new 
menu[512], mkeysi
    
new pos format(menu511g_coloredmenus "\y%L:\w^n^n" "%L:^n^n"LANG_PLAYER"MM_CHOOSE")

    for(
i=0i<= g_modcounti++) {
        
pos += format(menu[pos], 511"%d. %s^n"1g_modnames[i])
        
g_votemodcount[i] = 0
        mkeys 
|= (1<<i)
    }

    new 
szMenuName[63]
    
formatex(szMenuNamecharsmax(szMenuName), "%L"LANG_PLAYER"MM_VOTE")
    
server_print("show menu %s %s %i"menug_menunamemkeys)
    
show_menu(0mkeysmenu15g_menuname)
    
client_cmd(0"spk Gman/Gman_Choose2")

    
set_task(15.0"check_vote"TASK_CHVOMOD)
    return
}

public 
user_nextmod(id)
{
    
client_print(0print_chat"%L"LANG_PLAYER"MM_NEXTMOD"g_modnames[g_nextmodid])
    return 
PLUGIN_HANDLED
}

public 
user_currentmod(id)
{
    
client_print(0print_chat"%L"LANG_PLAYER"MM_NEXTMOD"g_currentmod)
    return 
PLUGIN_HANDLED
}

public 
user_votemod(id)
{
    if(
gp_allowedvote)
        return 
PLUGIN_HANDLED

    
if(g_alreadyvoted)
    {
        
client_print(0print_chat"%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[g_nextmodid])
        return 
PLUGIN_HANDLED
    
}

    new 
Float:elapsedTime get_pcvar_float(gp_timelimit) - (float(get_timeleft()) / 60.0)
    new 
Float:minTime
    minTime 
get_pcvar_float(gp_mintime)

    if(
elapsedTime minTime) {
        
client_print(0print_chat"[AMX MultiMod] %L"LANG_PLAYER"MM_PL_WAIT"floatround(minTime elapsedTimefloatround_ceil))
        return 
PLUGIN_HANDLED
    
}

    new 
timeleft get_timeleft()
    if(
timeleft 180)
        return 
PLUGIN_HANDLED

    start_vote
()
    return 
PLUGIN_HANDLED
}

public 
player_vote(idkey)
{
    if(
key <= g_modcount)
    {
        if(
get_pcvar_num(gp_voteanswers))
        {
            new 
player[SSTRING]
            
get_user_name(idplayercharsmax(player))
            
client_print(0print_chat"%L"LANG_PLAYER"X_CHOSE_X"playerg_modnames[key])
        }
        
g_votemodcount[key]++
    }
}

public 
check_vote()
{
    new 
0
    
for(new 0<= g_modcounta++)
        if(
g_votemodcount[b] < g_votemodcount[a]) a

    client_print
(0print_chat"%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[b])
    
server_print("%L"LANG_PLAYER"MM_VOTEMOD"g_modnames[b])
    if(
!= g_currentmodid)
        
set_multimod(b)

    
callfunc_begin("doVoteNextmap""mapchooser_multimod.amxx");
    
callfunc_end();
    
g_nextmodid b


plugins.ini
Código:
; AMX Mod X plugins

; Admin Base - Always one has to be activated
admin.amxx        ; admin base (required for any admin-related)
;admin_sql.amxx        ; admin base - SQL version (comment admin.amxx)

; Basic
admincmd.amxx        ; basic admin console commands
adminhelp.amxx        ; help command for admin console commands
adminslots.amxx        ; slot reservation
multilingual.amxx    ; Multi-Lingual management

; Menus
menufront.amxx        ; front-end for admin menus
cmdmenu.amxx        ; command menu (speech, settings)
plmenu.amxx        ; players menu (kick, ban, client cmds.)
telemenu.amxx        ; teleport menu (Fun Module required!)
mapsmenu.amxx        ; maps menu (vote, changelevel)
pluginmenu.amxx        ; Menus for commands/cvars organized by plugin

; Chat / Messages
adminchat.amxx        ; console chat commands
antiflood.amxx        ; prevent clients from chat-flooding the server
scrollmsg.amxx        ; displays a scrolling message
imessage.amxx        ; displays information messages
adminvote.amxx        ; vote commands

; Map related
nextmap.amxx        ; displays next map in mapcycle
;mapchooser.amxx        ; allows to vote for next map
timeleft.amxx        ; displays time left on map

; Configuration
pausecfg.amxx        ; allows to pause and unpause some plugins
statscfg.amxx        ; allows to manage stats plugins via menu and commands

; Counter-Strike
restmenu.amxx        ; restrict weapons menu
statsx.amxx        ; stats on death or round end (CSX Module required!)
;miscstats.amxx        ; bunch of events announcement for Counter-Strike
;stats_logging.amxx    ; weapons stats logging (CSX Module required!)

allchat.amxx

mapchooser_multimod.amxx debug
multimod.amxx debug

log1
Código:
L 03/21/2020 - 12:35:13: -------- Mapchange to de_dust2 --------
L 03/21/2020 - 12:35:15: -------- Mapchange to cs_assault --------

log2
Código:
L 03/21/2020 - 12:39:30: Log file started (file "logs\L0321000.log") (game "cstrike") (version "48/1.1.2.7/Stdio/1935")
L 03/21/2020 - 12:39:38: World triggered "Round_Start"
L 03/21/2020 - 12:39:42: [META] ini: Begin re-reading plugins list: g:/counter-strike 1.6/servidores/cstrike/4/cstrike/addons/metamod/plugins.ini
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: SafeNameAndChat
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: Reunion
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: ReAuthCheck
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: Rechecker
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: Revoice
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: AMX Mod X
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: WHBlocker
L 03/21/2020 - 12:39:42: [META] ini: Read plugin config for: ReSemiclip
L 03/21/2020 - 12:39:42: [META] ini: Finished reading plugins list: g:/counter-strike 1.6/servidores/cstrike/4/cstrike/addons/metamod/plugins.ini; Found 8 plugins
L 03/21/2020 - 12:39:42: [META] dll: Updating plugins...
L 03/21/2020 - 12:39:42: [META] dll: Finished updating 14 plugins; kept 8, loaded 0, unloaded 0, reloaded 0, delayed 0
L 03/21/2020 - 12:39:42: [META] dll: Rebuilding callbacks...
L 03/21/2020 - 12:39:42: [META] dll: Callbacks rebuilded.
L 03/21/2020 - 12:39:42: Server shutdown
L 03/21/2020 - 12:39:42: Log file closed

lamancha-plugins.ini
Código:
freeze-tag-bugfix.amxx

   
Responder
#6
Cuando dejes de hablar alpedo y pruebes te vas a dar cuenta
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)