[Tutorial] Gang Zone Wars
#21

I have these errors:
Quote:

(23) : error 017:error 017: undefined symbol "ZoneInfo"
(24) : error 017:undefined symbol "ZoneInfo"
(25) : error 017: undefined symbol "ZoneInfo"
(164) : error 001:expected token: ";", but found "forward"

Lines:

Line 23:
Code:
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
Line 24:
Code:
new ZoneAttackTime[sizeof(ZoneInfo)];
Line 25:
Code:
new ZoneDeaths[sizeof(ZoneInfo)];
Line 164:
Code:
forward SetPlayerRandomSpawn(playerid);
Help me please :/
Reply
#22

I have a problem.

I used the first method. I followed all the steps. Everything is ok until you start by war, going on rival territory but nothing happens.

Below is what I am introduced to GM for gang wars


1.
pawn Code:
AddPlayerClass(113, 1124.2415, -2037.1274, 69.8847, 269.15, 7, 1, 24, 60, 0, 0);
AddPlayerClass(120, -2192.3020, 646.8816, 49.4375, 269.15, 8, 1, 24, 60, 0, 0);
2.
Code:
#define TEAM_LCN 1 
#define TEAM_YAKUZA 2 
#define TAKEOVER_TIME 300 
#define MIN_MEMBERS_TO_START_WAR 1
3.
Code:
static gTeam[MAX_PLAYERS];
4.
Code:
public SetPlayerTeamFromClass(playerid,classid)
{
 	if (classid == 0)
	{
  		gTeam[playerid] = TEAM_LCN;
	}
	else
	{
  		gTeam[playerid] = TEAM_YAKUZA;
	}
}
5.
Code:
if (gTeam[playerid] == TEAM_LCN)
{
	SetPlayerColor(playerid, COLOR_LCN);
}
else if (gTeam[playerid] == TEAM_YAKUZA)
{
	SetPlayerColor(playerid, COLOR_YKZ);
}
6.
Code:
enum eZone
{
    Float:zMinX,
    Float:zMinY,
    Float:zMaxX,
    Float:zMaxY,
    zTeam
}
new ZoneInfo[][eZone] = {
    {-2263.0850,52.9664,-2355.4988,-178.6447,TEAM_LCN}, // Teritoriu factiunea 1 (LCN)
    {-2150.3877,313.4182,-2241.1433,102.3497,TEAM_YAKUZA} // Teritoriu factiunea 2 (Yakuza)
};
new ZoneID[sizeof(ZoneInfo)];
7.
Code:
for(new i=0; i < sizeof(ZoneInfo); i++)
{
	GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
        if(ZoneAttacker[i] != -1) GangZoneFlashForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
}
8.
Code:
for(new i=0; i < sizeof(ZoneInfo); i++)
{
	ZoneID[i] = GangZoneCreate(ZoneInfo[i][zMinX], ZoneInfo[i][zMinY], ZoneInfo[i][zMaxX], ZoneInfo[i][zMaxY]);
}
9.
Code:
stock GetTeamZoneColor(teamid)
{
    switch(teamid)
    {
        case TEAM_LCN: return 0x00FF0088;
        case TEAM_YAKUZA: return 0xFF00FF88;
    }
    return -1;
}
10.
Code:
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
new ZoneAttackTime[sizeof(ZoneInfo)];
11.
Code:
new Teams[] = {
    TEAM_LCN,
    TEAM_YAKUZA
};
12.
Code:
stock IsPlayerInZone(playerid, zoneid)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    return (x > ZoneInfo[zoneid][zMinX] && x < ZoneInfo[zoneid][zMaxX] && y > ZoneInfo[zoneid][zMinY] && y < ZoneInfo[zoneid][zMaxY]);
}

stock GetPlayersInZone(zoneid, teamid)
{
    new count;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsALcn(i) == teamid && IsAYakuza(i) == teamid && IsPlayerInZone(i, zoneid))
        {
            count++;
        }
    }
    return count;
}
13.
Code:
SetTimer("ZoneTimer", 1000, true);
14.
Code:
public ZoneTimer()
{
    for(new i=0; i < sizeof(ZoneInfo); i++) // loop all zones
    {
        if(ZoneAttacker[i] != -1) // zone is being attacked
        {
            if(GetPlayersInZone(i, ZoneAttacker[i]) >= MIN_MEMBERS_TO_START_WAR) // team has enough members in the zone
            {
                ZoneAttackTime[i]++;
                if(ZoneAttackTime[i] == TAKEOVER_TIME) // zone has been under attack for enough time and attackers take over the zone
                {
                    GangZoneStopFlashForAll(ZoneID[i]);
                    ZoneInfo[i][zTeam] = ZoneAttacker[i];
                    GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam])); // update the zone color for new team
                    ZoneAttacker[i] = -1;
                }
            }
            else // attackers failed to take over the zone
            {
                GangZoneStopFlashForAll(ZoneID[i]);
                ZoneAttacker[i] = -1;
            }
        }
        else // check if somebody is attacking
        {
            for(new t=0; t < sizeof(Teams); t++) // loop all teams
            {
                if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR) // if there are enough enemies in the zone
                {
                    ZoneAttacker[i] = Teams[t];
                    ZoneAttackTime[i] = 0;
                    GangZoneFlashForAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
                }
            }
        }
    }
}
Reply
#23

Quote:
Originally Posted by R3dX
View Post
I have a problem.

I used the first method. I followed all the steps. Everything is ok until you start by war, going on rival territory but nothing happens.

Below is what I am introduced to GM for gang wars


...
6.
Code:
enum eZone
{
    Float:zMinX,
    Float:zMinY,
    Float:zMaxX,
    Float:zMaxY,
    zTeam
}
new ZoneInfo[][eZone] = {
    {-2263.0850,52.9664,-2355.4988,-178.6447,TEAM_LCN}, // Teritoriu factiunea 1 (LCN)
    {-2150.3877,313.4182,-2241.1433,102.3497,TEAM_YAKUZA} // Teritoriu factiunea 2 (Yakuza)
};
new ZoneID[sizeof(ZoneInfo)];
...
zMin must be smaller than zMax.

Your zMinX is -2263.0850 but zMaxX is -2355.4988

-2263.0850 is not smaller than -2355.4988
Reply
#24

pawn Code:
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
pawn Code:
error 018: initialization data exceeds declared size
Reply
#25

good tut but need fix some errors.
Reply
#26

Hello

I have a problem I want to do in order to view this information when the gang attacked a gang of 2
for example:

Code:
format (str, sizeof (str), "Zone:% s is attacked by a gang:% s, the remaining 2 minutes.");
SendClientMessageToAll (RED, str);
I do not know what to put a name to fetch the zone under attack
and the name of the gang attacker.

Please help.
Reply
#27

I get an error and 2 warning please tell me how to fix it

Code:
C:\Documents and Settings\xp\Desktop\LZGS Adventure World\gamemodes\MMORPG.pwn(34) : error 017: undefined symbol "ZoneInfo"
C:\Documents and Settings\xp\Desktop\LZGS Adventure World\gamemodes\MMORPG.pwn(1162) : warning 235: public function lacks forward declaration (symbol "ZoneTimer")
C:\Documents and Settings\xp\Desktop\LZGS Adventure World\gamemodes\MMORPG.pwn(1612) : warning 203: symbol is never used: "Teams"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#28

Quote:
Originally Posted by ||ponpon||
View Post
I have these errors:

Lines:

Line 23:
Code:
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
Line 24:
Code:
new ZoneAttackTime[sizeof(ZoneInfo)];
Line 25:
Code:
new ZoneDeaths[sizeof(ZoneInfo)];
Line 164:
Code:
forward SetPlayerRandomSpawn(playerid);
Help me please :/
FFS I AM HAVING SAME PROBLEM!!! HELP!!!!!!
Reply
#29

Edit: got all fixed
Reply
#30

C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(139) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYER_ATTACHED_OBJECTS")
C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(12250) : error 017: undefined symbol "ZoneID"
C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(12250) : warning 215: expression has no effect
C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(12250) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(12250) : error 029: invalid expression, assumed zero
C:\Documents and Settings\RaduFabian\Desktop\samp03\gamemodes\eGame r.pwn(12250) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Line : ZoneID[i] = GangZoneCreate(ZoneInfo[i][zMinX], ZoneInfo[i][zMinY], ZoneInfo[i][zMaxX], ZoneInfo[i][zMaxY]);

Plz help fast
Reply
#31

I made new command /war and added ZoneTimer(); in that command lines . Now when i use / war it begins to start flashing the zone but the timer don't ends and the zone still flashed even i get out of there.
EDIT: I used the first type of Zone Attack (#1)
Reply
#32

Dont working and capture alll zones
help
Reply
#33

Can anyone guide me in the right direction with this. Im trying to use it with a DM script where you make your own gangs and use the gang that you made to capture the zones, not the tdm gang wars. If anyone gets me write me back or pm me please
Reply
#34

I put zoneattack 1 and 2??I don't understand how..
Reply
#35

yes but the gangzones don't get saved..
Reply
#36

but if civilian kills gang?
Reply
#37

Quote:

(40904) : error 035: argument type mismatch (argument 2)
(40915) : error 035: argument type mismatch (argument 2)

40904
Quote:

stock GetPlayersInZone(zoneid, teamid)
{
new count;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == teamid && IsPlayerInZone(i, zoneid)) // 40904
{
count++;
}
}
return count;
}

40915
Quote:

stock GetPlayerZone(playerid)
{
for(new i=0; i < sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i)) // 40915
{
return i;
}
}
return -1;
}



Help Me!!
Reply
#38

can anyone help me format i.e. "East side ballas are trying to capture Los Santos Vagos' hood, they will own it in 5 minutes." ? Thanks
Reply
#39

Thanks was Very Helpful to me
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)