Honda didn't start when hot?

I hi my honda is giving me problems. It starts and i can drive it but if i drive far and turn it off and wait 10min it won't start any more and i have to wait half an hour for it to start i already changed the relay the one under the drivers side. Its a honda accord 98 any suggestions? Drove it today and it started fine ran good and stopped at the market for 10 min came back didn't turn on tried a few times but the battery was gonna give out. Waited 30min and it started.

Hi so when was the last time it saw the inside of a honda dealer garage for a service as they would fix it.

Distributor could have oil in it.