[HELP]C++ COD4 class generator
hi im having some problems coding my class generator. what it does is takes arrays (about 12 i think) 1 containing assault guns antother containg smg,antother containg lmg,antother containg sniper,antother containg shotgun,antother containg special grenades, antother containg perk slot 1 antother containg perk slot 2, antother containg perk slot 3. the thing im having trouble with is:
(i will put what the array is in () next to it)
cout<<"What main gun do you want?((A)ssasult/(S)ub machinegun/(L)LMG/(G)Shot gun/(N) Sniper): ";
cin>>gunsel;
if(gunsel=='a' || gunsel =='A')
{
system("CLS");
cout<<"Your gun is: "<<arr1[a]<<endl;
cout<<"Your attachment is: "<<arr2[b]<<endl;
if(arr2[b]==arr2[1])
{
cout<<"Perk 1: None"<<endl;
cout<<"Perk 2: "<<arr4[d]<<endl;
cout<<"Perk 3: "<<arr5[e]<<endl;
else
{
cout<<"Perk 1: "<<arr7[a]<<endl;
cout<<"Perk 2: "<<arr4[a]<<endl;
cout<<"Perk 3: "<<arr5[a]<<endl;
cout<<"Would you like a new gun(Y/N): ";
cin>>newg;
if(newg=='y'||newg=='Y')
{
cout<<"What gun?(A,S,L,G,N): ";
cin>>gunsel;
}
so for my problem:
lets say the output is:
your gun is: M4A1
your attacment is: RDS
Perk 1: 3x grenade
perk 2: Overkill
perk 3: deep impact
special: stun
so as u can see perk 2 is overkill... where would i put in the code to say:
if perk 2 equals arr4[1](1 is overkill) then display a message saying your secondary gun is:..... and move on to perk 3 and special grenade...
when i get this app fineshed i will post it and i will start on a mw2 class generator... THANKS FOR TH HELP!
(i will put what the array is in () next to it)
cout<<"What main gun do you want?((A)ssasult/(S)ub machinegun/(L)LMG/(G)Shot gun/(N) Sniper): ";
cin>>gunsel;
if(gunsel=='a' || gunsel =='A')
{
system("CLS");
cout<<"Your gun is: "<<arr1[a]<<endl;
cout<<"Your attachment is: "<<arr2[b]<<endl;
if(arr2[b]==arr2[1])
{
cout<<"Perk 1: None"<<endl;
cout<<"Perk 2: "<<arr4[d]<<endl;
cout<<"Perk 3: "<<arr5[e]<<endl;
else
{
cout<<"Perk 1: "<<arr7[a]<<endl;
cout<<"Perk 2: "<<arr4[a]<<endl;
cout<<"Perk 3: "<<arr5[a]<<endl;
cout<<"Would you like a new gun(Y/N): ";
cin>>newg;
if(newg=='y'||newg=='Y')
{
cout<<"What gun?(A,S,L,G,N): ";
cin>>gunsel;
}
so for my problem:
lets say the output is:
your gun is: M4A1
your attacment is: RDS
Perk 1: 3x grenade
perk 2: Overkill
perk 3: deep impact
special: stun
so as u can see perk 2 is overkill... where would i put in the code to say:
if perk 2 equals arr4[1](1 is overkill) then display a message saying your secondary gun is:..... and move on to perk 3 and special grenade...
when i get this app fineshed i will post it and i will start on a mw2 class generator... THANKS FOR TH HELP!
