(digitalRead(pin)==HIGH && state==LOW);
If that's the line that's supposed to be the "if" then it would surely need the word "if" at the front and to lose the ";" at the end...
if(digitalRead(pin)==HIGH && state==LOW)
State change detect is in the ide file / examples / 2 digital
edit- And here