Back when I had good friends .... I never had money to lend or give.
Today (at 42) ....I have money to lend, but very few I would even consider lending to. Most of my friends are now nothing more than acquantances and if they were to ask for money (loan or gift) I would have no qualms saying no.
There is only one couple (the guardians for our kids) that I know would only ever ask if they were dire, and I would not hesitate to give them whatever they asked for .... but would do so with no expectation of any repayment.
I think if you give money to a friend, you need to do it as a gift with no expectation of being re-paid. If being repaid is conditional, you should do it as a business agreement, with a legal contract, and the expectation that the friendship will probably be affected.