/guerra nao conta pontos -
Xpectro - 12.12.2013
Ae, tava mechendo num gm aqui e ele quando da /guerra, cria a бrea certim e tal, mas tipo, quando termina a guerra e vai dar o placar, todas as orgs ficam com 0 pontos, como se ninguem tivesse morrido, alguem pode dar uma ajuda ae?
Aqui o comando /guerra
pawn Код:
if(strcmp(cmd, "/guerra", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,CINZA," Vocк nгo pode criar guerra na cadeia!");
return true;
}
if(TendoGuerra >= 1)
{
SendClientMessage(playerid, CINZA, " Jб estб tendo uma guerra!");
return true;
}
if(GetPlayerInterior(playerid) != 0)
{
SendClientMessage(playerid,CINZA," Vocк nгo pode criar guerra em um interior!");
return true;
}
new p[3];
for(new i = GetMaxPlayers(); i > -1; --i) {
if(IsPlayerConnected(i)) {
switch(PlayerInfo[i][pMembro]) {
case 3: p[0]++;
case 6: p[1]++;
case 15: p[2]++;
}
}
}
if(!(p[0] > 1 && p[1] > 1 && p[2] > 1)) return SendClientMessage(playerid,CINZA," Й necessбrio no mнnimo 2 players online do Ex, FARC e GI para iniciar a guerra!");
new Float:x,Float:y,Float:z;
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)// EXE
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o Exйrcito iniciaram uma Guerra.Evitem a бrea!",playername);
SendClientMessageToAll(COLOR_EXE, string);
GetPlayerPos(playerid,x,y,z);
Territorio[MinX] = x-120;
Territorio[MinY] = y-120;
Territorio[MaxX] = x+120;
Territorio[MaxY] = y+120;
Territorio[exemortos] = 0;
Territorio[talmortos] = 0;
Territorio[almortos] = 0;
Territorio[GImortos] = 0;
GuerraMinX = x-120;
GuerraMinY = y-120;
GuerraMaxX = x+120;
GuerraMaxY = y+120;
GZGuerra = GangZoneCreate(x-120,y-120,x+120,y+120);
GangZoneShowForAll(GZGuerra,COLORGZ_EXE);
BPHInfo[playerid][InicioGuerra] = 1;
TendoGuerra = 1;
TempoGuerra = SetTimerEx("GuerraTerrorista", 1200000, 0, "i", playerid);
return true;
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)// GI
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e o Hamas iniciaram uma Guerra.Evitem a бrea!",playername);
SendClientMessageToAll(COR_GIA, string);
GetPlayerPos(playerid,x,y,z);
Territorio[MinX] = x-120;
Territorio[MinY] = y-120;
Territorio[MaxX] = x+120;
Territorio[MaxY] = y+120;
Territorio[exemortos] = 0;
Territorio[talmortos] = 0;
Territorio[almortos] = 0;
Territorio[GImortos] = 0;
GuerraMinX = x-120;
GuerraMinY = y-120;
GuerraMaxX = x+120;
GuerraMaxY = y+120;
GZGuerra = GangZoneCreate(x-120,y-120,x+120,y+120);
GangZoneShowForAll(GZGuerra,COLORGZ_GIA);
BPHInfo[playerid][InicioGuerra] = 1;
TendoGuerra = 1;
TempoGuerra = SetTimerEx("GuerraTerrorista", 1200000, 0, "i", playerid);
return true;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)// GI
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Al Qaeda iniciaram uma Guerra.Evitem a бrea!",playername);
SendClientMessageToAll(COR_FARC, string);
GetPlayerPos(playerid,x,y,z);
Territorio[MinX] = x-120;
Territorio[MinY] = y-120;
Territorio[MaxX] = x+120;
Territorio[MaxY] = y+120;
Territorio[exemortos] = 0;
Territorio[talmortos] = 0;
Territorio[almortos] = 0;
Territorio[GImortos] = 0;
GuerraMinX = x-120;
GuerraMinY = y-120;
GuerraMaxX = x+120;
GuerraMaxY = y+120;
GZGuerra = GangZoneCreate(x-120,y-120,x+120,y+120);
GangZoneShowForAll(GZGuerra,COLORGZ_ALCAIDA);
BPHInfo[playerid][InicioGuerra] = 1;
TendoGuerra = 1;
TempoGuerra = SetTimerEx("GuerraTerrorista", 1200000, 0, "i", playerid);
return true;
}
if(PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)// F ARC
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Guerrilheiros Israelitas iniciaram uma Guerra.Evitem a бrea!",playername);
SendClientMessageToAll(COR_GI, string);
GetPlayerPos(playerid,x,y,z);
Territorio[MinX] = x-120;
Territorio[MinY] = y-120;
Territorio[MaxX] = x+120;
Territorio[MaxY] = y+120;
Territorio[exemortos] = 0;
Territorio[talmortos] = 0;
Territorio[almortos] = 0;
Territorio[GImortos] = 0;
GuerraMinX = x-120;
GuerraMinY = y-120;
GuerraMaxX = x+120;
GuerraMaxY = y+120;
GZGuerra = GangZoneCreate(x-120,y-120,x+120,y+120);
GangZoneShowForAll(GZGuerra,COLORGZ_GI);
BPHInfo[playerid][InicioGuerra] = 1;
TendoGuerra = 1;
TempoGuerra = SetTimerEx("GuerraTerrorista", 1200000, 0, "i", playerid);
return true;
}
return true;
}
tem isso aqui tambйm
pawn Код:
if(TendoGuerra == 1 && IsPlayerInTerritorio(playerid) && IsPlayerInTerritorio(killerid))
{
if(PlayerInfo[killerid][pMembro] == 3 || PlayerInfo[killerid][pLider] == 3)
{
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
Territorio[talmortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
Territorio[almortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)
{
Territorio[GImortos] += 1;
}
}
if(PlayerInfo[killerid][pMembro] == 6 || PlayerInfo[killerid][pLider] == 6)
{
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
Territorio[exemortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
Territorio[almortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)
{
Territorio[GImortos] += 1;
}
}
if(PlayerInfo[killerid][pMembro] == 15 || PlayerInfo[killerid][pLider] == 15)
{
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
Territorio[exemortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
Territorio[talmortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)
{
Territorio[GImortos] += 1;
}
}
if(PlayerInfo[killerid][pMembro] == 23 || PlayerInfo[killerid][pLider] == 23)
{
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
Territorio[exemortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
Territorio[talmortos] += 1;
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
Territorio[almortos] += 1;
}
}
}
e a public
pawn Код:
public GuerraTerrorista(playerid)
{
new string[128];
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, MAX_PLAYER_NAME);
TendoGuerra = 0;
if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)
{
KillTimer(TempoGuerra);
BPHInfo[playerid][InicioGuerra] = 0;
TendoGuerra = 0;
format(string, sizeof(string), "%s e o Exйrcito Finalizaram uma Guerra!",plname);
SendClientMessageToAll(COLOR_EXE, string);
GangZoneHideForAll(GZGuerra);
GangZoneDestroy(GZGuerra);
}
if(PlayerInfo[playerid][pMembro] == 6 || PlayerInfo[playerid][pLider] == 6)
{
KillTimer(TempoGuerra);
BPHInfo[playerid][InicioGuerra] = 0;
TendoGuerra = 0;
format(string, sizeof(string), "%s e o Hamas Finalizaram uma Guerra!",plname);
SendClientMessageToAll(COR_GIA, string);
GangZoneHideForAll(GZGuerra);
GangZoneDestroy(GZGuerra);
}
if(PlayerInfo[playerid][pMembro] == 15 || PlayerInfo[playerid][pLider] == 15)
{
KillTimer(TempoGuerra);
BPHInfo[playerid][InicioGuerra] = 0;
TendoGuerra = 0;
format(string, sizeof(string), "%s e a Al Qaeda Finalizaram uma Guerra!",plname);
SendClientMessageToAll(COR_FARC, string);
GangZoneHideForAll(GZGuerra);
GangZoneDestroy(GZGuerra);
}
if(PlayerInfo[playerid][pMembro] == 23 || PlayerInfo[playerid][pLider] == 23)
{
KillTimer(TempoGuerra);
BPHInfo[playerid][InicioGuerra] = 0;
TendoGuerra = 0;
format(string, sizeof(string), "%s e a Guerrilheiros Israelitas Finalizaram uma Guerra!",plname);
SendClientMessageToAll(COR_GI, string);
GangZoneHideForAll(GZGuerra);
GangZoneDestroy(GZGuerra);
}
if(Territorio[almortos] > Territorio[exemortos] && Territorio[talmortos] > Territorio[exemortos] && Territorio[GImortos] > Territorio[exemortos])//exercito ownou
{
format(string, sizeof(string), "O Exйrcito venceu a guerra matando %d do Hamas, %d da GI, e %d da Guerrilheiros Israelitas!",Territorio[talmortos], Territorio[almortos], Territorio[GImortos]);
SendClientMessageToAll(COLOR_EXE, string);
}
else if(Territorio[exemortos] > Territorio[almortos] && Territorio[talmortos] > Territorio[almortos] && Territorio[GImortos] > Territorio[almortos])//GI ownou
{
format(string, sizeof(string), "A Al Qaeda venceu a guerra matando %d do Hamas, %d do Exйrcito, e %d da Guerrilheiros Israelitas!",Territorio[talmortos], Territorio[exemortos], Territorio[GImortos]);
SendClientMessageToAll(COR_FARC, string);
}
else if(Territorio[exemortos] > Territorio[talmortos] && Territorio[almortos] > Territorio[talmortos] && Territorio[GImortos] > Territorio[talmortos])//GIA ownou
{
format(string, sizeof(string), "O Hamas venceu a guerra matando %d da GI, %d membros do Exйrcito, e %d da Guerrilheiros Israelitas!",Territorio[almortos], Territorio[exemortos], Territorio[GImortos]);
SendClientMessageToAll(COR_GIA, string);
}
else if(Territorio[exemortos] > Territorio[GImortos] && Territorio[almortos] > Territorio[GImortos] && Territorio[talmortos] > Territorio[GImortos])//Guerrilheiros Israelitas ownou
{
format(string, sizeof(string), "A Guerrilheiros Israelitas venceu a guerra matando %d da GI, %d do Exйrcito, e %d do Hamas!",Territorio[almortos], Territorio[exemortos], Territorio[talmortos]);
SendClientMessageToAll(COR_GI, string);
}
else
{
format(string, sizeof(string), "Houve um empate na guerra! Morreram: %d da GI, %d do Exйrcito, %d do Hamas, e %d da Guerrilheiros Israelitas !",Territorio[almortos], Territorio[exemortos],Territorio[talmortos],Territorio[GImortos]);
SendClientMessageToAll(COLOR_YELLOW2, string);
}
return true;
}
Sempre mesmo tendo mortos, da esse de 0 gi, 0 exercito, 0 ..
Respuesta: /guerra nao conta pontos -
ViniKuliveguisky - 12.12.2013
Qual callback estб o segundo cуdigo?
Re: Respuesta: /guerra nao conta pontos -
Xpectro - 12.12.2013
Quote:
Originally Posted by ViniKuliveguisky
Qual callback estб o segundo cуdigo?
|
estб em public OnPlayerDeath(playerid, killerid, reason)
Re: /guerra nao conta pontos -
Xpectro - 13.12.2013
@up '-'