06-20-2013, 08:42 PM | #1 | |
worst ff player eu
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout Gametype: IvDZ Posts Rated Helpful 18 Times
|
Boo, I suck with C++ D:
Gah.
How do I access something inside a table inside a table? Table: Code:
static struct classstats { int speed, weapon1, weapon2, class_maxhealth; const char *name; } classstats[]= { { 1.3, 6, 0, 70, "Scout" }, { 1, 4, 0, 80, "Sniper" }, { 0.7, 3, 1, 120, "Soldier" }, { 0.9, 5, 6, 90, "Demoman" }, { 1.1, 1, 6, 90, "Medic" }, { 0.65, 2, 1, 140, "Heavy Weapons" }, { 1, 1, 6, 100, "Pyro" }, { 1, 6, 0, 80, "Spy" }, { 1, 1, 6, 80, "Engineer" }, { 0.65, 0, 0, 70, "Civilian" } }; Code:
if(m_fortress) { int wep1 = classstats[classnum[weapon1]]; int wep2 = classstats[classnum[weapon2]]; ammo[wep1] = (itemstats[wep1[add]]*2); ammo[wep2] = (itemstats[wep2[add]]*2); armour = 0; maxhealth = classstats[classnum[class_maxhealth]]; health = maxhealth; } L: When attempting to compile, I get: Quote:
I just replaced the definitions with their values. Hence the 0-6's in the 'weapon1' and 'weapon2' slots. Yeah, if you haven't noticed yet (you probably have), I've been trying to make a Fortress mod for Cube 2. While teaching myself how to use C++ with it's source code. Also, I assume this should go in the 'tech' thread, 'cause there's no other place for it :L Damn, this post keeps getting longer. I used the values of health and speed in FF, if you were wondering, and changed them using various formulae to be more suitable for Cube 2. L:
__________________
gg ff not ded ff very much alive |
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|