I am able to tell when im not spectating in first person.
Code:
public plugin_init()
{
set_task(1.0, "check_spectating", 123094, "", 0, "b", 0)
}
public check_spectating()
{
new id = blinkID()
if(!is_user_connected(id) || cs_get_user_team(id) != CS_TEAM_SPECTATOR)
return
if( (1 << pev(id, pev_iuser1)) & ((1 << 1)|(1 << 2)|(1 << 4)))
{
new player = pev(id, pev_iuser2);
if(is_user_alive(player) )
{
g_target = player
}
}
else
{
client_print(id, print_chat, "Not spectating a Player!")
// Switch to next alive player. How?
}
}
*How can i switch camera to next alive player?
I want this because if no players are connected, camera goes to freelook. So every second I want to check if alive player is available....then move camera to alive player.