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

Auto-Mix Plugin Bug, PLEASE HELP.


Post New Thread Reply   
 
Thread Tools Display Modes
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 21:46   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #11

Wait, this format

PHP Code:
    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
    

Should be

PHP Code:
    if(best == 4
    { 
        
client_print(0,print_chat,"The current map will be extended!")
        
set_task(10.0,"YourWarmupFunctionNameHere")
        
best 0
    
}
    else 
    {
        
client_print(0,print_chat,"Votemap finished! The next map will be %s",gMapsChosen[best])
        
gChangeMapTo best
        set_task
(2.0,"ChangeMap")
    } 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
iNdio
Senior Member
Join Date: Apr 2015
Location: Ro
Old 01-06-2017 , 11:09   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #12

[1]
When players vote for 2. RANDOM CAPTAIN, till the teams are set they must go to SPECTATOR, so this public will be:
PHP Code:
public RandomCpt() {
    
set_pcvar_num(cvar_mp_freezetime9999)
    new 
players[32], pnumtempid;
    
get_players(playerspnum"ch");
    new 
specialCount

    
for( new ii<pnumi++ ) {
        
tempid players[i];
        
client_cmd(tempid"kill")
        
        if ( 
cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
        {
            
specialCount++
            
cs_set_user_team(tempidCS_TEAM_SPECTATOR)
        } 
            
    }
    
log_amx("RandomCpt stage 1")
    
    if (
specialCount 2) {
        if (
g_CustomGame) {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS_CUSTOM")
            new 
taskId scanForTaskID()
            
set_task(3.0"RandomTeams"taskId)
        }
        
        else {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS")
            new 
taskId scanForTaskID()
            
set_task(5.0"EndMatch"taskId)
        }
        return;
    }
    
log_amx("RandomCpt stage 2")
        
    new 
random(pnum)
    while (
cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
        
random(pnum)
    
cs_set_user_team(players[z], CS_TEAM_T)
    
gCptT players[z]
    
    new 
random(pnum)
    while ( (
== z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
        
random(pnum)
        
    
log_amx("RandomCpt stage 3")
    
cs_set_user_team(players[q], CS_TEAM_CT
    
gCptCT players[q]
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"RANDOM_CAPTAINS_CHOSEN")
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TERROR_CAPTAIN_FIRST")
    
g_bCpt true
    log_amx
("RandomCpt stage 4")
    
moveT()
    return;

--- >
PHP Code:
public RandomCpt() {
    
set_pcvar_num(cvar_mp_freezetime9999)
    new 
players[32], pnumtempid;
    
get_players(playerspnum"ch");
    new 
specialCount

    
for( new ii<pnumi++ ) {
        
tempid players[i];

        
user_silentkill tempid );
        
cs_set_user_team tempid);
        
        if ( 
cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
        {
            
specialCount++
            
cs_set_user_team(tempidCS_TEAM_SPECTATOR)
        } 
            
    }
    
log_amx("RandomCpt stage 1")
    
    if (
specialCount 2) {
        if (
g_CustomGame) {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS_CUSTOM")
            new 
taskId scanForTaskID()
            
set_task(3.0"RandomTeams"taskId)
        }
        
        else {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS")
            new 
taskId scanForTaskID()
            
set_task(5.0"EndMatch"taskId)
        }
        return;
    }
    
log_amx("RandomCpt stage 2")
        
    new 
random(pnum)
    while (
cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
        
random(pnum)
    
cs_set_user_team(players[z], CS_TEAM_T)
    
gCptT players[z]
    
    new 
random(pnum)
    while ( (
== z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
        
random(pnum)
        
    
log_amx("RandomCpt stage 3")
    
cs_set_user_team(players[q], CS_TEAM_CT
    
gCptCT players[q]
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"RANDOM_CAPTAINS_CHOSEN")
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TERROR_CAPTAIN_FIRST")
    
g_bCpt true
    log_amx
("RandomCpt stage 4")
    
moveT()
    return;

[2]
PHP Code:
Plugin called menu_display when item=MENU_EXIT
[AMXXRun time error 10native error (native "menu_display"
To solve this, replace these publics:
PHP Code:
public EndTeamsVote() {
    
show_menu(00"^n"1); 
    new 
best 0
    for(new 
1sizeof(g_rVotes); i++) { 
        if(
g_rVotes[i] > g_rVotes[best]) 
            
best i
    } 
     
    switch(
best) {
        case 
0
        {
            
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(5.0"RandomCpt"taskId
        }
    }
    
    return 
PLUGIN_HANDLED

--- >
PHP Code:
public EndTeamsVote() {
 
    new 
best 0
    for(new 
1sizeof(g_rVotes); i++) { 
        if(
g_rVotes[i] > g_rVotes[best]) 
            
best i
    } 
     
    switch(
best) {
        case 
0
        {
            
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(5.0"RandomCpt"taskId
        }
    }
    
    return 
PLUGIN_HANDLED

[3]
Votemap, when it's done I will edit this shit. AUTOMIX = Nr 1 + 2 already modified.
Attached Files
File Type: sma Get Plugin or Get Source (AUTOMIX.sma - 189 views - 126.9 KB)
__________________
Where Cs had no value, amxx, sometimes, had its price...

Last edited by iNdio; 01-06-2017 at 11:21.
iNdio is offline
Tivity
Member
Join Date: Dec 2016
Location: San Diego
Old 01-07-2017 , 05:59   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #13

Quote:
Originally Posted by iNdio View Post
[1]
When players vote for 2. RANDOM CAPTAIN, till the teams are set they must go to SPECTATOR, so this public will be:
PHP Code:
public RandomCpt() {
    
set_pcvar_num(cvar_mp_freezetime9999)
    new 
players[32], pnumtempid;
    
get_players(playerspnum"ch");
    new 
specialCount

    
for( new ii<pnumi++ ) {
        
tempid players[i];
        
client_cmd(tempid"kill")
        
        if ( 
cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
        {
            
specialCount++
            
cs_set_user_team(tempidCS_TEAM_SPECTATOR)
        } 
            
    }
    
log_amx("RandomCpt stage 1")
    
    if (
specialCount 2) {
        if (
g_CustomGame) {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS_CUSTOM")
            new 
taskId scanForTaskID()
            
set_task(3.0"RandomTeams"taskId)
        }
        
        else {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS")
            new 
taskId scanForTaskID()
            
set_task(5.0"EndMatch"taskId)
        }
        return;
    }
    
log_amx("RandomCpt stage 2")
        
    new 
random(pnum)
    while (
cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
        
random(pnum)
    
cs_set_user_team(players[z], CS_TEAM_T)
    
gCptT players[z]
    
    new 
random(pnum)
    while ( (
== z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
        
random(pnum)
        
    
log_amx("RandomCpt stage 3")
    
cs_set_user_team(players[q], CS_TEAM_CT
    
gCptCT players[q]
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"RANDOM_CAPTAINS_CHOSEN")
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TERROR_CAPTAIN_FIRST")
    
g_bCpt true
    log_amx
("RandomCpt stage 4")
    
moveT()
    return;

--- >
PHP Code:
public RandomCpt() {
    
set_pcvar_num(cvar_mp_freezetime9999)
    new 
players[32], pnumtempid;
    
get_players(playerspnum"ch");
    new 
specialCount

    
for( new ii<pnumi++ ) {
        
tempid players[i];

        
user_silentkill tempid );
        
cs_set_user_team tempid);
        
        if ( 
cs_get_user_team(tempid) != CS_TEAM_UNASSIGNED )
        {
            
specialCount++
            
cs_set_user_team(tempidCS_TEAM_SPECTATOR)
        } 
            
    }
    
log_amx("RandomCpt stage 1")
    
    if (
specialCount 2) {
        if (
g_CustomGame) {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS_CUSTOM")
            new 
taskId scanForTaskID()
            
set_task(3.0"RandomTeams"taskId)
        }
        
        else {
            
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"LESS_PLAYERS")
            new 
taskId scanForTaskID()
            
set_task(5.0"EndMatch"taskId)
        }
        return;
    }
    
log_amx("RandomCpt stage 2")
        
    new 
random(pnum)
    while (
cs_get_user_team(players[z]) == CS_TEAM_UNASSIGNED)
        
random(pnum)
    
cs_set_user_team(players[z], CS_TEAM_T)
    
gCptT players[z]
    
    new 
random(pnum)
    while ( (
== z) || cs_get_user_team(players[q]) == CS_TEAM_UNASSIGNED )
        
random(pnum)
        
    
log_amx("RandomCpt stage 3")
    
cs_set_user_team(players[q], CS_TEAM_CT
    
gCptCT players[q]
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"RANDOM_CAPTAINS_CHOSEN")
    
chat_color(0"!g%s %L"PREFIXLANG_PLAYER"TERROR_CAPTAIN_FIRST")
    
g_bCpt true
    log_amx
("RandomCpt stage 4")
    
moveT()
    return;

[2]
PHP Code:
Plugin called menu_display when item=MENU_EXIT
[AMXXRun time error 10native error (native "menu_display"
To solve this, replace these publics:
PHP Code:
public EndTeamsVote() {
    
show_menu(00"^n"1); 
    new 
best 0
    for(new 
1sizeof(g_rVotes); i++) { 
        if(
g_rVotes[i] > g_rVotes[best]) 
            
best i
    } 
     
    switch(
best) {
        case 
0
        {
            
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(5.0"RandomCpt"taskId
        }
    }
    
    return 
PLUGIN_HANDLED

--- >
PHP Code:
public EndTeamsVote() {
 
    new 
best 0
    for(new 
1sizeof(g_rVotes); i++) { 
        if(
g_rVotes[i] > g_rVotes[best]) 
            
best i
    } 
     
    switch(
best) {
        case 
0
        {
            
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(5.0"RandomCpt"taskId
        }
    }
    
    return 
PLUGIN_HANDLED

[3]
Votemap, when it's done I will edit this shit. AUTOMIX = Nr 1 + 2 already modified.
You're a legend, thank you! And to you as well EFFx!
__________________
Tivity is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-07-2017 , 15:15   Re: Auto-Mix Plugin Bug, PLEASE HELP.
Reply With Quote #14

PHP Code:
client_cmd(tempid"kill"
->

PHP Code:
user_sillentkill(tempid
__________________
• 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 21:32.


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