Raised This Month: $32 Target: $400
 8% 

[ReQ] teams switch after round 10


Post New Thread Reply   
 
Thread Tools Display Modes
Ahmad111
Member
Join Date: Jul 2019
Old 04-05-2020 , 05:08   Re: [ReQ] teams switch after round 10
Reply With Quote #21

Quote:
Originally Posted by alferd View Post
For the next few hours, I'll put the Metch mode in the plugins section
My mod solves your problem
yes
Ahmad111 is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-05-2020 , 05:11   Re: [ReQ] teams switch after round 10
Reply With Quote #22

Quote:
Originally Posted by alferd View Post
For the next few hours, I'll put the Metch mode in the plugins section
My mod solves your problem
can you give the mod and compile it ?
Ahmad111 is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-05-2020 , 07:44   Re: [ReQ] teams switch after round 10
Reply With Quote #23

can any one compile effex code with out errores?
Ahmad111 is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-05-2020 , 08:04   Re: [ReQ] teams switch after round 10
Reply With Quote #24

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#pragma semicolon 1

//---|( Do not change the specifications)|---
#define PLUGIN "Mix-Status"
#define VERSION "3.0"
#define AUTHOR "AlferD"
//---|( Do not change the specifications)|---

new gCountCTScore 0;
new 
gCountTScore 0;

new 
enabled;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event"SendAudio""Hook_Terr_Win""a""2&%!MRAD_terwin");
    
register_event"SendAudio""Hook_CT_Win""a""2&%!MRAD_ctwin");
    
    
register_clcmd("say /status""status");
    
register_clcmd("say_team /status""status");
    
register_concmd("reset_score""reset_score");
    
    
    
enabled register_cvar("amx_status""1");
    
    
RegisterHam(Ham_Spawn"player""Score"1);
}

public 
Hook_Terr_Win( )
{
    
gCountTScore++;
}

public 
Hook_CT_Win( )
{
    
gCountCTScore++;
}

public 
Score()
{
    if ( 
get_pcvar_numenabled ) == )
    {
    
    if(
gCountTScore == 10)
        {  
       
CheckTeams();
        }
    
    if(
gCountCTScore == 10)
        {
       
CheckTeams();
        }
}
}

public 
reset_score( )
{
    
gCountCTScore 0;
    
gCountTScore 0;
}

public 
status(id)
{
    if ( 
get_pcvar_numenabled ) == )
    {    
    
client_print(idprint_chat,"[Ct Wins]: %d | [Ter Wins]: %d",gCountCTScore,gCountTScore);
   }
    else
    {
        
client_print(idprint_chat,"Server Not Mixed");
    return 
PLUGIN_HANDLED;
   }
}

CheckTeams()
{
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum);
            
    for(new 
iiNumi++)
    {
        if(
<= get_user_team(iPlayers[i]) <= 2)
        {
            
cs_set_user_team(iPlayers[i], (get_user_team(iPlayers[i]) == 1) ? CS_TEAM_CT CS_TEAM_T);
        }
    }

alferd is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-05-2020 , 09:10   Re: [ReQ] teams switch after round 10
Reply With Quote #25

Quote:
Originally Posted by alferd View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#pragma semicolon 1

//---|( Do not change the specifications)|---
#define PLUGIN "Mix-Status"
#define VERSION "3.0"
#define AUTHOR "AlferD"
//---|( Do not change the specifications)|---

new gCountCTScore 0;
new 
gCountTScore 0;

new 
enabled;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event"SendAudio""Hook_Terr_Win""a""2&%!MRAD_terwin");
    
register_event"SendAudio""Hook_CT_Win""a""2&%!MRAD_ctwin");
    
    
register_clcmd("say /status""status");
    
register_clcmd("say_team /status""status");
    
register_concmd("reset_score""reset_score");
    
    
    
enabled register_cvar("amx_status""1");
    
    
RegisterHam(Ham_Spawn"player""Score"1);
}

public 
Hook_Terr_Win( )
{
    
gCountTScore++;
}

public 
Hook_CT_Win( )
{
    
gCountCTScore++;
}

public 
Score()
{
    if ( 
get_pcvar_numenabled ) == )
    {
    
    if(
gCountTScore == 10)
        {  
       
CheckTeams();
        }
    
    if(
gCountCTScore == 10)
        {
       
CheckTeams();
        }
}
}

public 
reset_score( )
{
    
gCountCTScore 0;
    
gCountTScore 0;
}

public 
status(id)
{
    if ( 
get_pcvar_numenabled ) == )
    {    
    
client_print(idprint_chat,"[Ct Wins]: %d | [Ter Wins]: %d",gCountCTScore,gCountTScore);
   }
    else
    {
        
client_print(idprint_chat,"Server Not Mixed");
    return 
PLUGIN_HANDLED;
   }
}

CheckTeams()
{
    new 
iPlayers[32], iNum;
    
get_players(iPlayersiNum);
            
    for(new 
iiNumi++)
    {
        if(
<= get_user_team(iPlayers[i]) <= 2)
        {
            
cs_set_user_team(iPlayers[i], (get_user_team(iPlayers[i]) == 1) ? CS_TEAM_CT CS_TEAM_T);
        }
    }

not working
Ahmad111 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-05-2020 , 09:52   Re: [ReQ] teams switch after round 10
Reply With Quote #26

Quote:
Originally Posted by Ahmad111 View Post
can any one compile effex code with out errores?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Unknown yet"
#define VERSION "1.0"
#define AUTHOR "EFFEX"

new g_iRoundsWon[CsTeams], CsTeams:g_csTeamWon
new bool:g_bPluginOnbool:g_bTeamsSwitchedpCvarMinRoundsToSwitch

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pCvarMinRoundsToSwitch register_cvar("minrounds_to_switch""10")
    
register_concmd("amx_switch""cmdStopSwitch"ADMIN_KICK"<1|0> - turn the switch plugin on/off")
    
    
register_event("TextMsg""event_roundRestarted","a""2&#Game_C""2&#Game_w")
    
register_event("SendAudio""event_TerroristsWin","a""2&%!MRAD_terwin"
    
register_event("SendAudio""event_CTerroristsWin","a""2&%!MRAD_ctwin")
    
    
g_bPluginOn true
}

public 
cmdStopSwitch(idiLeveliCid)
{
    if(!
cmd_access(idiLeveliCid2))
        return 
PLUGIN_HANDLED
        
    
new szMode[3]
    
read_argv(1szModecharsmax(szMode))
    
    
g_bPluginOn bool:str_to_num(szMode)
    
console_print(id"[AMXX]: The switch teams is now %sativated!"g_bPluginOn "" "de")
    return 
PLUGIN_HANDLED
}

public 
event_roundRestarted()
{
    if(!
g_bTeamsSwitched)
    {
        
g_iRoundsWon[CS_TEAM_T] = g_iRoundsWon[CS_TEAM_CT] = 0
    
}
    else 
g_bTeamsSwitched false
}

public 
event_TerroristsWin()
{
    if(!
g_bPluginOn)
        return
        
    if(++
g_iRoundsWon[CS_TEAM_T] >= get_pcvar_num(pCvarMinRoundsToSwitch))
    {
        
g_csTeamWon CS_TEAM_T
        set_task
(0.1"printColoredHudMessage", .flags "a", .repeat 30)
        
        
set_task(3.5"switchTeams")
    }
}

public 
event_CTerroristsWin()
{
    if(!
g_bPluginOn)
        return
    
    if(++
g_iRoundsWon[CS_TEAM_CT] >= get_pcvar_num(pCvarMinRoundsToSwitch))
    {
        
g_csTeamWon CS_TEAM_CT
        set_task
(0.1"printColoredHudMessage", .flags "a", .repeat 30)
        
        
set_task(3.5"switchTeams")
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-05-2020 , 11:41   Re: [ReQ] teams switch after round 10
Reply With Quote #27

Quote:
Originally Posted by Ahmad111 View Post
not working
Impossible, I'm using this plugin
You certainly don't try
That is why this issue has been prolonged
alferd is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 11:43   Re: [ReQ] teams switch after round 10
Reply With Quote #28

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

new const Version[] = "0.3";

new 
g_iRoundsWonCsTeams ] , g_pCvarRoundsToSwitch g_bPluginOn;

public 
plugin_init() 
{
    
register_plugin"Team Switcher" Version "bugsy" );
    
    
g_pCvarRoundsToSwitch register_cvar"ts_switchatwonrounds" "10" );
    
    
register_clcmd"say /switch" "ToggleSwitch" );
    
register_clcmd"say_team /switch" "ToggleSwitch" );

    
register_clcmd"say /status" "ShowStatus" );
    
register_clcmd"say_team /status" "ShowStatus" );
    
    
register_event"SendAudio" "TWin" "a" "2&%!MRAD_terwin" );
    
register_event"SendAudio" "CTWin" "a" "2&%!MRAD_ctwin" );

    
g_bPluginOn true;
}

public 
ToggleSwitchid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
    
    
g_bPluginOn = !g_bPluginOn;
    
    
client_printid print_chat "[AMXX]: The switch teams is now %sactivated!" g_bPluginOn "" "de-" );
    
    return 
PLUGIN_HANDLED;
}

public 
ShowStatusid )
{
    if ( !( 
get_user_flagsid ) & ADMIN_KICK ) )
        return 
PLUGIN_HANDLED;
        
    if ( 
g_bPluginOn )
    {    
        
client_print(idprint_chat,"* [CT Wins]: %d  |  [T Wins]: %d" g_iRoundsWonCS_TEAM_CT ] , g_iRoundsWonCS_TEAM_T ] );
    }
    else
    {
        
client_print(idprint_chat,"* Server Not Mixed");
    }
    
    return 
PLUGIN_HANDLED;
}


public 
TWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_T ]++;
        
CheckWinsCS_TEAM_T );
    }
}

public 
CTWin()
{
    if ( 
g_bPluginOn )
    {
        
g_iRoundsWonCS_TEAM_CT ]++;
        
CheckWinsCS_TEAM_CT );
    }
}

CheckWinsCsTeamscsTeam )
{
    new 
iPlayers32 ] , iNum iPlayer CsTeams:csCurrentTeam iTemp;
    
    if ( 
g_iRoundsWoncsTeam ] && !( ( g_iRoundsWoncsTeam ] % get_pcvar_numg_pCvarRoundsToSwitch ) ) ) )
    {
        
get_playersiPlayers iNum );
        
        for ( new 
iNum i++ )
        {
            
iPlayer iPlayers];
            
csCurrentTeam cs_get_user_teamiPlayer );
            
            if ( 
CS_TEAM_T <= csCurrentTeam <= CS_TEAM_CT )
            {
                
cs_set_user_teamiPlayer , ( csCurrentTeam == CS_TEAM_T ) ? CS_TEAM_CT CS_TEAM_T );
            }
        }
        
        
iTemp g_iRoundsWonCS_TEAM_T ];
        
g_iRoundsWonCS_TEAM_T ] = g_iRoundsWonCS_TEAM_CT ];
        
g_iRoundsWonCS_TEAM_CT ] = iTemp;
        
        
set_gamerules_int"CHalfLifeMultiplay" "m_iNumTerroristWins" g_iRoundsWonCS_TEAM_T ] );
        
set_gamerules_int"CHalfLifeMultiplay" "m_iNumCTWins" g_iRoundsWonCS_TEAM_CT ] );
    }

__________________

Last edited by Bugsy; 04-08-2020 at 17:06.
Bugsy is offline
Ahmad111
Member
Join Date: Jul 2019
Old 04-05-2020 , 23:39   Re: [ReQ] teams switch after round 10
Reply With Quote #29

Quote:
Originally Posted by iceeedr View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Unknown yet"
#define VERSION "1.0"
#define AUTHOR "EFFEX"

new g_iRoundsWon[CsTeams], CsTeams:g_csTeamWon
new bool:g_bPluginOnbool:g_bTeamsSwitchedpCvarMinRoundsToSwitch

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pCvarMinRoundsToSwitch register_cvar("minrounds_to_switch""10")
    
register_concmd("amx_switch""cmdStopSwitch"ADMIN_KICK"<1|0> - turn the switch plugin on/off")
    
    
register_event("TextMsg""event_roundRestarted","a""2&#Game_C""2&#Game_w")
    
register_event("SendAudio""event_TerroristsWin","a""2&%!MRAD_terwin"
    
register_event("SendAudio""event_CTerroristsWin","a""2&%!MRAD_ctwin")
    
    
g_bPluginOn true
}

public 
cmdStopSwitch(idiLeveliCid)
{
    if(!
cmd_access(idiLeveliCid2))
        return 
PLUGIN_HANDLED
        
    
new szMode[3]
    
read_argv(1szModecharsmax(szMode))
    
    
g_bPluginOn bool:str_to_num(szMode)
    
console_print(id"[AMXX]: The switch teams is now %sativated!"g_bPluginOn "" "de")
    return 
PLUGIN_HANDLED
}

public 
event_roundRestarted()
{
    if(!
g_bTeamsSwitched)
    {
        
g_iRoundsWon[CS_TEAM_T] = g_iRoundsWon[CS_TEAM_CT] = 0
    
}
    else 
g_bTeamsSwitched false
}

public 
event_TerroristsWin()
{
    if(!
g_bPluginOn)
        return
        
    if(++
g_iRoundsWon[CS_TEAM_T] >= get_pcvar_num(pCvarMinRoundsToSwitch))
    {
        
g_csTeamWon CS_TEAM_T
        set_task
(0.1"printColoredHudMessage", .flags "a", .repeat 30)
        
        
set_task(3.5"switchTeams")
    }
}

public 
event_CTerroristsWin()
{
    if(!
g_bPluginOn)
        return
    
    if(++
g_iRoundsWon[CS_TEAM_CT] >= get_pcvar_num(pCvarMinRoundsToSwitch))
    {
        
g_csTeamWon CS_TEAM_CT
        set_task
(0.1"printColoredHudMessage", .flags "a", .repeat 30)
        
        
set_task(3.5"switchTeams")
    }

its not working
Ahmad111 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-05-2020 , 23:43   Re: [ReQ] teams switch after round 10
Reply With Quote #30

You asked to pass the code without errors, not to correct any problems.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 19:09.


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