Trying to regulate 24V from 24-30V 3A input
The real question is: why the hell do you want to feed regulated DC to a motor?.... 

If it needs to be run at a constant RPM, use a PWM speed controller with a speed sensor.

If it will overheat and burn at 30V (but not at 24V) use a PWM to keep the average voltage on the motor at 24V.

Most likely the motor will run just fine on 24 - 30VDC, and you don't need any regulation at all.

LM338 has 2-3V dropout voltage anyway, so with 24V in, you'll only get 22V out maximum.