[Ayuda]Problema Con Sistema GangZone Wars
#1

Hola, estaba buscando un Sistema de GangZones pero no lo encontre, encontre una guia Y La arme pero no tenia en request player no tenia los Teams Definidos y yo los puse "al parecer esta bien" pero no estoy seguro Ese es la duda que tengo, y tengo otro problema que Cuando Estoy En Un GANGZONE Ejemplo: Grove, (Yo Soy Azteca) Y Cuando Mato 2 veces a un Grove se supone que deve empesar a parpadear el Gangzone de GROVE y no parpadea, Nose Que sea miren aqui les Paso El Codigo para ver si me ayudan Me dicen que esta mal y que no lo esta (yo creo que todo esta bien pero no estoy seguro, pues se puede decir que soy nivel noob aun en pawno xD!) Gracias

Код:
#include <a_samp>
#pragma tabsize 0
#define TEAM_GROVE 1
#define TEAM_BALLAS 2
#define TEAM_VAGOS 3
#define TEAM_AZTECAS 4

#define TAKEOVER_TIME 120 // Cuantos segundos tienen que esperar para conquistar un Gang Zone.
#define MIN_MEMBERS_TO_START_WAR 1 // Cuantos miembros tienen que estar en una zona para empezar una guerra de bandas
#define MIN_DEATHS_TO_START_WAR 2
forward ZoneTimer();
enum eZone
{
Float:zMinX,
Float:zMinY,
Float:zMaxX,
Float:zMaxY,
zTeam
}
new ZoneInfo[][eZone] = { //Aquн se pondrбn todas los Gang Zones
{2334.763671, -1742.486450, 2542.763671, -1590.486450,TEAM_GROVE},
{2333.931640, -1521.871093, 2573.931640, -1265.871093,TEAM_BALLAS},
{1956.242675, -1221.956665, 2292.242675, -965.956665,TEAM_VAGOS},
{2617.844726, -2064.210937, 2817.844726, -1896.211059,TEAM_AZTECAS}
};
new ZoneID[sizeof(ZoneInfo)];
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
new ZoneAttackTime[sizeof(ZoneInfo)];
new Teams[] = {
TEAM_GROVE,
TEAM_BALLAS,
TEAM_VAGOS,
TEAM_AZTECAS
};
new ZoneDeaths[sizeof(ZoneInfo)];


public OnFilterScriptInit()
{
print("	============================================");
print("	Sistema De Gang War");
print("	Creditos: andr3w, MadeMan, XxKillerxX");
print("	---------------------------------------------");
print("	Cargado......!");
print("	============================================");
//Player Class
AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);
AddPlayerClass(100,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(101,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(102,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(103,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(104,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(105,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(106,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(107,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(108,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(109,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(110,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(111,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(112,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(113,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(114,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(115,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(116,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(117,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(118,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
AddPlayerClass(120,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
SetTimer("ZoneTimer", 1000, true);
for(new i=0; i < sizeof(ZoneInfo); i++)
{
ZoneID[i] = GangZoneCreate(ZoneInfo[i][zMinX], ZoneInfo[i][zMinY], ZoneInfo[i][zMaxX], ZoneInfo[i][zMaxY]);
}
return 1;
}

public OnFilterScriptExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 105 || classid == 106 || classid == 107 || classid == 0){
Teams[playerid] = TEAM_GROVE;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
GameTextforPlayer(playerid, "/w/Cholos: /b/Grove", 5000, 5);
}
if(classid == 102 || classid == 103 || classid == 104){
Teams[playerid] = TEAM_BALLAS;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
GameTextforPlayer(playerid, "/w/Cholos: /b/Ballas", 5000, 5);
}
if(classid == 108 || classid == 109 || classid == 110){
Teams[playerid] = TEAM_VAGOS;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
GameTextforPlayer(playerid, "/w/Cholos: /b/Vagos", 5000, 5);
}
if(classid == 114 || classid == 115 || classid == 116){
Teams[playerid] = TEAM_AZTECAS;
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
GameTextforPlayer(playerid, "/w/Cholos: /b/Aztecas", 5000, 5);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
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]));
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid) && GetPlayerTeam(playerid) != GetPlayerTeam(killerid))
{
new zoneid = GetPlayerZone(playerid);
if(zoneid != -1 && ZoneInfo[zoneid][zTeam] == GetPlayerTeam(playerid)) // Miembros que an muerto en la zona
{
ZoneDeaths[zoneid]++;
if(ZoneDeaths[zoneid] == MIN_DEATHS_TO_START_WAR)
{
ZoneDeaths[zoneid] = 0;
ZoneAttacker[zoneid] = GetPlayerTeam(killerid);
ZoneAttackTime[zoneid] = 0;
GangZoneFlashforAll(ZoneID[zoneid], GetTeamZoneColor(ZoneAttacker[zoneid]));
}
}
}
return 1;
}

public ZoneTimer()
{
for(new i=0; i < sizeof(ZoneInfo); i++)
{
if(ZoneAttacker[i] != -1)
{
if(GetPlayersInZone(i, ZoneAttacker[i]) >= MIN_MEMBERS_TO_START_WAR)
{
ZoneAttackTime[i]++;
if(ZoneAttackTime[i] == TAKEOVER_TIME)
{
GangZoneStopFlashforAll(ZoneID[i]);
ZoneInfo[i][zTeam] = ZoneAttacker[i];
GangZoneShowforAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
ZoneAttacker[i] = -1;
}
}
else
{
GangZoneStopFlashforAll(ZoneID[i]);
ZoneAttacker[i] = -1;
}
}
else
{
for(new t=0; t < sizeof(Teams); t++)
{
if(Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(i, Teams[t]) >= MIN_MEMBERS_TO_START_WAR)
{
ZoneAttacker[i] = Teams[t];
ZoneAttackTime[i] = 0;
GangZoneFlashforAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
}
}
}
}
for(new i=0; i < sizeof(ZoneInfo); i++)
{
if(ZoneAttacker[i] != -1)
{
if(GetPlayersInZone(i, ZoneAttacker[i]) >= 1)
{
ZoneAttackTime[i]++;
if(ZoneAttackTime[i] == TAKEOVER_TIME)
{
GangZoneStopFlashforAll(ZoneID[i]);
ZoneInfo[i][zTeam] = ZoneAttacker[i];
GangZoneShowforAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
ZoneAttacker[i] = -1;
}
}
else
{
GangZoneStopFlashforAll(ZoneID[i]);
ZoneAttacker[i] = -1;
}
}
}
}
stock GetTeamZoneColor(teamid)
{
switch(teamid)
{
case TEAM_GROVE: return 0x00FF0088;
case TEAM_BALLAS: return 0xFF00FF88;
case TEAM_VAGOS: return 0xFFFF0088;
case TEAM_AZTECAS: return 0x00E1FF88;
}
return -1;
}

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) && GetPlayerTeam(i) == teamid && IsPlayerInZone(i, zoneid))
{
count++;
}
}
return count;
}
stock GetPlayerZone(playerid)
{
for(new i=0; i < sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i))
{
return i;
}
}
return -1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)