Can't get my code to work any suggestions?

Hi my code currently is not completely working the way i want i'm kinda new to arduino right now all my lamps act correctly the way i want but when i want to press the button i want all leds to stop flickering and only the green one to turn on for 3 seconds and than turn off after that i want the loop to continue again unless i press the button any idea's? this is my code

const int buttonPin = 7;
const int ledGroen = 4;
int buttonState = 0;
int ledpins[5]={2,3,4,5,6};

void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledGroen, OUTPUT);
for(int i=0; i<5; i++){
pinMode(ledpins*,OUTPUT);*

  • }*
    }
    void loop() {
  • for(int i=0; i<5; i++){*
    _ digitalWrite(ledpins*, HIGH);_
    _
    delay(25);_
    _ digitalWrite(ledpins, LOW);*_

* buttonState = digitalRead(buttonPin);*
* if(buttonState == HIGH){*
_ digitalWrite(ledpins*, LOW);
digitalWrite(ledGroen, HIGH);
delay(3000);
digitalWrite(ledGroen, LOW);
}
}
}*_

Please take a look at Read this before posting a programming question and follow the advice about posting code

To set the pinMode of your leds as well as turn them off/on, you need to access each member of the array individually

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(ledGroen, OUTPUT);
  for (int i = 0; i < 5; i++) {
    pinMode(ledpins[i], OUTPUT);
  }
}

The same is true for accessing them in your loop() function, but I'll let you figure that out.

How do you have your button wired up? Does it have a pull-down resistor attached? Your code will require one to be present to prevent your button pin from "floating" which can give you either HIGH or LOW on any given moment. A better way would be to wire one side of your button to ground, the other to your pin and then set the mode to INPUT_PULLUP which keeps the button HIGH when not pressed and then LOW when you press it and connect it to ground.

To set the pinMode of your leds as well as turn them off/on, you need to access each member of the array individually

That is what the OPs code does but due to the fact that he/she did not use code tags the array indices have been interpreted as HTML italic tags