I tried this stupid solution but it crashed my server:

I also tried calling the function from:
register_logevent( "SwapAlivePlayers", 2, "1=Round_End" );
Instead of:
register_event("SendAudio", "SwapAlivePlayers", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "SwapAlivePlayers", "a", "2&%!MRAD_ctwin")
Still does not work so seems to be an issue with seting dead players.
Can someone test on their system? :S
PHP Code:
public SwapAlivePlayers()
{
new players[32];
new playercount;
get_players(players, playercount, "h");
new i, id
for (i=0; i<playercount; i++)
{
id = players[i];
new playerTeam = cs_get_user_team(id);
if (playerTeam != CS_TEAM_SPECTATOR && playerTeam != CS_TEAM_UNASSIGNED)
{
if (playerTeam == CS_TEAM_T)
{
engclient_cmd(id, "jointeam", "2");
engclient_cmd(id, "joinclass", "5");
}
else
{
engclient_cmd(id, "jointeam", "1");
engclient_cmd(id, "joinclass", "5");
}
}
}
}