Isn't player alive is already connected? Think about it.
Also when adding flag a to the third argument in get_players that will allow you to only retrieve alive players so there is no need to check for is_user_alive.
The whole code is redundant, optimize your code by reorganizing it.