So you want something to be done for alive players, and other thing to be done for dead players?
If so, the best way you can use is get_players and flag "a" for alive players, and flag "b" for dead players. Loop trough the number of players got, and do the thing.