They won't get respawned if they join a team from spectators, lets say an admin transfers a user to spectators for being afk, once the user is back they would have to wait for the whole round to be respawned after they pick a team, also i'm pretty sure that if they don't choose a team in the given delay they wouldn't be respawned (which is why I added the DELAY+4.0 in my code, since <5 seconds should be enough to pick a player model). Your way would work if the server is running a plugin that doesn't let the user pick a team.
Also, probably hooking the "joinclass" command would be better than join team event (again if the server is not running some kind of auto team join plugin + it removes the question of "what if they don't pick a model in a given time frame")
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#pragma semicolon 1
#define IsPlayer(%1) (1<=%1<=32)
#define DELAY 1.0
public plugin_init(){
register_plugin("MY", "NAME", "JEFF");
RegisterHam(Ham_Killed, "player", "ham_PlayerKilledPost", 1);
register_clcmd("joinclass", "clcmd_JoinClass");
}
public ham_PlayerKilledPost(id){
if(!task_exists(id))
set_task(DELAY, "task_Respawn", id);
}
public clcmd_JoinClass(id){
if(!task_exists(id))
set_task(DELAY, "task_Respawn", id);
}
public task_Respawn(id){
if(get_user_team(id)!=3 && IsPlayer(id))
ExecuteHamB(Ham_CS_RoundRespawn, id);
}