Multimod Manager
#1
Saludos.

Alguno tiene la mas minima idea de como instalar este plugin
MultiMod Extended
Código PHP:
#include <amxmodx>
#include <amxmisc>

#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        "addons/amxmodx/configs/multimod"

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

#define VM_FLAG        ADMIN_MAP // votemod flag
#define NMM_FLAG    ADMIN_MAP // nextmod menu flag
#define CM_FLAG        ADMIN_MAP // cancel mod flag
#define BMM_FLAG    ADMIN_MAP // block mods menu flag

#define COLOR         BLUE

new sPrefix[]= "[CSD]";    // Prefix for messages
new sMenuPrefix[]= "CSDudes";    // Menu Prefix

new bool:g_rockedVote[33], g_rockedVoteCnt;
new 
bool:g_hasbeenrocked false;
new 
bool:nextmodchosed false;
new 
bool:modnexted false;

new 
g_votemodcount[MAXMODS];
new 
g_modnames[MAXMODS][SSTRING];
new 
g_filemaps[MAXMODS][LSTRING];
new 
g_fileplugins[MAXMODS][LSTRING];

new 
g_fileconf[LSTRING];
new 
g_modcount = -1;
new 
g_nextmodid;
new 
g_currentmodid;
new 
g_multimod[SSTRING];
new 
g_nextmap[SSTRING];
new 
g_currentmod[SSTRING];
new 
g_confdir[LSTRING];

new 
cvar_rtv_ratio;
new 
g_blockedmod[LSTRING] = -1;

new 
gp_mode;
new 
gp_mapcyclefile;
new 
bool:countdownrun false;

// galileo specific cvars
new gp_galileo_nommapfile;
new 
gp_galileo_votemapfile;

// ColorChat
enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}

public 
plugin_init( )
{
    new 
MenuName[63];

    
register_plugin("MultiMod Manager""3.0""JoRoPiTo");
    
register_cvar("MultiModManager""3.0"FCVAR_SERVER|FCVAR_SPONLY);
    
    
gp_mode register_cvar("amx_multimod_mode""1");    // 0=auto ; 1=mapchooser ; 2=galileo
    
register_cvar("amx_mintime""10");
    
register_cvar("amx_multimod_voteallowed""0");
    
cvar_rtv_ratio register_cvar("rtv_ratio""0.51");
    
register_dictionary"multimod_ml.txt" );

    
get_configsdir(g_confdircharsmax(g_confdir));

    
register_clcmd("amx_votemod""start_vote"VM_FLAG"Vote for the next mod");
    
// register_clcmd("amx_nextmodmenu", "setmodmenu", NMM_FLAG, "- Menu for the NextMod");
    // register_clcmd("amx_cancelmod", "cancelmod", CM_FLAG, "- cancel the nextmod ( amx_nextmodmenu )");
    // register_clcmd("amx_blockmodmenu", "blockmenu", BMM_FLAG, "- Menu to Block Mods");
    
register_clcmd("say /mm_menu""mmmenu");
    
register_clcmd("say /mods""mods");
    
    
register_clcmd("say nextmod""user_nextmod");
    
register_clcmd("say_team nextmod""user_nextmod");
    
register_clcmd("say currentmod""user_currentmod");
    
register_clcmd("say_team currentmod""user_currentmod");
    
    
register_clcmd("say rtv""cmdSayRTV");
    
register_clcmd("say rtvm""cmdSayRTV");
    
register_clcmd("say_team rtv""cmdSayRTV");
    
register_clcmd("say_team rtvm""cmdSayRTV");
    
    
format(MenuNamecharsmax(MenuName), "Vote Nextmod");
}

public 
modsid )
{
    
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_CHECK_CONSOLE"sPrefix);
    
    
console_print(id"======= %L ======="LANG_PLAYER"MM_AVAILABLEMODS");
    
    for(new 
<= g_modcount i++)
    {
        if(
== g_currentmodid)
        {
            
console_print(id"%d.%s %L"1g_modnames[i], LANG_PLAYER"MM_CURRENTMOD");
        }
        else
        {
            
console_print(id== g_blockedmod[i] ? "%d.%s %L" "%d.%s"1g_modnames[i], LANG_PLAYER"MM_BLOCKED");
        }
    }
    
    
console_print(id"=========================");
}

public 
client_connectid )
{
    
g_rockedVote[id] = false;
}

public 
client_disconnectedid )
{
    if(
g_rockedVote[id])
    {
        
g_rockedVote[id] = false;
        
g_rockedVoteCnt--;
    }
}

public 
plugin_cfg( )
{
    
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("%L"LANG_SERVER"MM_FIRSTRUN");
        
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("%s Selected mod will be: %s (%s:%s)"sPrefixg_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("%L %s %s %s"LANG_SERVER"MM_MODLOADED"g_modnames[g_modcount], g_filemaps[g_modcount], g_fileconf);
        }
    }
    
fclose(f);
    
set_task(10.0"check_task"TASK_VOTEMOD""0"b");
}

public 
get_firstmapmodid )
{
    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_multimodmodid )
{
    
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( )
{
    if(!
g_hasbeenrocked)
    {
        if(!
countdownrun)
        {
            if(
get_timeleft() > && get_timeleft() < 195)
            {
                
set_task(1.0"votecountdown"___"a"15);
                
set_task(16.0"start_vote");
            }
        }
    }
    else
    {
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
votecountdown( )
{
    static 
countdown 15;

    
set_hudmessage(022250, -1.00.1301.00.940.00.0, -1);
    
show_hudmessage(0"%L"LANG_PLAYER"MM_COUNTDOWN"modnexted "Map" "Mod"countdown);
    
countdownrun true;
    
    
countdown--;
}

public 
mmmenuid )
{
    new 
title[512];
    
format(title511"%L"LANG_PLAYER"MM_MMMENU"sMenuPrefix);
    new 
menu menu_create(title"mm_handler");
    new 
callback menu_makecallback("mmcallback");
    
    new 
blockmods[512]
    
format(blockmods511"%L"LANG_PLAYER"MM_BLOCKMODS")
    
menu_additem(menublockmods);
    
    new 
choosenextmod[512]
    
format(choosenextmod511"%L"LANG_PLAYER"MM_CHOOSENEXTMOD");
    
menu_additem(menuchoosenextmod);
    
    new 
menucancelmod[512]
    
format(menucancelmod511"%L"LANG_PLAYER"MM_CANCELNEXTMOD" );
    
    
menu_additem(menumenucancelmod""_callback);
    
    
menu_display(idmenu0);
}

public 
mm_handleridmenuitem )
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        case 
0:
        {
            
blockmenu(id);
        }
        case 
1:
        {
            
setmodmenu(id);
        }
        case 
2:
        {
            
cancelmod(id);
        }
    }
    
    return 
PLUGIN_HANDLED;
}

public 
mmcallbackidmenuitem )
{
    static 
_accessinfo[4], callback;
    
menu_item_getinfo(menuitem_accessinfosizeof(info) - 1__callback);
    
    if( !
modnexted )
    {
        return 
ITEM_DISABLED;
    }
    if( 
g_hasbeenrocked )
    {
        return 
ITEM_DISABLED;
    }

    return 
ITEM_ENABLED;
}

public 
start_voteidlevelcid )
{
    if(!
cmd_accessidlevelcid))
        return 
PLUGIN_HANDLED;
    
    if( 
g_hasbeenrocked )
    {
        
console_print(id"%L"LANG_PLAYER"MM_VOTEMODSTARTED");
        return 
PLUGIN_HANDLED;
    }
    
    if( 
modnexted )
    {
        
g_hasbeenrocked true;
        
        
callfunc_begin("doVoteNextmap""mapchooser_multimod.amxx");
        
callfunc_end();
        
        if( 
id != )
        {
            new 
sAdminName[32];
            
get_user_name(idsAdminName31);
            
ColorChat(0COLOR"%L"LANG_PLAYER"MM_STARTEDVOTEMAPS"sAdminNameg_modnames[g_nextmodid]);
        }
    }
    else
    {
        
g_hasbeenrocked true;
        
        if( 
id != )
        {
            new 
sAdminName[32];
            
get_user_name(idsAdminName31);
            
ColorChat(0COLOR"%L"LANG_PLAYER"MM_STARTEDVOTEMOD"sAdminName);
        }
        
        
remove_task(TASK_VOTEMOD);
        
remove_task(TASK_CHVOMOD);
        
        new 
choosethenextmod[512]
        
formatchoosethenextmod511"%L"LANG_PLAYER"MM_ITSTIMETOCHOOSE");
        
        new 
menu menu_create(choosethenextmod"vm_handler");
        new 
callback menu_makecallback("votemodcallback");
        
        for(new 
<= g_modcount i++) 
        {
            new 
curmodline[512];
            
format(curmodline511== g_currentmodid "%s %L" "%s"g_modnames[i], LANG_PLAYER"MM_CURRENTMOD");
            
menu_additem(menucurmodline""_callback);
        }
        
        new 
players[32], pnum;
        
get_players(playerspnum);
        
        for (new 
pnum i++)
        {
            new 
tempid players[i];
            
menu_display(tempidmenu0);
        }
        
        
client_cmd(0"spk Gman/Gman_Choose2");
        
        
set_task(15.0"check_vote"TASK_CHVOMOD);
        return 
PLUGIN_CONTINUE;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
user_nextmodid )
{
    if( 
nextmodchosed )
        
ColorChat(0COLOR"%L"LANG_PLAYER"MM_NEXTMODIS"sPrefixg_modnames[g_nextmodid]);
    else
        
ColorChat(0COLOR"%L"LANG_PLAYER"MM_NEXTMODSTILL"sPrefix);
}

public 
user_currentmodid )
{
    
ColorChat(0COLOR"%L"LANG_PLAYER"MM_CURRENTMODIS"sPrefixg_currentmod);
}

public 
vm_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    switch(
item)
    {
        default:
        {
            new 
player[SSTRING];
            
get_user_name(idplayercharsmax(player));
            if(
get_user_team(id) == 1)
            
ColorChat(0RED"%s ^1%L ^4%s"playerLANG_PLAYER"MM_CHOSE"g_modnames[item]);
            else if(
get_user_team(id) == 2)
            
ColorChat(0BLUE"%s ^1%L ^4%s"playerLANG_PLAYER"MM_CHOSE"g_modnames[item]);
            else
            
ColorChat(0GREY"%s ^1%L ^4%s"playerLANG_PLAYER"MM_CHOSE"g_modnames[item]);
        }
    }
    
    ++
g_votemodcount[item];
    
    
// this is destroying the menu for all players
    // menu_destroy(menu);
    
    
return PLUGIN_HANDLED;
}

public 
votemodcallbackidmenuitem )
{
    static 
_accessinfo[4], callback;
    
menu_item_getinfo(menuitem_accessinfosizeof(info) - 1__callback);
    
    if(
item == g_currentmodid)
    {
        return 
ITEM_DISABLED;
    }

    if(
item == g_blockedmod[item])
    {
        return 
ITEM_DISABLED;
    }
    
    return 
ITEM_ENABLED;
}

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

    
ColorChat(0COLOR"%L"LANG_PLAYER"MM_VOTINGFINISHED"sPrefixg_modnames[b]);
    
server_print("%L"LANG_SERVER"MM_VOTINGFINISHED_SERVER"g_modnames[b]);
    
set_multimod(b);

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

public 
setmodmenuid )
{
    new 
choosenextmod[512]
    
format(choosenextmod511"%L"LANG_PLAYER"MM_CHOOSENEXTMOD");
    new 
menu menu_create(choosenextmod"menu_handler");
    new 
callback menu_makecallback("setmodcallback");

    for(new 
<= g_modcount i++) 
    {
        if(
== g_currentmodid)
        {
            new 
curmodline[512];
            
format(curmodline511"%s %L"g_modnames[g_currentmodid], LANG_PLAYER"MM_CURRENTMOD");
            
menu_additem(menucurmodline""_callback);
        }
        else
        {
            if(
nextmodchosed)
            {
                new 
nexmodline[512];
                
format(nexmodline511== g_nextmodid "%s %L" "%s"g_modnames[i], LANG_PLAYER"MM_NEXTMOD");
                
menu_additem(menunexmodline""_callback);
            }
            else
            {
                new 
nexmodline[512];
                
format(nexmodline511"%s"g_modnames[i]);
                
menu_additem(menunexmodline""_callback);
            }
        }
    }
    
    
menu_display(idmenu0);
    return 
PLUGIN_CONTINUE;
}

public 
menu_handleridmenuitem )
{
    if(
item == MENU_EXIT)
    {
        
mmmenu(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    new 
sAdminName[32];
    
get_user_name(idsAdminName31);
    
    switch(
item)
    {
        default:
        {
            
ColorChat(0COLOR"%L"LANG_PLAYER"MM_ADMINCHOSENEXTMOD"sPrefixsAdminNameg_modnames[item]);
            
set_multimod(item);
            
modnexted true;
            
g_nextmodid item;
            
nextmodchosed true;
        }
    }
    
    
setmodmenu(id);

    return 
PLUGIN_HANDLED;
}

public 
setmodcallbackidmenuitem )
{
    static 
_accessinfo[4], callback;
    
menu_item_getinfo(menuitem_accessinfosizeof(info) - 1__callback);
    
    if( !( 
get_user_flagsid ) & NMM_FLAG ) )
    {
        return 
ITEM_DISABLED;
    }
    
    if( 
item == g_currentmodid )
    {
        return 
ITEM_DISABLED;
    }
    
    if( 
nextmodchosed && item == g_nextmodid )
    {
        return 
ITEM_DISABLED;
    }
    
    if( 
g_hasbeenrocked )
    {
        return 
ITEM_DISABLED;
    }
    
    return 
ITEM_ENABLED;
}

public 
blockmenuid )
{
    new 
blockkmods[512]
    
format(blockkmods511"%L"LANG_PLAYER"MM_BLOCKMODS");
    new 
menu menu_create(blockkmods"block_handler");
    new 
callback menu_makecallback("blockcallback");

    for(new 
<= g_modcount i++) 
    {
        if(
== g_currentmodid)
        {
            new 
curmodline[512];
            
format(curmodline511"%s %L"g_modnames[g_currentmodid], LANG_PLAYER"MM_CURRENTMOD");
            
menu_additem(menucurmodline""_callback);
        }
        else
        {
            if(
== g_blockedmod[i])
            {
                new 
nexmodline[512];
                
format(nexmodline511"%s \r%L"g_modnames[i], LANG_PLAYER"MM_BLOCKED");
                
menu_additem(menunexmodline""_callback);
            }
            else
            {
                new 
nexmodline[512];
                
format(nexmodline511"%s"g_modnames[i]);
                
menu_additem(menunexmodline""_callback);
            }
        }
    }
    
    
menu_display(idmenu0);
    return 
PLUGIN_CONTINUE;
}

public 
block_handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
mmmenu(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);
    
    new 
sAdminName[32];
    
get_user_name(idsAdminName31);
    
    switch(
item)
    {
        default:
        {
            if(
item == g_blockedmod[item])
            {
                
ColorChat(0COLOR"%L"LANG_PLAYER"MM_ADMINUNLOCKED"sPrefixsAdminNameg_modnames[item]);
                
g_blockedmod[item] =! item;
            }
            else
            {
                
ColorChat(0COLOR"%L"LANG_PLAYER"MM_ADMINLOCKED"sPrefixsAdminNameg_modnames[item]);
                
g_blockedmod[item] = item;
            }
        }
    }
    
    
blockmenuid );

    return 
PLUGIN_HANDLED;
}

public 
blockcallbackidmenuitem )
{
    static 
_accessinfo[4], callback;
    
menu_item_getinfo(menuitem_accessinfosizeof(info) - 1__callback);
    
    if(!(
get_user_flags(id) & BMM_FLAG))
    {
        return 
ITEM_DISABLED;
    }
    
    if( 
item == g_currentmodid )
    {
        return 
ITEM_DISABLED;
    }
    
    if( 
g_hasbeenrocked )
    {
        return 
ITEM_DISABLED;
    }
    
    return 
ITEM_ENABLED;
}

public 
cancelmodid )
{
    if( !( 
get_user_flagsid ) & CM_FLAG ) )
        return 
PLUGIN_HANDLED;
    
    if( 
modnexted )
    {
        new 
sAdminName[32];
        
get_user_name(idsAdminName31);
        
ColorChat(0COLOR"%L"LANG_PLAYER"MM_ADMINCANCELNEXTMOD"sPrefixsAdminName);
        
modnexted false;
        
nextmodchosed false;
    }
    
    
mmmenuid );
    return 
PLUGIN_HANDLED;
}

public 
cmdSayRTVid )
{
    if( 
modnexted )
    {
        
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_NEXTMODCHOOSED"sPrefix);
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_hasbeenrocked )
    {
        
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_VOTEMODROCKED"sPrefix);
        return 
PLUGIN_HANDLED;
    }
    
    if( 
g_rockedVote[id] )
    {
        
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_YOUROCKEDRTV"sPrefix);
        
rtv_remind();
        return 
PLUGIN_CONTINUE;
    }
    
    new 
Float:time_elapsed get_cvar_float("mp_timelimit") - (floatget_timeleft() ) / 60.0);
    
    if( 
time_elapsed 10.0 )
    {    
        new 
Float:time_til_votebegin =  10.0 time_elapsed;
        
        new 
get_timeleft();
        
        new 
Float:wmin_to_vote time_til_votebegin 0.5;
        
        new 
min_to_vote floatround(wmin_to_vote);
        if( 
min_to_vote == )
        {
            
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_YOUCANTSECONDS"sPrefix, (60), (60) == "" "s" );
        }
        else
        {
            
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_YOUCANTMINS"sPrefixmin_to_votemin_to_vote == "" "s", (60), (60) == "" "s" );
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    
g_rockedVote[id] = true;
    
g_rockedVoteCnt++;
    
ColorChat(idCOLOR"%L"LANG_PLAYER"MM_RTV_YOUHAVEROCKED"sPrefix);
    
    if( 
g_rockedVoteCnt >= get_RocksNeeded() ) 
    {
        
ColorChat(0COLOR"%L"LANG_PLAYER"MM_RTV_VOTEMODWILLSTART"sPrefix);
        
set_task(4.0,"startRockVote");
    }
    else
    {
        
rtv_remind( );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
startRockVote( )
{
    
set_task(1.0,"start_vote");
}

get_RocksNeeded( )
{
    return 
floatround(get_pcvar_float(cvar_rtv_ratio) * float(get_realplayersnum()), floatround_ceil);
}

stock get_realplayersnum( )
{
    new 
players[32], playerCnt;
    
get_players(playersplayerCnt"ch");
    
    return 
playerCnt;
}

rtv_remind( )
{
    
ColorChat(0COLOR"%L"LANG_PLAYER"MM_RTV_NEEDMOREPLAYERS"sPrefixget_RocksNeeded() - g_rockedVoteCntget_RocksNeeded() - g_rockedVoteCnt "s" "");
}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    if( !
get_playersnum() ) return;
    
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;


He hecho todo tal cual los instalado.. pero aun no me inicia los mod
post original https://forums.alliedmods.net/showthread.php?t=95568


Archivos adjuntos Miniatura(s)
   
Responder
#2
yo te recomendaria que uses el metodo donde creas cfgs en addons/amxmodx/configs/maps
yo tuve un servidor multimod y es el mejor metodo para hacer uno, los plugins esos tenian bugs
Responder
#3
pensaba lo mismo, muchas gracias por la sugerencia
aprendiendo
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)