PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Team Change"
#define VERSION "1.0"
#define AUTHOR "Niko"
new ter[33]
new cts[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent( "eventRoundStart", 2, "0=World triggered", "1=Round_Start" );
register_logevent( "eventRoundEnd", 2, "0=World triggered", "1=Round_Draw", "1=Round_End" );
register_event( "DeathMsg", "eventDeathMsg", "a" );
}
public client_connect(id){
ter[id]=false;
}
public client_disconnect(id){
ter[id]=false;
}
public eventRoundStart(){
new g_Maxplayers;
g_Maxplayers = get_maxplayers();
for(new i=1; i<=g_Maxplayers; i++){
if(cs_get_user_team(i)==CS_TEAM_T){
ter[i]=true;
}
if(cs_get_user_team(i)==CS_TEAM_T){
cts[i]=true;
}
}
return PLUGIN_HANDLED;
}
public eventRoundEnd(){
new g_Maxplayers;
g_Maxplayers = get_maxplayers();
for(new i=1; i<=g_Maxplayers; i++){
if(ter[i]){
cs_set_user_team(i, CS_TEAM_CT);
ter[i]=false;
}
if(!cts[i] && !ter[i]){
cs_set_user_team(i, CS_TEAM_CT);
}
}
return PLUGIN_HANDLED;
}
public eventDeathMsg(){
new iKiller = read_data( 1 ), iVictim = read_data( 2 );
if(cs_get_user_team(iKiller)==CS_TEAM_CT){
cs_set_user_team(iKiller, CS_TEAM_T)
}
return PLUGIN_HANDLED;
}
I made this one...
If CT kill T, T moved to CT. If player join after round start he will move to CT. If player was T for round start he will move to CT when round end.
if something is wrong...