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

Auto-Mix Plugin Bug, PLEASE HELP.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-03-2017 , 20:34   Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #1

Hello, I've now tried numerous variations of the Auto-Mix plugin and still get the same error:

PHP Code:
L 01/03/2017 19:56:15Start of error session.
L 01/03/2017 19:56:15Info (map "de_mirage") (file "addons/amxmodx/logs/error_20170103.log")
L 01/03/2017 19:56:15Plugin called menu_display when item=MENU_EXIT
L 01
/03/2017 19:56:15: [AMXXDisplaying debug trace (plugin "automix.amxx")
L 01/03/2017 19:56:15: [AMXXRun time error 10native error (native "menu_display")
L 01/03/2017 19:56:15: [AMXX]    [0automix.sma::EndTeamsVote (line 2994
It seems the problem is that when the Team Organization Vote comes up, if EVERYONE DOES NOT vote, the plugin breaks. Everyone has to vote for some odd reason, I don't understand why.

Here is the section in the .sma that the debug trace found (line 2994 is "show_menu(0, 0, "^n", 1);"):
PHP Code:
public EndTeamsVote() {
    
show_menu(00"^n"1); // <--- THIS IS LINE 2994
    
new best 0
    for(new 
1sizeof(g_rVotes); i++) { 
        if(
g_rVotes[i] > g_rVotes[best]) 
            
best i
    } 
     
    switch(
best) {
        case 
0:
        {
            new 
playersT[32] , numT playersCt[32] , numCt
            get_players
playersT numT "che" "TERRORIST" )
            
get_playersplayersCt numCt "che" "CT" 
            
g_rVotes[0] = 0
            g_rVotes
[1] = 0
            g_rVotes
[2] = 0
            
            
if (numT != numCt)
            {
                
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TEAMS_NOT_BALANCED")
                new 
taskId scanForTaskID()
                
set_task(10.0"RandomTeams"taskId)
                return 
PLUGIN_HANDLED
            
}
            
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TEAMS_WILL_REMAIN_SAME"
            new 
taskId scanForTaskID()
            
set_task(10.0"CurrentTeams"taskId)
        }
        case 
1
        {
            
g_rVotes[0] = 0
            g_rVotes
[1] = 0
            g_rVotes
[2] = 0
            chat_color
(0"!g%s %L"PREFIXLANG_PLAYER"TEAMS_WILL_BE_CAPTAINS"
            new 
taskId scanForTaskID()
            
set_task(10.0"RandomCpt"taskId
        }
        case 
2:
        {
            
g_rVotes[0] = 0
            g_rVotes
[1] = 0
            g_rVotes
[2] = 0
            chat_color
(0"!g%s %L"PREFIXLANG_PLAYER"TEAMS_WILL_BE_RANDOM"
            new 
taskId scanForTaskID()
            
set_task(10.0"RandomTeams"taskId)
        }
    }
    
    return 
PLUGIN_HANDLED



Also, for some strange reason, when I do "Extend Map" the plugin decides to change to a different map.

Code:
[k7 Bros'] k7.msi voted to extend the current map.
[k7 Bros'] aTAKA voted to extend the current map.
[k7 Bros'] The current map will be extended for this PUG.
[k7 Bros'] Team organization vote will be started in 10 seconds.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
Any idea why?

I know I'm asking for a lot of help here, but PLEASE help me. I beg you. I've been trying to fix my server for such a long time now without any luck.

Thank you as always.


Kind regards,
Tivity
__________________

Last edited by Tivity; 01-04-2017 at 20:51.
Tivity is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-03-2017 , 20:58   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #2

show entire code pls.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-04-2017 , 20:17   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #3

Still in need of help! Got a lot fixed, just have one small problem with the Votemap function now. If anyone would like to help, please post below or PM me.

Thanks as always!
__________________

Last edited by Tivity; 01-04-2017 at 20:52.
Tivity is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 20:23   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #4

You can tell us the problem here for we fix it. Because if someone has the same problem, we can give for him/she this thread's link instead of saying the same sh*t.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-04-2017 , 20:42   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
You can tell us the problem here for we fix it. Because if someone has the same problem, we can give for him/she this thread's link instead of saying the same sh*t.
So what I recommended to the original editor of the plugin was to completely remove the Same Teams and Random Teams features from the Team-Organization Vote, so it would automatically go to Random Captains.

We were able to successfully do that, however we are still having problems with the Votemap feature.

For some strange reason, it cannot choose the correct map people voted for.
Code:
[k7 Bros'] k7.msi voted for de_dust2.
[k7 Bros'] aTAKA voted for de_dust2.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_dust2.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
[k7 Bros'] The map will be changed within 10 seconds. Nextmap: de_tuscan.
As you can see, the first line correctly chooses the map (de_dust2), but then the next two lines choose a different map from the list (de_tuscan).



Anyone willing to take a shot at fixing the Votemap function?

Here is the code for it below (if you need to see the full .sma, please PM me or add me on Steam (k7og), or view Post #7 (PasteBin)):
PHP Code:
public StartVote()  {  
    
getmaps() 
    new 
rnd 
    
while (g_DoneMaps != && g_MapsCounter 0) { 
        
rnd random(g_MapsCounter
        
copy(g_MapsChosen[g_DoneMaps++], 19g_MapsAvailable[rnd]) 
        
g_MapsAvailable[rnd] = g_MapsAvailable[--g_MapsCounter
    }         
         
    new 
title[64], extend[64]
    
formatex(titlecharsmax(title), "\r%L"LANG_PLAYER"CHANGE_MAP")
    
formatex(extendcharsmax(extend), "\y%L"LANG_PLAYER"EXTEND_MAP")
    
g_gVoteMenu menu_create(title"votemap"); 

    new 
num[11
    for(new 
0g_DoneMapsi++)  { 
        
num_to_str(inum10
        
menu_additem(g_gVoteMenug_MapsChosen[i], num0)
    }
    
menu_additem(g_gVoteMenuextend"4"0
    
menu_setprop(g_gVoteMenuMPROP_EXITMEXIT_NEVER)
    
    new 
players[32], pnumtempid
    
get_players(playerspnum"ch"); 
    for( new 
ii<pnumi++ ) { 
        
tempid players[i]; 
        if ( !
g_bIsViewingMenutempid ] )
        {
            
menu_display(tempidg_gVoteMenu)        
            
g_bIsViewingMenutempid ] = true;
        }
    }
    new 
taskId scanForTaskID()
    
set_task(10.0"EndVote"taskId);    
    return 
PLUGIN_HANDLED

  
public 
votemap(idmenuitem) {

        if ( 
item == MENU_EXIT || !g_gVoteMenu )
        {
        return 
PLUGIN_HANDLED;
        }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
voteid str_to_num(data);
    new 
playerna[32]
    
get_user_name(idplayerna31)
    
    if (
voteid != 4)
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"VOTED_MAP"playernag_MapsChosen[voteid])
    else 
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"VOTED_EXTEND"playerna)
    
    
g_gVotes[voteid]++;
    
g_bIsViewingMenuid ] = false;
    return 
PLUGIN_HANDLED;
}

public 
getmaps() { 
    new 
mapsfile fopen(g_Maps_Ini_File"r"
    new 
linefortest[50
     
    while (
g_MapsCounter sizeof(g_MapsAvailable) && !feof(mapsfile)) { 
        
fgets(mapsfilelinefortest49
        
trim(linefortest
        
        new 
getcurrentmap[32]
        
get_mapname(getcurrentmap31)
        
        if ((
is_map_valid(linefortest)) && (!equali(linefortestgetcurrentmap))) 
            
copy(g_MapsAvailable[g_MapsCounter++], 24linefortest)  
    } 
     
    
fclose(mapsfile)
}  

public 
EndVote() { 
    
show_menu(00"^n"1); 
    new 
best 0
    for(new 
1sizeof(g_gVotes); i++) { 
        if(
g_gVotes[i] > g_gVotes[best]) 
        
best i
    }
    
    
g_gVotes[0] = 0
    g_gVotes
[1] = 0
    g_gVotes
[2] = 0
    g_gVotes
[3] = 0
    g_gVotes
[4] = 0
     
    
if(best == 4) { 
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"EXTEND_FINAL"); 
        
TeamsVote()
    } 
    else { 
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"MAP_FINAL"g_MapsChosen[best]); 
        
g_ChangeMapTo best;
        
        if ( 
g_CustomGame )
            
set_pug_state(2)
        else
            
set_pug_state(1)
            
        
set_pcvar_string(cvar_sv_password"")
        new 
taskId scanForTaskID()
        
set_task(10.0"ChangeMap"taskId); 
    } 
    
    return 
PLUGIN_HANDLED
}  

public 
ChangeMap() {
    new 
maptochangeto[25]
    
    
copy(maptochangeto24g_MapsChosen[g_ChangeMapTo])
    
server_cmd("changelevel %s"maptochangeto)
    return 
PLUGIN_CONTINUE

__________________

Last edited by Tivity; 01-04-2017 at 21:14.
Tivity is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 21:01   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #6

Can you upload the automix source code?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-04-2017 , 21:08   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
Can you upload the automix source code?
I've uploaded it to PasteBin.

Here are the two links for it:

Regular Paste - http://pastebin.com/fUTeAnvG
RAW Paste (if Regular is too laggy for you) - http://pastebin.com/raw/fUTeAnvG
__________________
Tivity is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 21:13   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #8

I don't have any idea what can fix that problem, the best way is wait any scripter better than me.

PHP Code:
    if(best == 4
    {  
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"EXTEND_FINAL");  
        
TeamsVote() 
    }  
    else if(
best >= 5)
    {  
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"MAP_FINAL"g_MapsChosen[best]);  
        
g_ChangeMapTo best

                if ( 
g_CustomGame )
                    
set_pug_state(2)
                else
                    
set_pug_state(1)
        
        
set_pcvar_string(cvar_sv_password""
        new 
taskId scanForTaskID() 
        
set_task(10.0"ChangeMap"taskId);  
    }  
    else
    {
        
client_print(0,print_chat,"Your current map will extend");
        
set_task(10.0,"YourWarmupFunctionNameHere");
        
best 0;
    } 
Have u tried it?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-04-2017 at 21:18.
EFFx is offline
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-04-2017 , 21:25   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #9

Quote:
Originally Posted by EFFx View Post
I don't have any idea what can fix that problem, the best way is wait any scripter better than me.

PHP Code:
    if(best == 4
    {  
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"EXTEND_FINAL");  
        
TeamsVote() 
    }  
    else if(
best >= 5)
    {  
        
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"MAP_FINAL"g_MapsChosen[best]);  
        
g_ChangeMapTo best

                if ( 
g_CustomGame )
                    
set_pug_state(2)
                else
                    
set_pug_state(1)
        
        
set_pcvar_string(cvar_sv_password""
        new 
taskId scanForTaskID() 
        
set_task(10.0"ChangeMap"taskId);  
    }  
    else
    {
        
client_print(0,print_chat,"Your current map will extend");
        
set_task(10.0,"YourWarmupFunctionNameHere");
        
best 0;
    } 
Have u tried it?
I personally have very minimal scripting knowledge, I only got in contact with the editor of the plugin and suggested these changes. We are both now having problems with the Votemap function. On his server, players only like to use Extend Map and he would like to change that habit- on my server, however, players always prefer to vote on a map they would like to play. This is why we both need help with this.
__________________

Last edited by Tivity; 01-04-2017 at 21:27.
Tivity is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 21:36   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #10

I have this votemap code here too, I re-made him, you can use him instead of yours.

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new gMapsIniFile[64],gMapsDisponiveis[30][20],gMapsChosen[4][20],ggVotes[5]
new 
gMapsCounter,gDoneMaps,gChangeMapTo,ggVoteMenu

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say .votemap","ServerVoteMap")
}
public 
ServerVoteMap(id)
{
    if(
access(id,ADMIN_CFG))
    {
        new 
szName[33]
        
get_user_name(id,szName,sizeof(szName))
        
client_print(0,print_chat,"%s: Votemap executed!",szName)
        
VoteMap()
    }
    else
    {
        
client_print(id,print_console,"You have not access to this command!")
    }
    return 
PLUGIN_HANDLED
}
public 
VoteMap()
{  
    
getmaps() 
    new 
rnd 
    
while (gDoneMaps != && gMapsCounter 0
    { 
        
rnd random(gMapsCounter
        
copy(gMapsChosen[gDoneMaps++], 19gMapsDisponiveis[rnd]) 
        
gMapsDisponiveis[rnd] = gMapsDisponiveis[--gMapsCounter
    }         
    
    
ggVoteMenu menu_create("Choose your map:","votethemap")
    
    new 
num[11
    for(new 
0gDoneMapsi++)  
    { 
        
num_to_str(inum10
        
menu_additem(ggVoteMenugMapsChosen[i], num0)
    }
    
menu_additem(ggVoteMenu"\yExtend the current map""4"0
    new 
players[32], pnumtempid 
    get_players
(playerspnum"ch"
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i
        
menu_display(tempidggVoteMenu
    }  
    
set_task(10.0"EndVote")  
    return 
PLUGIN_HANDLED 



public 
votethemap(id,menu,item)
{
    if(
item == MENU_EXIT
    {        
        
menu_display(idggVoteMenu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], szName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback)
    new 
voteid str_to_num(data)
    new 
playerna[32]
    
get_user_name(idplayerna31)
    
    if (
voteid != 4)
        
client_print(0,print_chat,"%s has choosed %s for the next map.",playerna,gMapsChosen[voteid])
    else 
        
client_print(0,print_chat,"%s has chosed for extend the current map.",playerna)
    
    
ggVotes[voteid]++
    return 
PLUGIN_HANDLED
}

public 
getmaps()

    
get_configsdir(gMapsIniFile63
    
format(gMapsIniFile63"%s/maps.ini"gMapsIniFile
    
    new 
mapsfile fopen(gMapsIniFile"r"
    new 
linefortest[50
    
    while (
gMapsCounter sizeof(gMapsDisponiveis) && !feof(mapsfile)) 
    { 
        
fgets(mapsfilelinefortest49
        
trim(linefortest
        
        new 
getcurrentmap[32]
        
get_mapname(getcurrentmap31)
        
        if ((
is_map_valid(linefortest)) && (!equali(linefortestgetcurrentmap))) 
            
copy(gMapsDisponiveis[gMapsCounter++], 24linefortest)  
    } 
    
    
fclose(mapsfile
}  

public 
EndVote()

    
show_menu(00"^n"1
    new 
best 
    
for(new 1sizeof(ggVotes); i++) 
    { 
        if(
ggVotes[i] > ggVotes[best]) 
            
best 
    
}
    
    
ggVotes[0] = 0
    ggVotes
[1] = 0
    ggVotes
[2] = 0
    ggVotes
[3] = 0
    ggVotes
[4] = 0
    
    
if(best == 4
    { 
        
client_print(0,print_chat,"A new vote will re-run in 10 seconds.")
        
set_task(10.0,"VoteMap")
    }
    else if(
best >= 5)
    {
        
client_print(0,print_chat,"Votemap finished! The next map will be %s",gMapsChosen[best])
        
gChangeMapTo best
    
}
    if(
best <= 3)
    { 
        
client_print(0,print_chat,"The current map will be extended!")
        
set_task(10.0,"YourWarmupFunctionNameHere")
        
best 0
    

    return 
PLUGIN_HANDLED
}

public 
ChangeMap()
{
    new 
maptochangeto[25]
    
    
remove_task()
    
copy(maptochangeto24gMapsChosen[gChangeMapTo])
    
server_cmd("changelevel %s"maptochangeto)
    return 
PLUGIN_CONTINUE

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Reply



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 18:13.


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