Use with register_event. TeamInfo is sent to all players (I think) to let themknow someone has changed teams. Use read_data(1) to get id, and read_data(2) to get team name.
Also, you should be using a switch instead of if...else if. Definitely do not call cs_get_user_team 4 times...