A man was warned he could be jailed after changing his plea and admitting sexually chatting online with someone he believed was 14.