I'm playing around with a plugin that works sorta like a zombie infection mod where when players die they turn into zombies. Anyways, the teams switch at the end of the round and go to the other team (that they started on the round before). I created an array called g_pTeam[33], and I grab the value when they first join a team. After that, the mod changes their teams during the rounds, but at the end of the round, it gets their g_pTeam[id] value and changes it to the opposite team. Right now I get a couple players every round who do not swap right, I thought it was an issue with autobalance or limitteams, but they are both set to 0. I was just wondering if there was a more efficient way to do this.
Here is an example of the team swap.
Quote:
cs_set_user_team(player, g_pTeam[player] == CS_TEAM_T ? CS_TEAM_CT:CS_TEAM_T)
g_pTeam[player] = cs_get_user_team(player)
|
I also get an error when grabbing and setting the g_pTeam[id] value
Quote:
|
Warning: Tag mismatch on line 601
|
I was wondering how to set it to not get an error. I was thinking making it static or constant would, but that doesn't make sense to me. Thank you for any help.
__________________