Quote:
Originally Posted by MerreBigger
Can you do it for me please? i don't understand..
|
This should do the trick:
PHP Code:
#include <amxmodx>
#include <cstrike>
#define VERSION "0.0.3"
#define MAX_PLAYERS 32
public plugin_init()
{
register_plugin( "Switch Teams On Ct Wins", VERSION, "ConnorMcLeod" );
// leave both if you want teams to swap when any of the teams win
register_event( "SendAudio", "Event_SendAudio_MRAD_ctwin", "a", "1=0", "2=%!MRAD_ctwin" ); // remove this if you only want teams to swap when Ts win
register_event( "SendAudio", "Event_SendAudio_MRAD_terwin", "a", "1=0", "2=%!MRAD_terwin" ); // remove this if you only want teams to swap when CTs win
}
public Event_SendAudio_MRAD_ctwin()
SwitchTeams();
public Event_SendAudio_MRAD_terwin()
SwitchTeams();
public SwitchTeams()
{
new iPlayers[ MAX_PLAYERS ];
new iNum;
new id;
get_players( iPlayers, iNum );
for ( new i = 0; i < iNum; ++i )
{
id = iPlayers[ i ];
switch ( cs_get_user_team( id ) )
{
case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT, CS_CT_GIGN );
case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T, CS_T_LEET );
}
}
}