I thought rodents like engines because they’re warm. Isn’t that what attracts them to those spots in the first place?
You can't prevent your engine from being warm (assuming you need to use your vehicles), but you can make it less appealing to gnaw on the nice chewy parts of it.