Hi, I need help with detecting when a player changes a team(including SPEC). Also, either within that function or using another method I need to detect team changes within one round as well. This is for CS1.6
I've tried using client_infochanged but it detects more then just team change.
like so..
Code:
public client_infochanged(id)
{
if(cs_get_user_team(id)==CS_TEAM_CT)
{
client_print(id,print_chat,"CT");
}
else if(cs_get_user_team(id)==CS_TEAM_T)
{
client_print(id,print_chat,"TERRORIST");
}
return PLUGIN_CONTINUE
}
Here are some other functions I've got
Code:
public event_new_round()
{
log_amx("NEWROUND EVENT TRIGGERED")
new players[32], num
get_players(players, num,"e","SPECTATOR");
for (new i; i < num; ++i)
{
new is_PLAYER_SPEC = cs_get_user_team(players[i]) == CS_TEAM_SPECTATOR
if(is_PLAYER_SPEC)
{
log_amx("PLAYER WENT SPEC")
}
}
return PLUGIN_CONTINUE
}
That seems to think you went spec even when you didn't.
I've also tried making a check function on spawn
Code:
public check_team(id)
{
new newteam[33]
get_user_team(id, newteam, 32 )
if(!equali(newteam,stored_team))
{
// DO TASK
}
return PLUGIN_CONTINUE
}
And on deathmsg doing "get_user_team(victim, stored_team, 32 )" to store the team for compare on spawn.
anyway, can anyone help me with the best way to do this?
__________________