Raised This Month: $12 Target: $400
 3% 

Multimod Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Ashish Kumar
New Member
Join Date: Mar 2014
Location: India
Old 01-13-2015 , 14:50   Re: MULTIMOD PLUGIN
Reply With Quote #561

Quote:
Originally Posted by joropito View Post
Updated

Fixed some minor bugs.
Added admin command amx_votemod to force Mod votting

I will add some commands and checks to avoid errors in server log (empty arrays, empty/inexistent files, etc)
PLEASE PLUGIN OWNER could you Provide a detailed Tutorial on How to Setup Multimod server configuration I am unable to make this mod run on the server. Where this multimod folder should recide
cstrike/amxmodx/config/multimod <-- Here ?
cstrike/multimod <-- here ?
cstrike/amxmodx/multimod <--- or here ??
__________________
@sH!sH
Quote:
Buy Me A Beer
Ashish Kumar is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-13-2015 , 17:58   Re: MULTIMOD PLUGIN
Reply With Quote #562

Quote:
Originally Posted by Ashish Kumar View Post
PLEASE PLUGIN OWNER could you Provide a detailed Tutorial on How to Setup Multimod server configuration I am unable to make this mod run on the server. Where this multimod folder should recide
cstrike/amxmodx/config/multimod <-- Here ?
cstrike/multimod <-- here ?
cstrike/amxmodx/multimod <--- or here ??
Directory should be inside of your game folder, so for Counter Strike, which I assume you wanna run. The multimod directory would be inside cstrike folder.

Code:
"cstrike/multimod"
Your plugin, language and config files would go into addons/amxmodx folder. For further assistance please refer to this tutorial.

https://forums.alliedmods.net/showpo...&postcount=289
Spirit_12 is offline
The PaRaDoX
New Member
Join Date: Jul 2015
Old 10-18-2015 , 02:40   Re: Multimod Plugin
Reply With Quote #563

Thanks Joropito
It worked cleanly and smoothly
The PaRaDoX is offline
hardboy
Member
Join Date: Jun 2014
Location: Greece
Old 04-06-2016 , 18:09   Re: Multimod Plugin
Reply With Quote #564

I can't see the maps in the vote
hardboy is offline
bigmonster
New Member
Join Date: Jun 2016
Old 06-09-2016 , 13:18   Re: Multimod Plugin
Reply With Quote #565

We Have to download all this files ?
bigmonster is offline
hamzatahir
Junior Member
Join Date: May 2017
Old 06-15-2017 , 09:44   Re: Multimod Plugin
Reply With Quote #566

I've added all files accordingly and as said but i'm getting this error,
whats the fix to it?
hamzatahir is offline
hamzatahir
Junior Member
Join Date: May 2017
Old 06-15-2017 , 09:57   Re: Multimod Plugin
Reply With Quote #567

And another question is that if i wanna add up different mods like the following
https://forums.alliedmods.net/showthread.php?t=168274
https://forums.alliedmods.net/showthread.php?t=171845
https://forums.alliedmods.net/showthread.php?t=72505
https://forums.alliedmods.net/showthread.php?p=571256
https://forums.alliedmods.net/showthread.php?t=78197
https://forums.alliedmods.net/showthread.php?p=390294

if i wanna add these into my server using the multimod plugin so should i just add the following in the multimod.ini

;mode name:mod tag:custom cvars cfg file
[Gun Game]:[gungame]:[gungame-config.cfg]
[Paint Ball]:[paintball]:[paintball-config.cfg]
[FlowerMod]:[flowermod]:[flowermod-config.cfg]

and create
multimod/flowermod-maps.ini
multimod/flowermod-plugins.ini
multimod/flowermod-config.cfg

sorry for bad english, to add any mod i've to use this?
hamzatahir is offline
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 03-07-2018 , 12:34   Re: Multimod Plugin
Reply With Quote #568

Noticed a mistake.If the Administrator to log in to the server and enter the command amx_votemod and assuring not to go for the team CT or T

PHP Code:
Displaying debug trace (plugin "multimod.amxx")
Run time error 4index out of bounds 
ColorChat
.inc::ColorChat 
multimod
.sma::check_vote 
And then, after voting for Mod-no voting for the card

If for example to do a reset of the card, then there is no error

How to fix?Help


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <ColorChat>
#include <fakemeta>
#include <fakemeta_util>

#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    "addons/amxmodx/configs/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""10")
    
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
("%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("Мод Загружен: %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 40)
        return

    
start_vote()
}

public 
SetBlackScreenFade(fade)
{
    new 
timeholdflags;
    static 
iMsgScreenFade
    if(!
iMsgScreenFadeiMsgScreenFade get_user_msgid("ScreenFade");
    
    switch (
fade)
    {
        case 
1: { time 1hold 1flags 4; }
        case 
2: { time 4096hold 1024flags 1; }
        default: { 
time 4096hold 1024flags 2; }
    }

    
message_begin(MSG_BROADCASTiMsgScreenFade);
    
write_short(time);
    
write_short(hold);
    
write_short(flags);
    
write_byte(0);
    
write_byte(0);
    
write_byte(0);
    
write_byte(255);
    
message_end();


public 
start_vote()
{

        new 
players[32], iCountplayer;
        
get_players(playersiCount"ah");

        for (new 
iiCounti++)
        {
        
player players[i];

        
set_pev(playerpev_flagspev(playerpev_flags) | FL_FROZEN)
        
fm_set_user_godmode(player1);
        }

        
SetBlackScreenFade(2);
        
set_task(1.0"SetBlackScreenFade"1);
        
g_alreadyvoted true
        remove_task
(TASK_VOTEMOD)
        
remove_task(TASK_CHVOMOD)

    new 
menu[512], mkeysiPercenti
    
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"\r%d.\w %s\d \y•\w \r%d\w \y%%\w^n^n"1g_modnames[i], iPercent)
        
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 Vote/golosovanie_start")

    
set_task(15.0"check_vote"TASK_CHVOMOD)
    return
}

public 
user_nextmod(id)
{
#if AMXX_VERSION_NUM < 183
ColorChat(0RED"^4Следующий Мод: ^3%s"g_modnames[g_nextmodid])
#else
client_print_color(0print_team_red"^4Следующий Мод: ^3%s"g_modnames[g_nextmodid])
#endif 
    //client_print(0, print_chat, "%L", LANG_PLAYER, "MM_NEXTMOD", g_modnames[g_nextmodid])
    
return PLUGIN_HANDLED
}

public 
user_currentmod(id)
{
#if AMXX_VERSION_NUM < 183
ColorChat(0RED"^4Следующий Мод: ^3%s"g_currentmod)
#else
client_print_color(0print_team_red"^4Следующий Мод: ^3%s"g_currentmod)
#endif 
    //client_print(0, print_chat, "%L", LANG_PLAYER, "MM_NEXTMOD", g_currentmod)
    
return PLUGIN_HANDLED
}

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

    
if(g_alreadyvoted)
    {
        
#if AMXX_VERSION_NUM < 183
ColorChat(0RED"^4Голосование за Мод закончено.Следующий Мод ^3%s"g_modnames[g_nextmodid])
#else
client_print_color(0print_team_red"^4Голосование за Мод закончено.Следующий Мод ^3%s"g_modnames[g_nextmodid])
#endif 
        //client_print(0, print_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"%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))
#if AMXX_VERSION_NUM < 183
ColorChat(0RED"^4%s ^1выбрал ^3%s"playerg_modnames[key])
#else
client_print_color(0print_team_red"^4%s ^1выбрал ^3%s"playerg_modnames[key])
#endif 
            //client_print(0, print_chat, "%L", LANG_PLAYER, "X_CHOSE_X", player, g_modnames[key])
        
}
        
g_votemodcount[key]++
    }
}

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

        
#if AMXX_VERSION_NUM < 183
ColorChat(0RED"^4Голосование за Мод закончено.Следующий Мод ^3%s"g_modnames[b])
#else
client_print_color(0print_team_red"^4Голосование за Мод закончено.Следующий Мод ^3%s"g_modnames[b])
#endif 
        //client_print(0, print_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


Last edited by MayroN; 03-07-2018 at 12:47.
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-07-2018 , 14:42   Re: Multimod Plugin
Reply With Quote #569

Quote:
Originally Posted by MayroN View Post
[B]Noticed a mistake.If the Administrator to log in to the server and enter the command amx_votemod and assuring not to go for the team CT or T
You're using a modified version so I can't help you.

Switch to the released on first post and check if the problem still happen.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 03-07-2018 , 15:50   Re: Multimod Plugin
Reply With Quote #570

Quote:
Originally Posted by joropito View Post
You're using a modified version so I can't help you.

Switch to the released on first post and check if the problem still happen.
Checked with Your version-all the same mistake,but now the voting card takes place
PHP Code:
L 03/07/2018 22:30:00: [AMXXDisplaying debug trace (plugin "multimod.amxx")
L 03/07/2018 22:30:00: [AMXXRun time error 4index out of bounds 
L 03
/07/2018 22:30:00: [AMXX]    [0multimod.sma::check_vote (line 351
Please Fix
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode