How to add more capture zones
#2

Quote:
Originally Posted by msvu
Посмотреть сообщение
Hey, I'm using this tutorial on how to make capture zones but I don't know how to add more zones. I tried like this public
Код:
OnGameModeInit()
{

    tCP[CAPZONE] = TEAM_NONE;
    UnderAttack[CAPZONE] = 0;
    Zone[CAPZONE] = CreateDynamicZone(1675.78128, -2019.53125, 1812.5, -1867.1875, NEUTRAL_FLAG_COLOR);
    CP[CAPZONE] = CreateDynamicCP(1716.4755,	-1880.6313,	14.5662, 3, -1, -1, -1, 100.0);

    tCP[CAPZONE] = TEAM_NONE;
    UnderAttack[CAPZONE] = 0;
    Zone[CAPZONE] = CreateDynamicZone(1226.5625, 242.1875, 1324.21875, 351.5625, NEUTRAL_FLAG_COLOR);
    CP[CAPZONE] = CreateDynamicCP(1271.6301,	295.0983,	20.6563, 3, -1, -1, -1, 100.0);
I tried defining more CAPZONES like this
Код:
#define CAPZONE 0
#define CAPZONE 1
But with no luck. Can somebody explain me how to add more than 1 zone, please ?
You can't define twice "CAPZONE", if you already defining more zones you can define something like:

Код:
#define ZONE_1 0
#define ZONE_2 1
I would rather define zones by names or even not defining at all!

Код:
#define ZONE_VINEWOOD	0
#define ZONE_GSF		1
#define ZONE_BALLAS		2
#define ZONE_CITYHALL	3
To make esier with defining use an enum

Код:
enum {
	ZONE_VINEWOOD,
	ZONE_GSF,
	ZONE_BALLAS,
	ZONE_CITYHALL
}
After that to create multiple zones it would look:

Код:
    tCP[ZONE_VINEWOOD] = TEAM_NONE;
    UnderAttack[ZONE_VINEWOOD] = 0;
    Zone[ZONE_VINEWOOD] = CreateDynamicZone(1675.78128, -2019.53125, 1812.5, -1867.1875, NEUTRAL_FLAG_COLOR);
    CP[ZONE_VINEWOOD] = CreateDynamicCP(1716.4755,	-1880.6313,	14.5662, 3, -1, -1, -1, 100.0);

    tCP[ZONE_GSF] = TEAM_NONE;
    UnderAttack[ZONE_GSF] = 0;
    Zone[ZONE_GSF] = CreateDynamicZone(1226.5625, 242.1875, 1324.21875, 351.5625, NEUTRAL_FLAG_COLOR);
    CP[ZONE_GSF] = CreateDynamicCP(1271.6301,	295.0983,	20.6563, 3, -1, -1, -1, 100.0);

    tCP[ZONE_BALLAS] = TEAM_NONE;
    UnderAttack[ZONE_BALLAS] = 0;
    Zone[ZONE_BALLAS] = CreateDynamicZone(1226.5625, 242.1875, 1324.21875, 351.5625, NEUTRAL_FLAG_COLOR);
    CP[ZONE_BALLAS] = CreateDynamicCP(1271.6301,	295.0983,	20.6563, 3, -1, -1, -1, 100.0);
    .
    .
    .
Reply


Messages In This Thread
How to add more capture zones - by msvu - 22.05.2014, 14:59
Re: How to add more capture zones - by Pasa - 22.05.2014, 15:13
Re: How to add more capture zones - by msvu - 22.05.2014, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)