02.11.2010, 18:16
Eu criei uma Gang zona diferente e gostaria que so pudesse dominar ele se tivesse dominado 4 outras GZ.
Eu fiz um sistema que quando domina a GZ seta +1 em um arquivo da GG, quando chega a 4 o cara pode domina a GZ principal.
So que nao sei como seta para -1 quando ele perde a GZ.
Se alguem puder me ajudar a identificar quando o cara perde a gz eu ficaria muito grato.
Meu sistema de GZ й esse:
o comando para comeзar a dominar a GZ
aqui ta um public de 1 gz, pq nao cabe tudo, mas o sistema eh o mesmo so muda as variaveis
O basico ta ai, pela metade pq nao cabia tudo xD
Como podem ver ali no meio, quando o cara domina й adicionado 1 na variavel.
IlhaCV++;
IlhaGrove++;
e etc.
Como eu faзo pra identificar que a gg que perdeu a gz para setar pra
IlhaCV--;
IlhaGrove--;
e etc?
Eu fiz um sistema que quando domina a GZ seta +1 em um arquivo da GG, quando chega a 4 o cara pode domina a GZ principal.
So que nao sei como seta para -1 quando ele perde a GZ.
Se alguem puder me ajudar a identificar quando o cara perde a gz eu ficaria muito grato.
Meu sistema de GZ й esse:
o comando para comeзar a dominar a GZ
Код:
if(strcmp(cmd, "/guerra", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)// pcc
{
if(IsPlayerInpcc(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб conquistando um territorio.");
return 1;
}
if(Guerranopcc == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donopcc == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Reconquistando a sua Бrea!",playername);
GZNEWS(COR_PCC,string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 21 || PlayerInfo[i][pLeader] == 21)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZpcc,COR_PCC);
Dominando[playerid] = 1;
Provocopcc[playerid] = 1;
Guerranopcc = 1;
TempoGuerrapcc = SetTimerEx("Guerrapcc", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerInaztecas(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranoaztecas == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donoaztecas == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea dos Aztecas!",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZaztecas,COR_PCC);
Dominando[playerid] = 1;
Provocoaztecas[playerid] = 1;
Guerranoaztecas = 1;
TempoGuerraaztecas = SetTimerEx("Guerraaztecas", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerInballas(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranoballas == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donoballas == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea dos Ballas!",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 11 || PlayerInfo[i][pLeader] == 11)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZballas,COR_PCC);
Dominando[playerid] = 1;
Provocoballas[playerid] = 1;
Guerranoballas = 1;
TempoGuerraballas = SetTimerEx("Guerraballas", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerIngrove(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranogrove == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donogrove == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea do Groove!",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 15 || PlayerInfo[i][pLeader] == 15)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZgrove,COR_PCC);
Dominando[playerid] = 1;
Provocogrove[playerid] = 1;
Guerranogrove = 1;
TempoGuerragrove = SetTimerEx("Guerragrove", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerInvagos(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranovagos == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donovagos == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea dos Vagos!",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 16 || PlayerInfo[i][pLeader] == 16)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZvagos,COR_PCC);
Dominando[playerid] = 1;
Provocovagos[playerid] = 1;
Guerranovagos = 1;
TempoGuerravagos = SetTimerEx("Guerravagos", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerInroceiros(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranoroceiros == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donoroceiros == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea dos Roceiros !",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 18 || PlayerInfo[i][pLeader] == 18)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZroceiros,COR_PCC);
Dominando[playerid] = 1;
Provocoroceiros[playerid] = 1;
Guerranoroceiros = 1;
TempoGuerraroceiros = SetTimerEx("Guerraroceiros", 60000, 0, "i", playerid);
return 1;
}
if(IsPlayerIncv(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб Conquistando um territorio.");
return 1;
}
if(Guerranocv == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
if(donocv == 12)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja й dono desse territуrio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC estгo Conquistando a Бrea do Comando Vermelho!",playername);
GZNEWS(COR_PCC, string);
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][pMember] == 19 || PlayerInfo[i][pLeader] == 19)
{
format(string, sizeof(string), "~w~Sua Area esta sobre ~r~Ataque");
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, 1);
}}}
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZcv,COR_PCC);
Dominando[playerid] = 1;
Provococv[playerid] = 1;
Guerranocv = 1;
TempoGuerracv = SetTimerEx("Guerracv", 60000, 0, "i", playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD3, "Vocк nгo estб em nenhun territуrio!");
}
return 1;
}
Код:
public Guerracv(playerid)
{
new string[256];
new playername[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)//Groove
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Groove Street Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,TEAM_GROVE_COLOR);
IlhaGrove++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 7;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)//Groove
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o Comando Vermelho Reconquistram sua Бrea !",playername);
SendClientMessageToAll(COR_Comando, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк retomou sua Бrea!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,COR_Comando);
IlhaCV++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 10;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid,COR_Comando, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)//cv
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Ballas Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(TEAM_BALLAS_COLOR, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,TEAM_BALLAS_COLOR);
IlhaBallas++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 5;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid, TEAM_BALLAS_COLOR, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)//Los cv
{
if(Provococv[playerid] == 1)
{
if(IsPlayerInMorro(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e Los Vagos Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(TEAM_VAGOS_COLOR, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,TEAM_VAGOS_COLOR);
IlhaVagos++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 8;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid, TEAM_VAGOS_COLOR, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Aztecas Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(TEAM_AZTECAS_COLOR, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,TEAM_AZTECAS_COLOR);
IlhaAztecas++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 3;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid, TEAM_AZTECAS_COLOR, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Roceiros Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(TEAM_Farm_COLOR, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,TEAM_Farm_COLOR);
IlhaRoceiros++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 9;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid, TEAM_Farm_COLOR, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)
{
if(Provococv[playerid] == 1)
{
if(IsPlayerIncv(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o PCC Conquistaram a Бrea do Comando Vermelho!",playername);
SendClientMessageToAll(COR_PCC, string);
SendClientMessage(playerid, COLOR_GRAD5, "Vocк Conquistou a Бrea do Comando Vermelho!");
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv,COR_PCC);
IlhaPCC++;
Dominando[playerid] = 0;
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 12;
KillTimer(TempoGuerracv);
return 1;
}
else
{
SendClientMessage(playerid,COR_PCC, "Vocк nгo estб na Бrea do Comando Vermelho.");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZcv);
GangZoneShowForAll(GZcv, 0xFFFFFF96);
Provococv[playerid] = 0;
Guerranocv = 0;
donocv = 0;
KillTimer(TempoGuerracv);
return 1;
}
}
return 1;
}
return 1;
}
Como podem ver ali no meio, quando o cara domina й adicionado 1 na variavel.
IlhaCV++;
IlhaGrove++;
e etc.
Como eu faзo pra identificar que a gg que perdeu a gz para setar pra
IlhaCV--;
IlhaGrove--;
e etc?

