Вход

Просмотр полной версии : [Вопрос] capture



man876
08.11.2017, 22:14
Всем привет! Помогите исправить капт, уже не знаю что делать..
Крч захватил я терру и пишет "Вы выиграли эту битву", но цвет трры не меняется.

public CheckCapture()
{
WarTimeSec--;
if(WarStop > 0) WarStop--;
if(WarStop == 0) StopWar = false;
if(WarTimeSec == 0 && WarTimeMin == 0)
{
TextDrawDestroy(fon);
TextDrawDestroy(onecommand);
TextDrawDestroy(twocommand);
TextDrawDestroy(kolone);
TextDrawDestroy(koltwo);
TextDrawDestroy(times);
TextDrawDestroy(vremyas);
GangZoneStopFlashForAll(WarZoneID);
SaveGZ();
if(CommandKill[0] > CommandKill[1])
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
SendClientMessage(i, COLOR_GREEN, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
GZInfo[WarZoneID][pfrak] = Command[0];
}
else if(CommandKill[0] < CommandKill[1])
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GRAD1, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
else if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
new string[64], ftext[16];
if(GZInfo[WarZoneID][pfrak] == 11) ftext = "Ballas";
else if(GZInfo[WarZoneID][pfrak] == 12) ftext = "The Grove";
else if(GZInfo[WarZoneID][pfrak] == 13) ftext = "Vagos";
else if(GZInfo[WarZoneID][pfrak] == 14) ftext = "Aztecas";
format(string, sizeof(string),"Вам не удалось захватить территорию банды %s",ftext);
SendClientMessage(i, COLOR_GREEN, string);
}
}
}
else
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GREEN, "Ничья, зона остаётся у вас.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
}
Command[0] = 0;
Command[1] = 0;
}
else if(WarTimeSec == 0) { WarTimeSec = 60; WarTimeMin--; }
new string[32];
if(WarTimeSec > 9) format(string, sizeof(string),"%d:%d",WarTimeMin,WarTimeSec);
else format(string, sizeof(string),"%d:0%d",WarTimeMin,WarTimeSec);
TextDrawSetString(vremyas, string);
return 1;
}

Вот сама команда



else if(strcmp(cmd, "/capture", true) == 0)
{
new fntext[60];
//new string[128];
new fztext[60];
if(GZGang(playerid))
{
if(PlayerInfo[playerid][pRank] >= 7)
{
if(StopWar == false)
{
if(Command[0] != 0) { SendClientMessage(playerid, COLOR_GRAD1, "На данный момент уже захватывается территория"); return 1; }
new zid,mid;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
for(new i = 0; i < sizeof(GZInfo); i++)
{
if((x >= GZInfo[i][px1] && x <= GZInfo[i][px2]) &&
(y >= GZInfo[i][py1] && y <= GZInfo[i][py2]))
{
zid = i;
i = 5555;
}
}
if(PlayerInfo[playerid][pMember] != 0) mid = PlayerInfo[playerid][pMember];
else if(PlayerInfo[playerid][pLeader] != 0) mid = PlayerInfo[playerid][pLeader];
if(mid == GZInfo[zid][pfrak]) { SendClientMessage(playerid, COLOR_GRAD1, "Данная территория принадлежит вам"); return 1; }
if(GZInfo[zid][pfrak] == 0)
{
GZInfo[zid][pfrak] = mid;
SaveGZ();
if(GZInfo[zid][pfrak] == 11) GangZoneShowForPlayer(playerid, zid, 0xcd00cdAA);
else if(GZInfo[zid][pfrak] == 12) GangZoneShowForPlayer(playerid, zid, 0x03c03cAA);
else if(GZInfo[zid][pfrak] == 13) GangZoneShowForPlayer(playerid, zid, 0xffd700AA);
else if(GZInfo[zid][pfrak] == 14) GangZoneShowForPlayer(playerid, zid, 0x1ee7ffAA);
return 1;
}
new kol;
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == GZInfo[zid][pfrak] ||
PlayerInfo[i][pLeader] == GZInfo[zid][pfrak])
{
kol++;
}
}
if(kol < 1) { SendClientMessage(playerid, COLOR_GRAD1, "У данной банды нету онлайна"); return 1; }
if (mid == 11) fntext = "The Ballas";
else if(mid == 12) fntext = "Grove Street";
else if(mid == 13) fntext = "Los Santos Vagos";
else if(mid == 14) fntext = "Varios Los Aztecas";
if(GZInfo[zid][pfrak] == 11) fztext = "The Ballas";
else if(GZInfo[zid][pfrak] == 12) fztext = "Grove Street";
else if(GZInfo[zid][pfrak] == 13) fztext = "Los Santos Vagos";
else if(GZInfo[zid][pfrak] == 14) fztext = "Varios Los Aztecas";
format(string, sizeof(string), "Банда '%s' начала захват территории у '%s' в районе '%s'",fntext, fztext, GetPlayerZone(playerid));
SendFamilyMessage(11, 0xdd4400AA, string),SendFamilyMessage(12, 0xdd4400AA, string),SendFamilyMessage(13, 0xdd4400AA, string),SendFamilyMessage(14, 0xdd4400AA, string);
GangZoneFlashForAll(zid, COLOR_RED);
Command[0] = mid;
Command[1] = GZInfo[zid][pfrak];
WarZoneID = zid;
new ftext[16];
fon = TextDrawCreate(1, 285, "_");
TextDrawUseBox(fon, 1);
TextDrawBoxColor(fon, 0x00000075);
TextDrawTextSize(fon, 150.0, 400.0);
TextDrawLetterSize(fon, 0.0, 5.3);
times = TextDrawCreate(10.0, 285.0, "Time:");
TextDrawLetterSize(times, 0.4, 1.2);
TextDrawColor(times, 0x37FA00FF);
TextDrawFont(times, 2);
TextDrawSetProportional(times, 1);
TextDrawSetOutline(times, 2);
vremyas = TextDrawCreate(50.0, 285.0, "5:00");
TextDrawLetterSize(vremyas, 0.4, 1.2);
TextDrawColor(vremyas, 0x37FA00FF);
TextDrawFont(vremyas, 2);
TextDrawSetOutline(vremyas, 2);
if(mid == 11) ftext = "Ballas";
else if(mid == 12) ftext = "Grove";
else if(mid == 13) ftext = "Vagos";
else if(mid == 14) ftext = "Aztecas";
onecommand = TextDrawCreate(10.0, 300.0, ftext);
TextDrawLetterSize(onecommand, 0.4, 1.2);
TextDrawFont(onecommand, 2);
TextDrawSetOutline(onecommand, 2);
if(GZInfo[zid][pfrak] == 11) ftext = "Ballas";
else if(GZInfo[zid][pfrak] == 12) ftext = "Grove";
else if(GZInfo[zid][pfrak] == 13) ftext = "Vagos";
else if(GZInfo[zid][pfrak] == 14) ftext = "Aztecas";
twocommand = TextDrawCreate(10.0, 315.0, ftext);
TextDrawUseBox(twocommand, 0);
TextDrawLetterSize(twocommand, 0.4, 1.2);
TextDrawFont(twocommand, 2);
TextDrawSetOutline(twocommand, 2);
kolone = TextDrawCreate(133.0, 315.0, "0");
TextDrawLetterSize(kolone, 0.4, 1.2);
TextDrawFont(kolone, 2);
TextDrawSetOutline(kolone, 2);
koltwo = TextDrawCreate(133.0, 300.0, "0");
TextDrawLetterSize(koltwo, 0.4, 1.2);
TextDrawFont(koltwo, 2);
TextDrawSetOutline(koltwo, 2);
for(new i = 0; i < GetMaxPlayers();i++)
{
if((PlayerInfo[i][pMember] >= 11 && PlayerInfo[i][pMember] <= 14) ||
(PlayerInfo[i][pLeader] >= 11 && PlayerInfo[i][pLeader] <= 14))
{
TextDrawShowForPlayer(i,fon);
TextDrawShowForPlayer(i,times);
TextDrawShowForPlayer(i,vremyas);
TextDrawShowForPlayer(i,onecommand);
TextDrawShowForPlayer(i,twocommand);
TextDrawShowForPlayer(i,kolone);
TextDrawShowForPlayer(i,koltwo);
}
}
WarTimeMin = 2;
WarTimeSec = 60;
WarStop = 7200000;
CommandKill[0] = 0;
CommandKill[1] = 0;
StopWar = true;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Захват территории возможен 1 раз в час");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Данная функция доступна с 7 ранга");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Данная функция Вам не доступна");
return 1;
}
}

man876
10.11.2017, 17:57
UP UP UP
Вот тут ошибка, гз не меняет цвет после победы :fool:

if(CommandKill[0] > CommandKill[1])
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
SendClientMessage(i, COLOR_GREEN, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
GZInfo[WarZoneID][pfrak] = Command[0];
}

DeimoS
10.11.2017, 18:13
public CheckCapture()
{
WarTimeSec--;
if(WarStop > 0) WarStop--;
if(WarStop == 0) StopWar = false;
if(WarTimeSec == 0 && WarTimeMin == 0)
{
TextDrawDestroy(fon);
TextDrawDestroy(onecommand);
TextDrawDestroy(twocommand);
TextDrawDestroy(kolone);
TextDrawDestroy(koltwo);
TextDrawDestroy(times);
TextDrawDestroy(vremyas);
GangZoneStopFlashForAll(WarZoneID);
SaveGZ();
if(CommandKill[0] > CommandKill[1])
{
GZInfo[WarZoneID][pfrak] = Command[0];
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
SendClientMessage(i, COLOR_GREEN, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
}
else if(CommandKill[0] < CommandKill[1])
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GRAD1, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
else if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
new string[64], ftext[16];
if(GZInfo[WarZoneID][pfrak] == 11) ftext = "Ballas";
else if(GZInfo[WarZoneID][pfrak] == 12) ftext = "The Grove";
else if(GZInfo[WarZoneID][pfrak] == 13) ftext = "Vagos";
else if(GZInfo[WarZoneID][pfrak] == 14) ftext = "Aztecas";
format(string, sizeof(string),"Вам не удалось захватить территорию банды %s",ftext);
SendClientMessage(i, COLOR_GREEN, string);
}
}
}
else
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GREEN, "Ничья, зона остаётся у вас.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
}
Command[0] = 0;
Command[1] = 0;
}
else if(WarTimeSec == 0) { WarTimeSec = 60; WarTimeMin--; }
new string[32];
if(WarTimeSec > 9) format(string, sizeof(string),"%d:%d",WarTimeMin,WarTimeSec);
else format(string, sizeof(string),"%d:0%d",WarTimeMin,WarTimeSec);
TextDrawSetString(vremyas, string);
return 1;
}

man876
10.11.2017, 18:25
public CheckCapture()
{
WarTimeSec--;
if(WarStop > 0) WarStop--;
if(WarStop == 0) StopWar = false;
if(WarTimeSec == 0 && WarTimeMin == 0)
{
TextDrawDestroy(fon);
TextDrawDestroy(onecommand);
TextDrawDestroy(twocommand);
TextDrawDestroy(kolone);
TextDrawDestroy(koltwo);
TextDrawDestroy(times);
TextDrawDestroy(vremyas);
GangZoneStopFlashForAll(WarZoneID);
SaveGZ();
if(CommandKill[0] > CommandKill[1])
{
GZInfo[WarZoneID][pfrak] = Command[0];
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
SendClientMessage(i, COLOR_GREEN, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
}
else if(CommandKill[0] < CommandKill[1])
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GRAD1, "Вы выиграли эту битву.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
else if(PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
{
new string[64], ftext[16];
if(GZInfo[WarZoneID][pfrak] == 11) ftext = "Ballas";
else if(GZInfo[WarZoneID][pfrak] == 12) ftext = "The Grove";
else if(GZInfo[WarZoneID][pfrak] == 13) ftext = "Vagos";
else if(GZInfo[WarZoneID][pfrak] == 14) ftext = "Aztecas";
format(string, sizeof(string),"Вам не удалось захватить территорию банды %s",ftext);
SendClientMessage(i, COLOR_GREEN, string);
}
}
}
else
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
{
SendClientMessage(i, COLOR_GREEN, "Ничья, зона остаётся у вас.");
if(GZInfo[WarZoneID][pfrak] == 11) GangZoneShowForPlayer(i, WarZoneID, 0xD800C796);
else if(GZInfo[WarZoneID][pfrak] == 12) GangZoneShowForPlayer(i, WarZoneID, 0x00BC1E96);
else if(GZInfo[WarZoneID][pfrak] == 13) GangZoneShowForPlayer(i, WarZoneID, 0xFFCF0096);
else if(GZInfo[WarZoneID][pfrak] == 14) GangZoneShowForPlayer(i, WarZoneID, 0x0098FF96);
}
}
}
Command[0] = 0;
Command[1] = 0;
}
else if(WarTimeSec == 0) { WarTimeSec = 60; WarTimeMin--; }
new string[32];
if(WarTimeSec > 9) format(string, sizeof(string),"%d:%d",WarTimeMin,WarTimeSec);
else format(string, sizeof(string),"%d:0%d",WarTimeMin,WarTimeSec);
TextDrawSetString(vremyas, string);
return 1;
}
Спасибо большое, все получилось