Problem with IR receiver

I couldn't use results.value in any other way

Why not? I did that in my remote code.

Of course, you can only use the value in results.value up to the point where you do the irrecv.resume(), which you do right away.

You should learn to develop functions. Your loop() function is WAY too long. Learning to use local variables would be good, too.

So would using the space bar. Putting things in logical order would be useful, too.

  if (x<41&&x>30){

really would look at lot better, and be far easier to read as

  if(x > 30 && x < 41)
  {
if (ir==16720605) {
    onoff=1;
    s1=85;
    s2=86;
    delay(100);
    ir=0;

Why is the delay() there? Putting it after you use s1 and s2 might make sense. Putting it here does not.