all my 240 circuits aren't working anymore in sub panel but the sub panel is getting 240 volts
If you have 240 at the main lugs of the sub and do not have 240v at the breakers the main breaker could be bad. I have had a main breaker fail on 1 hammer (the contacts inside the breaker) on more than 1 occasion. In some cases with all the load breakers turned off cycle the main 10 times on and off This can temporarily clean the contact and make it useful until the bkr or panel can be replaced.
If this is a lug only (no main on the sub)
 your buss on one of the legs may have fried since you said all the 240v breakers ,,, I have had this happen with FPE stab lock but it can happen with all brands of panels but I have only had buss failures on FPE and any problems with FPE stab lock needs replacement of the panel in my opinion, I won't do any work on them except to replace them.