Код:
function TurfWars(team1, team2, turfid)
{
new string[64];
if(team1 == 7) GroveTimer2 = 7200;
else if(team1 == 10) BallasTimer2 = 7200;
else if(team1 == 9) VagosTimer2 = 7200;
else if(team1 == 8) AztecasTimer2 = 7200;
if(team1 == 7 && team2 == 10)
{
if(Score[2] == 0 && Score[3] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[2] == Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {006400}Grove Street{FFFFFF} and {660066}Ballas{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[2] > Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} pwned {660066}Ballas{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
gstpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[2] < Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} lost in front of {660066}Ballas{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
ballaspts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
mysql_tquery(handle, gQuery, "", "");
}
GroveBallas2 = 0;
Score[2] = 0;
Score[3] = 0;
}
else if(team1 == 7 && team2 == 9)
{
if(Score[2] == 0 && Score[4] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[2] == Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {006400}Grove Street{FFFFFF} and {F8CB45}Los Santos Vagos{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[2] > Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} pwned {F8CB45}Los Santos Vagos{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
gstpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[2] < Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} lost in front of {F8CB45}Los Santos Vagos{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[2], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
lsvpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
mysql_tquery(handle, gQuery, "", "");
}
GroveVagos2 = 0;
Score[2] = 0;
Score[4] = 0;
}
else if(team1 == 10 && team2 == 7)
{
if(Score[3] == 0 && Score[2] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[3] == Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {660066}Ballas{FFFFFF} and {006400}Grove Street{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[3] > Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} pwned {006400}Grove Street{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
ballaspts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[3] < Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} lost in front of {006400}Grove Street{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
gstpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
mysql_tquery(handle, gQuery, "", "");
}
GroveBallas2 = 0;
Score[2] = 0;
Score[3] = 0;
}
else if(team1 == 10 && team2 == 8)
{
if(Score[3] == 0 && Score[5] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[3] == Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {660066}Ballas{FFFFFF} and {00F5FF}Varrios Los Aztecas{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[3] > Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} pwned {00F5FF}Varrios Los Aztecas{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
ballaspts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[3] < Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} lost in front of {00F5FF}Varrios Los Aztecas{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[3], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
vlapts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
mysql_tquery(handle, gQuery, "", "");
}
AztecasBallas2 = 0;
Score[3] = 0;
Score[5] = 0;
}
else if(team1 == 9 && team2 == 7)
{
if(Score[4] == 0 && Score[2] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {006400}Grove Street{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[4] == Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {F8CB45}Los Santos Vagos{FFFFFF} and {006400}Grove Street{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[4] > Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} pwned {006400}Grove Street{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
lsvpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[4] < Score[2])
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} lost in front of {006400}Grove Street{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[2]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
gstpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `gstpts` = '%d' WHERE `id` = '1'",gstpts);
mysql_tquery(handle, gQuery, "", "");
}
GroveVagos = 0;
Score[2] = 0;
Score[4] = 0;
}
else if(team1 == 9 && team2 == 8)
{
if(Score[4] == 0 && Score[5] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[4] == Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {F8CB45}Los Santos Vagos{FFFFFF} and {00F5FF}Varrios Los Aztecas{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[4] > Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} pwned {00F5FF}Varrios Los Aztecas{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
lsvpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[4] < Score[5])
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} lost in front of {00F5FF}Varrios Los Aztecas{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[4], Score[5]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
vlapts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
mysql_tquery(handle, gQuery, "", "");
}
AztecasVagos2 = 0;
Score[4] = 0;
Score[5] = 0;
}
else if(team1 == 8 && team2 == 10)
{
if(Score[5] == 0 && Score[3] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {660066}Ballas{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[5] == Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {00F5FF}Varrios Los Aztecas{FFFFFF} and {660066}Ballas{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[5] > Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} pwned {660066}Ballas{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
vlapts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[5] < Score[3])
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} lost in front of {660066}Ballas{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[3]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
ballaspts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `ballaspts` = '%d' WHERE `id` = '1'",ballaspts);
mysql_tquery(handle, gQuery, "", "");
}
AztecasBallas2 = 0;
Score[3] = 0;
Score[5] = 0;
}
else if(team1 == 8 && team2 == 9)
{
if(Score[5] == 0 && Score[4] == 0)
{
SendClientMessageToAll(COLOR_WHITE, "* {F8CB45}Los Santos Vagos{FFFFFF} haven't defended their Gang Zone and lost it!");
TurfTakeOver(turfid, team1);
}
else if(Score[5] == Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* The fight between {00F5FF}Varrios Los Aztecas{FFFFFF} and {F8CB45}Los Santos Vagos{FFFFFF} has ended as a Draw!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
}
else if(Score[5] > Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} pwned {F8CB45}Los Santos Vagos{FFFFFF} and took over their Gang Zone!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
TurfTakeOver(turfid, team1);
vlapts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `vlapts` = '%d' WHERE `id` = '1'",vlapts);
mysql_tquery(handle, gQuery, "", "");
}
else if(Score[5] < Score[4])
{
SendClientMessageToAll(COLOR_WHITE, "* {00F5FF}Varrios Los Aztecas{FFFFFF} lost in front of {F8CB45}Los Santos Vagos{FFFFFF}'s mighty Defence!");
format(string, sizeof(string), "* Final Score: %d - %d", Score[5], Score[4]);
SendClientMessageToAll(COLOR_WHITE, string);
GangZoneStopFlashForAll(GzS[turfid]);
TurfWar[turfid] = 0;
lsvpts++;
gQuery[0] = (EOS);
format(gQuery,sizeof(gQuery),"UPDATE `timeref` SET `lsvpts` = '%d' WHERE `id` = '1'",lsvpts);
mysql_tquery(handle, gQuery, "", "");
}
AztecasVagos2 = 0;
Score[4] = 0;
Score[5] = 0;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(WasInZone[i] == turfid)
{
WasInZone[i] = -1;
if(IsPlayerConnected(i))
TextDrawHideForPlayer(i, DamageTxT);
}
}
ZoneAttacker[turfid] = 0;
KillStreakReset();
SaveGzT();
return 1;
}