My question involves an eviction in the state of: California

In October, I told the management company that I lost my income, and that I would be late for rent. I was starting a new job in the beginning of December, and asked if either I could pay rent late for the next few months and if not, I would move. I told them I would try to sell stuff to get rent, until I started working again.We agreed to the following:

pay in the beginning of Nov for Oct rent
pay in the beginning of Dec for Nov rent
pay middle of month of Dec for Dec rent (I have started working at this point and have money coming in.)

I paid rent for Oct in Nov as described above. I asked for a written confirmation of our agreement, and when they didn't send, I followed up with an email stating the above myself.

The problem is when Dec came around, they demanded both Nov and Dec rent all at once. (Just three weeks after I paid for Nov. No way could I do that, but still tried to pay Nov rent and reminded them about the agreement, but to no avail. They wouldn't accept anything but both months rent. I had a new agent I was dealing with and he wouldn't deny or confirm getting the email about our agreement. When their lawyer got involved, (by this point the middle of the month) I offered to pay both month's due and told them I would move out if they stop the process. The response I got was "the landlord already paid for the eviction and it was too late.)

I took another job starting March 1 outside the state. Was going to move and just send them the check for the two months but was advised not to leave until going to court, otherwise even by paying I could still lose by not showing up. So now I wait for the court date, having no where else to live, I have remained in the unit waiting for the court date. We have sent the plantiff's lawyer requests for mediation, letters have been sent to the landlord, etc. We tried over and over to get this settled before the January trial date.

I have no intention of paying for their lawyers fees or for the month of January simply because the plaintiff's lawyer insisted the suit continues when we tried over and over again in dec to pay and to move out if they dropped it. By the way, before we got the unlawful detainer, but after the 3 day notice to quit in dec. we gave them notice to move, which they ignored.

I have the email stating our agreement, and or course records showing they took the Oct payment in Nov. But assuming they lie - any chance I can still win this? Thoughts appreciated...