14.12.2013, 00:51
Bom meu GM tem 1 Sistema De Gzs dominaveis ai eu queria 1 comando que mostrasse as gzs e quem esta dominando ela e quem dominou e etc Alguem pode Me ajudar ?
if(strcmp(cmd, "/territorios", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_BLACKRED,"================= Territorios =================");
if(donocasarao == 2){
SendClientMessage(playerid, COLOR_WHITE,"Titanic: Marinha");
}
else if(donocasarao == 15){
SendClientMessage(playerid, COLOR_WHITE,"Titanic: Piratas");
}
else if(donocasarao == 0){
SendClientMessage(playerid, COLOR_WHITE,"Titanic: Nenhum");
}
// Cargueiro
if(donoestacao == 2){
SendClientMessage(playerid, COLOR_WHITE,"Cargueiro: Marinha");
}
else if(donoestacao == 15){
SendClientMessage(playerid, COLOR_WHITE,"Cargueiro: Piratas");
}
else if(donoestacao == 0){
SendClientMessage(playerid, COLOR_WHITE,"Cargueiro: Nenhum");
}
// Angel Pine
if(donomata == 3){
SendClientMessage(playerid, COLOR_WHITE,"Angel Pine: Exercito");
}
else if(donomata == 6){
SendClientMessage(playerid, COLOR_WHITE,"Angel Pine: Al-Qaeda");
}
else if(donomata == 0){
SendClientMessage(playerid, COLOR_WHITE,"Angel Pine: Nenhum");
}
// Palo Mino
if(donoroda == 3){
SendClientMessage(playerid, COLOR_WHITE,"Palo Mino: Exercito");
}
else if(donoroda == 6){
SendClientMessage(playerid, COLOR_WHITE,"Palo Mino: Al-Qaeda");
}
else if(donoroda == 0){
SendClientMessage(playerid, COLOR_WHITE,"Palo Mino: Nenhum");
}
// Morro do Dendк
if(donoFavela == 19){
SendClientMessage(playerid, COLOR_WHITE,"Morro do Dendк: CV");
}
else if(donoFavela == 20){
SendClientMessage(playerid, COLOR_WHITE,"Morro do Dendк: PCC");
}
else if(donoFavela == 20){
SendClientMessage(playerid, COLOR_WHITE,"Morro do Dendк: TCP");
}
else if(donoFavela == 25){
SendClientMessage(playerid, COLOR_WHITE,"Morro do Dendк: ADA");
}
else if(donoFavela == 0){
SendClientMessage(playerid, COLOR_WHITE,"Morro do Dendк: Nenhum");
}
// Complexo do Alemгo
if(donopg == 19){
SendClientMessage(playerid, COLOR_WHITE,"Complexo do Alemгo: CV");
}
else if(donopg == 20){
SendClientMessage(playerid, COLOR_WHITE,"Complexo do Alemгo: PCC");
}
else if(donopg == 20){
SendClientMessage(playerid, COLOR_WHITE,"Complexo do Alemгo: TCP");
}
else if(donopg == 25){
SendClientMessage(playerid, COLOR_WHITE,"Complexo do Alemгo: ADA");
}
else if(donopg == 0){
SendClientMessage(playerid, COLOR_WHITE,"Complexo do Alemгo: Nenhum");
}
SendClientMessage(playerid, COLOR_BLACKRED,"=============================================");
}
return 1;
}
forward GlobalTimer(); public GlobalTimer() { for (new j=0;j<MAX_TURFS;j++) { if(gZonesData[j][ZoneInWar] == false) { for (new l = 1; l < MAX_ORGS; l++) { if(gZonesData[j][ZoneOwner] != l) { new PlayersIn = GetGangPlayersInZone(j,l); if(PlayersIn >= PLAYERS_REQUIRED && Counted[j] == false) { Counted[j] = true; gZonesData[j][ZonePlayerReqMet][l] += PlayersIn; } if(PlayersIn < PLAYERS_REQUIRED) { gZonesData[j][ZonePlayerReqMet][l] = 0; } if(gZonesData[j][ZonePlayerReqMet][l] >= ZONE_CHECKS) { StartWar(j, gZonesData[j][ZoneOwner], l); } gZonesData[j][ZonePlayerCountEx][l] = PlayersIn; gZonesData[j][ZonePlayerCount][l] = 0; } } } Counted[j] = false; if(gZonesData[j][ZoneInWar]) { if(gZonesData[j][ZoneWarTimeLeft] > 0) { gZonesData[j][ZoneWarTimeLeft]--; new defenders = gZonesData[j][ZoneOwner]; new attackers = gZonesData[j][ZoneAttacker]; new def_in = GetGangPlayersInZone(j,defenders); gZonesData[j][ZoneWarPlayers][defenders] = def_in; gZonesData[j][ZoneWarPoints][defenders] += STAYING_POINTS*def_in; new atk_in = GetGangPlayersInZone(j,attackers); gZonesData[j][ZoneWarPlayers][attackers] = atk_in; gZonesData[j][ZoneWarPoints][attackers] += STAYING_POINTS*atk_in; } else { TurfWarEnd(j, gZonesData[j][ZoneOwner], gZonesData[j][ZoneAttacker]); } } } } forward StartWar(zoneid, defend_gang, attack_gang); public StartWar(zoneid, defend_gang, attack_gang) { new lol = 0; new sd; if(zoneid <= 4) sd = 12; else if(zoneid == 5 || zoneid == 6) sd = 2; else if(zoneid == 7) sd = 3; for(new i = 0; i < sd; i ++) { if(AllowedOrgs[zoneid][i] == attack_gang) lol = 1; } if(lol == 0) { /*new str[128]; format(str,128,"[ERRO] Sua gang nгo pode atacar o territуrio %s.", TurfsCoords[zoneid][zName]); SendMessageToGang(attack_gang, COLOR_RED, str);*/ gZonesData[zoneid][ZoneWarPoints][attack_gang] = 0; gZonesData[zoneid][ZoneWarKillCount][attack_gang] = 0; gZonesData[zoneid][ZonePlayerCount][attack_gang] = 0; gZonesData[zoneid][ZonePlayerReqMet][attack_gang] = 0; gZonesData[zoneid][ZoneWarPlayers][attack_gang] = 0; return 1; } if(defend_gang == TEAM_NONE && attack_gang != TEAM_NONE) { new atk_info[128], atk_info2[128]; format(atk_info,128,"Sua gang conquistou um territ¦rio desocupado"); format(atk_info2,128,"[TERRITУRIO] Sua gang conquistou um territуrio desocupado."); TextDrawSetString(AttackersTextDraw, atk_info); TextDrawAlignment(AttackersTextDraw, 2); SendMessageToGang(attack_gang, COLOR_GOLD, atk_info2); HideScreenTextForGang(attack_gang, 6200); TimeTextForGang(attack_gang, AttackersTextDraw, 6000); GangZoneHideForAll(zoneid); GangZoneShowForAll(zoneid, ((OrgsColors[attack_gang] & ~0xFF) | 0x77)); gZonesData[zoneid][ZoneOwner] = attack_gang; return 1; } gZonesData[zoneid][ZoneWarPoints][defend_gang] = DEF_POINTS; ResetWarData(zoneid, attack_gang, defend_gang); gZonesData[zoneid][ZoneWarTimeLeft] = WAR_TIME; gZonesData[zoneid][ZoneAttacker] = attack_gang; gZonesData[zoneid][ZoneInWar] = true; HideScreenTextForGang(attack_gang, 6200); HideScreenTextForGang(defend_gang, 6200); ShowTurfInfo(zoneid); for (new i=0;i<= HighestID;i++) { if(IsPlayerConnected(i)) { if(GetPlayerOrg(i) == defend_gang || GetPlayerOrg(i) == attack_gang) { GangZoneFlashForPlayer(i, zoneid, ((OrgsColors[attack_gang] & ~0xFF) | 0x77)); if(IsPlayerInTurf(i,zoneid) && GetPlayerOrg(i) == attack_gang) { AddWarPoints(i, START_WAR); } } } } gZonesData[zoneid][ZoneKillCount][attack_gang] = 0; gZonesData[zoneid][ZoneKillCount][defend_gang] = 0; gZonesData[zoneid][ZoneWarCount]++; return 1; } forward TurfWarEnd(zoneid,defend_gang,attack_gang); public TurfWarEnd(zoneid,defend_gang,attack_gang) { new msg_winner[128], msg_loser[128], text_winner[128], text_loser[128]; new winner, loser; //compare kills if(gZonesData[zoneid][ZoneWarPoints][attack_gang] == gZonesData[zoneid][ZoneWarPoints][defend_gang]) { if(gZonesData[zoneid][ZoneWarPlayers][attack_gang] <= gZonesData[zoneid][ZoneWarPlayers][defend_gang]) { winner = defend_gang; loser = attack_gang; } else if(gZonesData[zoneid][ZoneWarPlayers][attack_gang] > gZonesData[zoneid][ZoneWarPlayers][defend_gang]) { winner = attack_gang; loser = defend_gang; } } else if(gZonesData[zoneid][ZoneWarPoints][attack_gang] < gZonesData[zoneid][ZoneWarPoints][defend_gang]) { winner = defend_gang; loser = attack_gang; } else if(gZonesData[zoneid][ZoneWarPoints][attack_gang] > gZonesData[zoneid][ZoneWarPoints][defend_gang]) { winner = attack_gang; loser = defend_gang; } if(winner == defend_gang) { format(msg_winner,128,"** Sua gang defendeu o territуrio %s da gang %s **", TurfsCoords[zoneid][zName], OrgsNames[attack_gang]); format(text_winner,128,"Sua gang defendeu o territ¦rio %s da gang %s", TurfsCoords[zoneid][zName], OrgsNames[attack_gang]); TextDrawSetString(WinnerTextDraw,text_winner); TextDrawAlignment(WinnerTextDraw, 2); format(msg_loser,128,"** Sua gang falhou em dominar o territуrio %s da gang %s **",TurfsCoords[zoneid][zName], OrgsNames[defend_gang]); format(text_loser,128,"Sua gang falhou em dominar o territ¦rio %s da gang %s",TurfsCoords[zoneid][zName], OrgsNames[defend_gang]); TextDrawSetString(LoserTextDraw, text_loser); TextDrawAlignment(LoserTextDraw, 2); } else if(winner == attack_gang) { format(msg_winner,128,"** Sua gang dominou o territуrio %s da gang %s **", TurfsCoords[zoneid][zName], OrgsNames[defend_gang]); format(text_winner,128,"Sua gang dominou o territ¦rio %s da gang %s",TurfsCoords[zoneid][zName], OrgsNames[defend_gang]); TextDrawSetString(WinnerTextDraw,text_winner); TextDrawAlignment(WinnerTextDraw, 2); format(msg_loser,128,"** Sua gang perdeu o territуrio %s para a gang %s **", TurfsCoords[zoneid][zName], OrgsNames[attack_gang]); format(text_loser,128,"Sua gang perdeu o territ¦rio %s para a gang %s",TurfsCoords[zoneid][zName], OrgsNames[attack_gang]); TextDrawSetString(LoserTextDraw, text_loser); TextDrawAlignment(LoserTextDraw, 2); } //Turf color update for (new k=0;k<= HighestID;k++) { if(!IsPlayerConnected(k)) continue; if(GetPlayerOrg(k) == defend_gang || GetPlayerOrg(k) == attack_gang) { // Defenders Won if(winner == defend_gang) { if(GetPlayerOrg(k) == attack_gang) RemoveWarPoints(k, LOSE_WAR); if(GetPlayerOrg(k) == defend_gang && GetPlayerZone(k) == zoneid) AddWarPoints(k, DEFEND_TURF); if(GetPlayerOrg(k) == defend_gang) { TimeTextForPlayer(k,WinnerTextDraw,4500); SendClientMessage(k, COLOR_GOLD, msg_winner); } if(GetPlayerOrg(k) == attack_gang) { SendClientMessage(k, COLOR_GREY, msg_loser); TimeTextForPlayer(k,LoserTextDraw,4500); } } //Attackers Won else if(winner == attack_gang) { if(GetPlayerOrg(k) == defend_gang) RemoveWarPoints(k, LOSE_WAR); if(GetPlayerOrg(k) == attack_gang && IsPlayerInZone(k, zoneid)) AddWarPoints(k, TAKE_OVER); if(GetPlayerOrg(k) == defend_gang) { SendClientMessage(k, COLOR_GREY, msg_loser); TimeTextForPlayer(k,LoserTextDraw,4500); } if(GetPlayerOrg(k) == attack_gang) { TimeTextForPlayer(k,WinnerTextDraw,4500); SendClientMessage(k, COLOR_GOLD, msg_winner); } } } } HideScreenTextForGang(attack_gang, 6200); HideScreenTextForGang(defend_gang, 6200); if(winner == attack_gang) { GangZoneShowForAll(zoneid, ((OrgsColors[attack_gang] & ~0xFF) | 0x77)); gZonesData[zoneid][ZoneOwner] = attack_gang; } else if(loser == attack_gang) { GangZoneShowForAll(zoneid, ((OrgsColors[defend_gang] & ~0xFF) | 0x77)); gZonesData[zoneid][ZoneOwner] = defend_gang; } for (new i=0;i<MAX_ORGS;i++) { gZonesData[zoneid][ZoneWarPoints][i] = 0; gZonesData[zoneid][ZoneWarKillCount][i] = 0; gZonesData[zoneid][ZonePlayerCount][i] = 0; gZonesData[zoneid][ZonePlayerReqMet][i] = 0; gZonesData[zoneid][ZoneWarPlayers][i] = 0; } gZonesData[zoneid][ZoneInWar] = false; for (new k=0;k<= HighestID;k++) { if(IsPlayerConnected(k)) { if(GetPlayerOrg(k) == defend_gang || GetPlayerOrg(k) == attack_gang) { GangZoneStopFlashForPlayer(k, zoneid); } } } } forward WarCode_PlayerDeath(playerid, killerid, reason); public WarCode_PlayerDeath(playerid, killerid, reason) { new pZone = GetPlayerZone(playerid); if(!IsPlayerConnected(killerid)) { if(pZone != 999) { if(gZonesData[pZone][ZoneInWar] == true && GetPlayerVirtualWorld(playerid) == 0) { if(GetPlayerOrg(playerid) == gZonesData[pZone][ZoneOwner]) { Player[playerid][TurfDeaths] ++; gZonesData[pZone][ZoneWarPoints][gZonesData[pZone][ZoneAttacker]]+= KILLING_POINTS; } else if(GetPlayerOrg(playerid) == gZonesData[pZone][ZoneAttacker]) { Player[playerid][TurfDeaths] ++; gZonesData[pZone][ZoneWarPoints][gZonesData[pZone][ZoneOwner]]+= KILLING_POINTS; } } } } else { new kZone = GetPlayerZone(killerid); if(GetPlayerOrg(killerid) != 0 && GetPlayerVirtualWorld(playerid) == 0 && IsPlayerConnected(playerid) && IsPlayerConnected(killerid) && pZone != 999 && kZone != 999) { if(gZonesData[pZone][ZoneInWar] == true || gZonesData[kZone][ZoneInWar] == true) { new zone; if(gZonesData[pZone][ZoneInWar] == true) zone = pZone; else if(gZonesData[kZone][ZoneInWar] == true) zone = kZone; if(GetPlayerOrg(killerid) == GetPlayerOrg(playerid) && (gZonesData[kZone][ZoneOwner] == GetPlayerOrg(playerid) || gZonesData[kZone][ZoneAttacker] == GetPlayerOrg(playerid))) { new othergang; if(gZonesData[kZone][ZoneOwner] == GetPlayerOrg(killerid)) othergang = gZonesData[kZone][ZoneAttacker]; else othergang = gZonesData[kZone][ZoneOwner]; gZonesData[zone][ZoneWarPoints][othergang]+= KILLING_POINTS; gZonesData[zone][ZoneWarKillCount][othergang] ++; } else if( (GetPlayerOrg(killerid) == gZonesData[zone][ZoneAttacker] && GetPlayerOrg(playerid) == gZonesData[zone][ZoneOwner]) || (GetPlayerOrg(killerid) == gZonesData[zone][ZoneOwner] && GetPlayerOrg(playerid) == gZonesData[zone][ZoneAttacker])) { gZonesData[zone][ZoneWarPoints][GetPlayerOrg(killerid)]+= KILLING_POINTS; gZonesData[zone][ZoneWarKillCount][GetPlayerOrg(killerid)] ++; Player[killerid][TurfKills] ++; Player[playerid][TurfDeaths] ++; AddWarPoints(killerid, KILL_IN_WAR); if(GetWarPoints(playerid) >= DIE_IN_WAR) { RemoveWarPoints(playerid, DIE_IN_WAR); } if(gZonesData[zone][ZoneWarPoints][GetPlayerOrg(killerid)] >= gZonesData[zone][ZoneWarPoints][GetPlayerOrg(playerid)]) { gZonesData[zone][ZoneWarTimeLeft] -= TIME_BOBUS_WINNING; } else if(gZonesData[zone][ZoneWarPoints][GetPlayerOrg(killerid)] < gZonesData[zone][ZoneWarPoints][GetPlayerOrg(playerid)]) { gZonesData[zone][ZoneWarTimeLeft] += TIME_BOBUS_LOSING; } } } if(!gZonesData[pZone][ZoneInWar] && gZonesData[pZone][ZonePlayerReqMet] > 0 && GetPlayerOrg(killerid) == gZonesData[pZone][ZoneOwner]) { gZonesData[pZone][ZonePlayerReqMet]--; } if(kZone == pZone && gZonesData[kZone][ZoneOwner] == GetPlayerOrg(killerid) && !gZonesData[kZone][ZoneInWar] && !gZonesData[kZone][ZoneIsSpawn]) { GivePlayerGP(killerid, MONEY_BONUS); } } } } stock ResetWarData(zoneid, attack_gang, defend_gang) { gZonesData[zoneid][ZoneWarPoints][attack_gang] = 0; gZonesData[zoneid][ZoneWarPlayers][defend_gang] = 0; gZonesData[zoneid][ZoneWarPlayers][attack_gang] = 0; gZonesData[zoneid][ZonePlayerReqMet][defend_gang] = 0; gZonesData[zoneid][ZonePlayerCount][attack_gang] = 0; gZonesData[zoneid][ZonePlayerCount][defend_gang] = 0; gZonesData[zoneid][ZonePlayerReqMet][attack_gang] = 0; gZonesData[zoneid][ZoneWarKillCount][attack_gang] = 0; gZonesData[zoneid][ZoneWarKillCount][defend_gang] = 0; } forward TurfsDebug(playerid); public TurfsDebug(playerid) { for (new j=0;j<MAX_TURFS;j++) { if(gZonesData[j][ZoneInWar] == true) { if(GetPlayerOrg(playerid) == gZonesData[j][ZoneOwner] || GetPlayerOrg(playerid) == gZonesData[j][ZoneAttacker]) { GangZoneFlashForPlayer(playerid, j, ((OrgsColors[gZonesData[j][ZoneAttacker]] & ~0xFF) | 0x77)); } } } } forward ShowTurfInfo(zoneid); public ShowTurfInfo(zoneid) { new atk_info[128], atk_info2[128]; new def_info[128], def_info2[128]; format(def_info,128,"Um de nossos territ¦rios esta sendo atacado pela gang %s",OrgsNames[gZonesData[zoneid][ZoneAttacker]]); format(def_info2,128,"** Um de nossos territуrios estб sendo atacado pela gang %s **",OrgsNames[gZonesData[zoneid][ZoneAttacker]]); format(atk_info,128,"Sua Gang iniciou uma guerra de territ¦rios contra %s", OrgsNames[gZonesData[zoneid][ZoneOwner]]); format(atk_info2,128,"** Sua gang iniciou uma guerra de territуrios contra a gang %s **", OrgsNames[gZonesData[zoneid][ZoneOwner]]); TextDrawSetString(AttackersTextDraw, atk_info); TextDrawAlignment(AttackersTextDraw, 2); TextDrawSetString(DefendersTextDraw, def_info); TextDrawAlignment(DefendersTextDraw, 2); TimeTextForGang(gZonesData[zoneid][ZoneOwner],DefendersTextDraw, 6000); TimeTextForGang(gZonesData[zoneid][ZoneAttacker],AttackersTextDraw, 6000); SendMessageToGang(gZonesData[zoneid][ZoneAttacker], COLOR_GOLD, atk_info2); SendMessageToGang(gZonesData[zoneid][ZoneOwner], COLOR_RED, def_info2); new string[200]; format(string,200, "{FF0000}[GUERRAS] {FFFFFF}A ORG {33CCFF}%s {FFFFFF}estб atacando o territуrio {33CCFF}%s {FFFFFF}da ORG {33CCFF}%s.", OrgsNames[gZonesData[zoneid][ZoneAttacker]], TurfsCoords[zoneid][zName], OrgsNames[gZonesData[zoneid][ZoneOwner]]); OOCNews(COLOR_WHITE, string); return 1; } forward ShowScreenTextForGang(gangid); public ShowScreenTextForGang(gangid) { for(new i = 0; i <= HighestID; i ++) { if(IsPlayerConnected(i)) { if(GetPlayerOrg(i) == gangid) { TextDrawShowForPlayer(i, ServerLogo1); TextDrawShowForPlayer(i, ServerLogo2); // Player[i][SeeName] = true; TextDrawShowForPlayer(i, ZoneName[i]); } } } }