(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" |
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
new ZoneAttackTime[sizeof(ZoneInfo)];
new ZoneDeaths[sizeof(ZoneInfo)];
forward SetPlayerRandomSpawn(playerid);
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);
#define TEAM_LCN 1 #define TEAM_YAKUZA 2 #define TAKEOVER_TIME 300 #define MIN_MEMBERS_TO_START_WAR 1
static gTeam[MAX_PLAYERS];
public SetPlayerTeamFromClass(playerid,classid) { if (classid == 0) { gTeam[playerid] = TEAM_LCN; } else { gTeam[playerid] = TEAM_YAKUZA; } }
if (gTeam[playerid] == TEAM_LCN) { SetPlayerColor(playerid, COLOR_LCN); } else if (gTeam[playerid] == TEAM_YAKUZA) { SetPlayerColor(playerid, COLOR_YKZ); }
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)];
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])); }
for(new i=0; i < sizeof(ZoneInfo); i++) { ZoneID[i] = GangZoneCreate(ZoneInfo[i][zMinX], ZoneInfo[i][zMinY], ZoneInfo[i][zMaxX], ZoneInfo[i][zMaxY]); }
stock GetTeamZoneColor(teamid) { switch(teamid) { case TEAM_LCN: return 0x00FF0088; case TEAM_YAKUZA: return 0xFF00FF88; } return -1; }
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...}; new ZoneAttackTime[sizeof(ZoneInfo)];
new Teams[] = { TEAM_LCN, TEAM_YAKUZA };
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; }
SetTimer("ZoneTimer", 1000, true);
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])); } } } } }
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)]; |
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
error 018: initialization data exceeds declared size
format (str, sizeof (str), "Zone:% s is attacked by a gang:% s, the remaining 2 minutes."); SendClientMessageToAll (RED, str);
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
I have these errors:
Lines: Line 23: Code:
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...}; Code:
new ZoneAttackTime[sizeof(ZoneInfo)]; Code:
new ZoneDeaths[sizeof(ZoneInfo)]; Code:
forward SetPlayerRandomSpawn(playerid); |
(40904) : error 035: argument type mismatch (argument 2) (40915) : error 035: argument type mismatch (argument 2) |
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; } |
stock GetPlayerZone(playerid) { for(new i=0; i < sizeof(ZoneInfo); i++) { if(IsPlayerInZone(playerid, i)) // 40915 { return i; } } return -1; } |