How do I disable one button out of multiple buttons without spamming declaration?

Hi,

I need some efficient coding help for my problem.
My script goes like this,

void OnGUI ()
{
    if (GUI.Button(0, 0.....))
    playerSpeed += 10;

    if (GUI.Button(0, 50,.....))
    bulletSpeed += 10;
}

That may seem simple enough. Now imagine copy pasting that GUI.Button for about 50 times.

My question is, I want to make sure that the same button is unclickable if it has been clicked before.
The most no-brainer way, is the most troublesome way, where I declare 50 bools, one for each, so it does nothing when clicked. But I’m sure there is a much efficient way of doing this.

Any ideas to help?

Thanks in advance!

How paramaterised is ‘DoSomething’? This seems like the kind of thing that could be simplified into a single for-loop! In any case, an array of booleans is the way to go-

bool[] buttonsPressed = new bool[50];

Afterwards:

for(int i = 0; i < buttonsPressed.Length; ++i) {
    GUI.enabled = !buttonsPressed*;*

if(GUI.Button(/* Paramaters in terms of i! */)) {
DoSomethingInTermsOfI(i);
buttonsPressed = true;
}
}
GUI.enabled = true; // Edited per @Benproductions1’s suggestion!