problem in program (if + 3 variables)

That's because of integer maths. 32 * 1000 = 32000. 33 * 1000 = 33000. But a signed int can only hold 215 -1 or 32767. An unsigned int can hold 216 -1 or 65535.

I like to do those calculations outside of the IF statement so that I can add a Serial.println() to check values when something goes wrong. For example

unsigned int myVal = caspodavani*1000;
Serial.println(myVal);
if(aktualniMillis - predchoziMillis > myVal)

...R