#include <iostream>
#include <string>
#include <string.h>
#include <fstream>
#include <cctype>
#include <locale>
#include <cstdlib>
#include "RPGStats.h"
#include "RPGcharcreator.h"
usingnamespace std;
int charcreat()
{
int class1 = 1; //warrior
/*int class2 = 2; //rogue
int class3 = 3; //wizard
int class4 = 4; //berserker
int class5 = 5; //monk
int class6 = 6; //warlock
int class7 = 7; //sage
int class8 = 8; //paladin
int class9 = 9; //sniper*/
string optionsetup = "";
string setupn = "n";
string setupy = "y";
setup:
cout << "Welcome to RPG! Please select the class for your 4 heroes you want for your\nadventure.\n" << endl;
system ("pause");
using hero1stats::hero1;
using hero2stats::hero2;
using hero3stats::hero3;
using hero4stats::hero4;
hero1setup:
cout << "Warrior(1)\nRogue(2)\nWizzard(3)\nBerserker(4)\nMonk(5)\nWarlock(6)\nSage(7)\nPaladin(8)\nSniper(9)\n" << endl;
cout << "The first heroes class: ";
cin >> hero1;
if (hero1 = 1)
{
cout << "********************************************************************************\n" <<endl;
cout << "The Warrior, an expert but not master in all melee weapons, this class gets a\nbonus to of +5 strength, +5 to all weapon skills, and can wield up to an armor\nclass of 4(plate armor) naturally." << endl;
h1setuprestart:
cout << "Is this the class you want? (y/n)" << endl;
cin >> optionsetup;
if (optionsetup == setupy)
{
hero1 = class1;
//place class bonus here
}
if (optionsetup == setupn)
{
goto hero1setup;
}
while(optionsetup != setupn && optionsetup != setupy){cout << "Invalid, command, please try again."<< endl; goto h1setuprestart;}
}
system ("pause");
return 0;
}
I get the error of "New declaration 'int charcreat()' in charcreate
and the error 'ambiguates old deceleration 'void charcreate()'in charcreator header file
#ifndef RPGSTATS_H
#define RPGSTATS_H
namespace hero1stats
{
int hero1 = 0;
int h1lvl = 1;
int h1str = 5;
int h1agi = 5;
int h1int = 5;
int h1wis = 5;
int h1lk = 5;
}
namespace hero2stats
{
int hero2 = 0;
int h2lvl = 1;
int h2str = 5;
int h2agi = 5;
int h2int = 5;
int h2wis = 5;
int h2lk = 5;
}
namespace hero3stats
{
int hero3 = 0;
int h3lvl = 1;
int h3str = 5;
int h3agi = 5;
int h3int = 5;
int h3wis = 5;
int h3lk = 5;
}
namespace hero4stats
{
int hero4 = 0;
int h1lvl = 1;
int h1str = 5;
int h1agi = 5;
int h1int = 5;
int h1wis = 5;
int h1lk = 5;
}
#endif
////////////////////////////////////////////////////////////////////////////////
I don't know what I'm doing wrong and would like some advice, this is my first time doing a long term large project. :P