Raised This Month: $ Target: $400
 0% 

Switch Teams on T win?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ImYourBro
Senior Member
Join Date: Jun 2014
Old 06-07-2018 , 10:29   Switch Teams on T win?
Reply With Quote #1

Hello

Im searching for a plugin that swap teams on t win.

Thanks
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-07-2018 , 10:46   Re: Switch Teams on T win?
Reply With Quote #2

What you mean? Swap players team on every time a team win the round, or only in the first time?
__________________








CrazY. is offline
ImYourBro
Senior Member
Join Date: Jun 2014
Old 06-07-2018 , 15:22   Re: Switch Teams on T win?
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
What you mean? Swap players team on every time a team win the round, or only in the first time?
Every time Terrorist wins, teams should we swapped. When CT wins, nothing should happen
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-08-2018 , 00:44   Re: Switch Teams on T win?
Reply With Quote #4

Quote:
Originally Posted by ImYourBro View Post
Every time Terrorist wins, teams should we swapped. When CT wins, nothing should happen
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define isTeam(%0)         (CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_CT)

new bool:TWin
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("SendAudio""EventTRWin","a""2&%!MRAD_terwin")
    
register_event("HLTV","EventNewRnd""a""1=0""2=0")
    
register_logevent"LogeventEndRound"2"1=Round_End" 
}

public 
EventTRWin()
    
TWin true

public EventNewRnd()
    
TWin false
    
public LogeventEndRound()
{
    if(
TWin)
    {
        new 
iPlayers[MAX_PLAYERS], iNum
        get_players
(iPlayersiNum"ch")
        for(new 
iidiNum;i++)
        {
            
id iPlayers[i]
            
            if(
isTeam(id))
                
cs_set_user_team(id, (cs_get_user_team(id) == CS_TEAM_T) ? CS_TEAM_CT CS_TEAM_T)
        }
    }

iceeedr is offline
Send a message via Skype™ to iceeedr
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-07-2018 , 12:39   Re: Switch Teams on T win?
Reply With Quote #5

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

new boolterrorWon

public plugin_init()
{
    
register_plugin("Swap on T Win""1.0""DiGiTaL")
    
register_event("SendAudio""TerrorWon""a""2=%!MRAD_terwin");
    
register_logevent"LogeventEndRound"2"1=Round_End" )
}

public 
TerrorWon() terrorWon true;

public 
LogeventEndRound()
{
    if(
terrorWon)
    {
        new 
players[32], iNum
        get_players
(playersiNum)
        for(new 
i=0iNumi++)
        {
            
players[i]
            switch(
cs_get_user_team(x))
            {
                case 
CS_TEAM_Tcs_set_user_team(xCS_TEAM_CT)
                case 
CS_TEAM_CTcs_set_user_team(xCS_TEAM_T)
            }
        }
        
terrorWon false;
    }

instinctpt1 is offline
ImYourBro
Senior Member
Join Date: Jun 2014
Old 06-07-2018 , 15:18   Re: Switch Teams on T win?
Reply With Quote #6

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

new boolterrorWon

public plugin_init()
{
    
register_plugin("Swap on T Win""1.0""DiGiTaL")
    
register_event("SendAudio""TerrorWon""a""2=%!MRAD_terwin");
    
register_logevent"LogeventEndRound"2"1=Round_End" )
}

public 
TerrorWon() terrorWon true;

public 
LogeventEndRound()
{
    if(
terrorWon)
    {
        new 
players[32], iNum
        get_players
(playersiNum)
        for(new 
i=0iNumi++)
        {
            
players[i]
            switch(
cs_get_user_team(x))
            {
                case 
CS_TEAM_Tcs_set_user_team(xCS_TEAM_CT)
                case 
CS_TEAM_CTcs_set_user_team(xCS_TEAM_T)
            }
        }
        
terrorWon false;
    }

Doesnt seem to work correctly. Shouldn't you turn around the cs_set_user_team?
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-08-2018 , 00:35   Re: Switch Teams on T win?
Reply With Quote #7

Quote:
Originally Posted by ImYourBro View Post
Doesnt seem to work correctly. Shouldn't you turn around the cs_set_user_team?
What not working correctly.. elaborate pls
I tested this now on 183 and it's working correctly
instinctpt1 is offline
ImYourBro
Senior Member
Join Date: Jun 2014
Old 06-08-2018 , 03:16   Re: Switch Teams on T win?
Reply With Quote #8

Quote:
Originally Posted by instinctpt1 View Post
What not working correctly.. elaborate pls
I tested this now on 183 and it's working correctly
What happended for was that everytime T won it didnt swap, everytime CT won they swapped teams.
__________________
Hello!
I'm learning AMXX right now, so please No Hate if i suck

-----------------------------------------------------------------------
Check out my Furien Mod v0.3 here

ImYourBro is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-08-2018 , 04:51   Re: Switch Teams on T win?
Reply With Quote #9

Quote:
Originally Posted by ImYourBro View Post
What happended for was that everytime T won it didnt swap, everytime CT won they swapped teams.
You must be using some other plugin then ..
Coz in my code there is no event on CT win .. so they can never swap automatically
Check your plugins and test it again !

Edit : Tested .. Everything is fine !

Last edited by instinctpt1; 06-08-2018 at 04:55. Reason: tested
instinctpt1 is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-07-2018 , 13:05   Re: Switch Teams on T win?
Reply With Quote #10

I m making a "Confusing Swapping Mod" xD
Will upload soon
__________________

Last edited by CrAzY MaN; 06-07-2018 at 13:05.
CrAzY MaN 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 04:42.


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