PHP Code:
#include <amxmodx>
#include <cstrike>
new t_Score;
new ct_Score;
public plugin_init(){
register_plugin("CT T Switch", "1.0", "Author")
register_event("DeathMsg", "deathmsgevent", "a")
}
public deathmsgevent(){
new iKiller = read_data(1)
new iKillertwo = read_data(1)
if( get_user_team(iKiller) == 1 )
{
t_Score++
if( t_Score == 10 )
{
if(get_user_team(iKiller) == CS_TEAM_T){
cs_set_user_team(iKiller,CS_TEAM_CT)
cs_set_user_team(iKillertwo,CS_TEAM_T)
}
else{
client_print(0, print_chat, "Something is wrong! TERRORIST")
}
}
else{
return PLUGIN_CONTINUE;
}
}
if( get_user_team(iKillertwo) == 1 )
{
ct_Score++
if( ct_Score == 10 )
{
if(get_user_team(iKillertwo) == CS_TEAM_CT){
cs_set_user_team(iKiller,CS_TEAM_CT)
cs_set_user_team(iKillertwo,CS_TEAM_T)
}
else{
client_print(0, print_chat, "Something is wrong! CT")
}
}
else{
return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE;
}
I don't know is this ok, or maybe I need to change here?
PHP Code:
###
if(get_user_team(iKiller) == CS_TEAM_T)
###
if(get_user_team(iKillertwo) == CS_TEAM_CT)
###
with:
PHP Code:
###
if(get_user_team(iKiller) == 1)
###
if(get_user_team(iKillertwo) == 1)
###