You seem to have major concept issues. You should review your "heal" code.
Also NEVER user a full for loop to check every single player slot, use get_players() instead. There ARE still other conceptual issues...
There are countless numbers of "revive" and "heal" plugins. You should just look into it...