Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 4 из 4

Тема: capture

  1. #1
    Аватар для man876
    Пользователь

    Статус
    Оффлайн
    Регистрация
    03.05.2014
    Сообщений
    15
    Репутация:
    0 ±

    capture

    Всем привет! Помогите исправить капт, уже не знаю что делать..
    Крч захватил я терру и пишет "Вы выиграли эту битву", но цвет трры не меняется.
    Код:
    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;
            }
        }

  2. #2
    Аватар для man876
    Пользователь

    Статус
    Оффлайн
    Регистрация
    03.05.2014
    Сообщений
    15
    Репутация:
    0 ±
    UP UP UP
    Вот тут ошибка, гз не меняет цвет после победы
    Код:
            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];
            }

  3. #3
    Аватар для DeimoS
    Модератор?

    Статус
    Оффлайн
    Регистрация
    27.01.2014
    Адрес
    Восточный Мордор
    Сообщений
    5,588
    Репутация:
    1984 ±
    PHP код:
    public CheckCapture()
    {
        
    WarTimeSec--;
        if(
    WarStop 0WarStop--;
        if(
    WarStop == 0StopWar false;
        if(
    WarTimeSec == && 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 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
                    {
                        
    SendClientMessage(iCOLOR_GREEN"Вы выиграли эту битву.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                }
            }
            else if(
    CommandKill[0] < CommandKill[1])
            {
                for(new 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
                    {
                        
    SendClientMessage(iCOLOR_GRAD1"Вы выиграли эту битву.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                    else if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
                    {
                        new 
    string[64], ftext[16];
                        if(
    GZInfo[WarZoneID][pfrak] == 11ftext "Ballas";
                        else if(
    GZInfo[WarZoneID][pfrak] == 12ftext "The Grove";
                        else if(
    GZInfo[WarZoneID][pfrak] == 13ftext "Vagos";
                        else if(
    GZInfo[WarZoneID][pfrak] == 14ftext "Aztecas";
                        
    format(stringsizeof(string),"Вам не удалось захватить территорию банды %s",ftext);
                        
    SendClientMessage(iCOLOR_GREENstring);
                    }
                }
            }
            else
            {
                for(new 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
                    {
                        
    SendClientMessage(iCOLOR_GREEN"Ничья, зона остаётся у вас.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                }
            }
            
    Command[0] = 0;
            
    Command[1] = 0;
        }
        else if(
    WarTimeSec == 0) { WarTimeSec 60WarTimeMin--; }
        new 
    string[32];
        if(
    WarTimeSec 9format(stringsizeof(string),"%d:%d",WarTimeMin,WarTimeSec);
        else 
    format(stringsizeof(string),"%d:0%d",WarTimeMin,WarTimeSec);
        
    TextDrawSetString(vremyasstring);
        return 
    1;

    Связаться со мной в VK можно через личные сообщения этой группы
    Заказы не принимаю

    Широко известно, что идеи стоят 0.8333 цента каждая (исходя из рыночной цены 10 центов за дюжину).
    Великих идей полно, на них нет спроса.
    Воплощение идеи в законченную игру требует долгой работы,
    таланта, терпения и креативности, не говоря уж о затратах денег, времени и ресурсов.
    Предложить идею просто, воплотить – вот в чём проблема

    Steve Pavlina

  4. #4
    Аватар для man876
    Пользователь

    Статус
    Оффлайн
    Регистрация
    03.05.2014
    Сообщений
    15
    Репутация:
    0 ±
    Цитата Сообщение от DeimoS Посмотреть сообщение
    PHP код:
    public CheckCapture()
    {
        
    WarTimeSec--;
        if(
    WarStop 0WarStop--;
        if(
    WarStop == 0StopWar false;
        if(
    WarTimeSec == && 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 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
                    {
                        
    SendClientMessage(iCOLOR_GREEN"Вы выиграли эту битву.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                }
            }
            else if(
    CommandKill[0] < CommandKill[1])
            {
                for(new 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
                    {
                        
    SendClientMessage(iCOLOR_GRAD1"Вы выиграли эту битву.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                    else if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])
                    {
                        new 
    string[64], ftext[16];
                        if(
    GZInfo[WarZoneID][pfrak] == 11ftext "Ballas";
                        else if(
    GZInfo[WarZoneID][pfrak] == 12ftext "The Grove";
                        else if(
    GZInfo[WarZoneID][pfrak] == 13ftext "Vagos";
                        else if(
    GZInfo[WarZoneID][pfrak] == 14ftext "Aztecas";
                        
    format(stringsizeof(string),"Вам не удалось захватить территорию банды %s",ftext);
                        
    SendClientMessage(iCOLOR_GREENstring);
                    }
                }
            }
            else
            {
                for(new 
    0GetMaxPlayers(); i++)
                {
                    if(
    PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])
                    {
                        
    SendClientMessage(iCOLOR_GREEN"Ничья, зона остаётся у вас.");
                        if(
    GZInfo[WarZoneID][pfrak] == 11)  GangZoneShowForPlayer(iWarZoneID0xD800C796);
                        else if(
    GZInfo[WarZoneID][pfrak] == 12GangZoneShowForPlayer(iWarZoneID0x00BC1E96);
                        else if(
    GZInfo[WarZoneID][pfrak] == 13)  GangZoneShowForPlayer(iWarZoneID0xFFCF0096);
                        else if(
    GZInfo[WarZoneID][pfrak] == 14)  GangZoneShowForPlayer(iWarZoneID0x0098FF96);
                    }
                }
            }
            
    Command[0] = 0;
            
    Command[1] = 0;
        }
        else if(
    WarTimeSec == 0) { WarTimeSec 60WarTimeMin--; }
        new 
    string[32];
        if(
    WarTimeSec 9format(stringsizeof(string),"%d:%d",WarTimeMin,WarTimeSec);
        else 
    format(stringsizeof(string),"%d:0%d",WarTimeMin,WarTimeSec);
        
    TextDrawSetString(vremyasstring);
        return 
    1;

    Спасибо большое, все получилось
    Последний раз редактировалось man876; 10.11.2017 в 18:32.

 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •