Replace the
showteam function with the following as see if it fixes your problem.
Code:
public showteam(id)
{
if(!get_cvar_num("sv_teamalert"))
{
return PLUGIN_HANDLED
}
new CsTeams:playerTeam = cs_get_user_team(id)
if(get_cvar_num("sv_tatext") && is_user_connected(id))
{
switch(playerTeam)
{
case CS_TEAM_CT:
{
set_hudmessage(0, 0, 255, 0.42, 0.53, 2, 6.0, 4.0, 0.1, 0.2, -1)
show_hudmessage(id, "Your Current Team is CT")
}
case CS_TEAM_T:
{
set_hudmessage(255, 0, 0, 0.42, 0.53, 2, 6.0, 4.0, 0.1, 0.2, -1)
show_hudmessage(id, "Your Current Team is T")
}
}
}
if(get_cvar_num("sv_tafade") && is_user_connected(id))
{
switch(playerTeam)
{
case CS_TEAM_CT:
{
set_task(0.1,"ct_fade",id)
}
case CS_TEAM_T:
{
set_task(0.1,"t_fade",id)
}
}
}
return PLUGIN_CONTINUE
}
I went for the simplest bandaid I could. IMO, the plugin needs to be refactored.
Edit:
@allenwr:
I suggest removing the following three commands. Rationale being that none of them will be called with any regularity and the functionality of each can be, and is being, handled by CVARs. Therefore they are useless at best. They unnecessarily add to the size and complexity of both your code and the amx_help command listing.
Code:
register_concmd("amx_teamalert","alert10",ADMIN_CVAR,"1/0 Turns Team Alert on or off") //commands
register_concmd("amx_tafade","fade10",ADMIN_CVAR,"1/0 Turns color fade on or off")
register_concmd("amx_tatext","text10",ADMIN_CVAR,"1/0 Turns Printed Message fade on or off")
I also recommend you change your
get_cvar_ functions with the
get_pcvar_ family of functions. They are more efficient.
__________________