there are some people who are your friend in the time of need,and they ignore you the other times,so what do you call them? a poet calls them "flies around a sweetmeat".
The term I would use is "false friends."
"What you mean, 'We,' kemosabe?"
This [the following additions, to obey the site's rules to the letter] is very much like having to explain a joke after you've told it, but Howard Schweber writes at The World Post, 1969:
In a classic Mad Magazine cartoon ... the Lone Ranger and Tonto are surrounded by a horde of hostile Indian warriors. The Lone Ranger says to Tonto "what do we do, now?," to which Tonto replies, "what you mean 'we,' kemosabe?"
[Tonto usually referred to his senior partner as 'kemosabe'] [and the 'real' Tonto wouldn't have dreamt of such disloyalty]
The joke is old and quite well known. At the link Punchline Regularly Tossed Out Without the Jokes They Come From, 'Chanteuse' adds: 'I always heard this said, "What mean WE, white man?" ' I came across it recently in one of Trow's Maxwell novels.
Although not exact you may also want to consider
Left out in the cold
Fair weather friend
Dropped like a hot potato
Individual words which apply to the set of circumstances you describe are