My code selects items from a comboBox by its index number then assigns a specific byte to each item. For this I am using the If statement and am having to repeat it so many times.
I know how to use loops very basically but I haven't got a clue how to do it when each item needs a different value assigned to it.
if (weaponcamCombo.SelectedIndex == 0)
{
PS3.SetMemory(Offsets.WeaponCamo + (0x80 * (uint)camoclassUD.Value) + (0x564 * (uint)camosoldierUD.Value), new byte[] { 0x0A });
}
if (weaponcamCombo.SelectedIndex == 1)
{
PS3.SetMemory(Offsets.WeaponCamo + (0x80 * (uint)camoclassUD.Value) + (0x564 * (uint)camosoldierUD.Value), new byte[] { 0x0B });
}
if (weaponcamCombo.SelectedIndex == 2)
{
PS3.SetMemory(Offsets.WeaponCamo + (0x80 * (uint)camoclassUD.Value) + (0x564 * (uint)camosoldierUD.Value), new byte[] { 0x0C });
}
As you see a specific byte is assigned to each item, I was wondering how I would still do this but in a loop?
Thanks
0X0F + 4?