Thread: status for mix
View Single Post
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-27-2020 , 09:22   Re: status for mix
Reply With Quote #2

Untested. Was already working on a swap system while i didn't realise u have a command for that, that's why there's code between comment lines.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <colorchat>

#define PLUGIN "MixSwap"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new szTextMsg
new iTerWin;
new 
iCtWin;

//new CsTeams:iOldTeam;
//new CsTeams:iNewTeam;

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say /status""ShowScore");
    
    
szTextMsg get_user_msgid("TextMsg");
    
register_message(szTextMsg"msgTextMsg");
}

public 
msgTextMsg()
{
    static 
szMsg[22];
    
get_msg_arg_string(2szMsgcharsmax(szMsg));
    
    if(
equal(szMsg"#Terrorists_Win"))
    {
        
iTerWin++;
        if(
iTerWin == 9)
        {
            
server_cmd("amx_swap");
            
iTerWin iCtWin;
            
//CheckTeams();
        
}
        else if(
iTerWin == 15)
        {
            
server_cmd("amx_warm");
        }
    }
    
    
    else if(
equal(szMsg"#CTs_Win"))
    {    
        
iCtWin++;
        if(
iCtWin == 9)
        {
            
server_cmd("amx_swap");
            
iCtWin iTerWin;
            
//CheckTeams();
        
}
        
        else if(
iCtWin == 15)
        {
            
server_cmd("amx_warm");
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
ShowScore(id)
{
    
ColorChat(idGREEN"[CT WINS]: %i | [TER WINS]: %i"iCtWiniTerWin);
}

/*CheckTeams()
{
    new iPlayers[32], iNum;
    get_players(iPlayers, iNum);
            
    for(new i; i < iNum; i++)
    {
        iOldTeam = cs_get_user_team(iPlayers[i]);
                
        if(iOldTeam == CS_TEAM_T)
        {
            iNewTeam = CS_TEAM_CT;
        }
        else if(iOldTeam == CS_TEAM_CT)
        {
            iNewTeam = CS_TEAM_T;
        }
        cs_set_user_team(iPlayers[i], iNewTeam);
    }
}* 
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be