If the god worshiped happens to be omniscient (often claimed) then all that will ever happen has been preordained. Prayer to change the preordained would be meaningless. The same would cancel any free will.
Being told you're delusional does not necessarily mean you're mental.