Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 3 из 3
  1. #1
    Аватар для Artur_Savan
    Пользователь

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

    Система capture для банд

    Добрый вечер, Ув.Люди, мне нужно поставить новую /capture систему..
    У меня уже есть готовый код, но у меня не получается его вставить в мод..
    Не могли бы мне помочь?, вот мой Skype: artur35994

    Ко всем new:
    PHP код:
    new bool:StopWar false;  
    new 
    Command[2];  
    new 
    CommandKill[2];  
    new 
    WarZoneID;  
    new 
    Textonecommand;  
    new 
    Texttwocommand;  
    new 
    Textkolone;  
    new 
    Textkoltwo;  
    new 
    Textfon;  
    new 
    Texttime;  
    new 
    Textvremya;  
    new 
    WarTimeMin;  
    new 
    WarTimeSec;  
    new 
    WarStop
    Ко всем enum:
    PHP код:
    enum pZone  
    {  
    Float:px1,  
    Float:py1,  
    Float:px2,  
    Float:py2,  
    pfrak,  
    }; 
    Добавим forward's (forward):
    PHP код:
    forward LoadGZ();  
    forward SaveGZ();  
    forward CheckArmour(); // такой форвад уже скорей всего есть, так что можно просто добавить содержимое моего кода в данный паблик 
    Создать паблики, лучше в самом конце мода:
    PHP код:
    public LoadGZ(){  
    new 
    string[256];  
    new 
    ololo[5][32];  
    new 
    Filefile fopen("zone.ini"io_read);  
    if(
    file){  
    new 
    idx;  
    while (
    idx sizeof(GZInfo)){  
    fread(filestring);  
    split(stringololo'|');  
    GZInfo[idx][px1] = floatstr(ololo[0]);  
    GZInfo[idx][py1] = floatstr(ololo[1]);  
    GZInfo[idx][px2] = floatstr(ololo[2]);  
    GZInfo[idx][py2] = floatstr(ololo[3]);  
    GZInfo[idx][pfrak] = strval(ololo[4]);  
    idx++;}  
    fclose(file);}}  

    public 
    SaveGZ(){  
    new 
    string[128], idx;  
    new 
    Filefile2;  
    while (
    idx sizeof(GZInfo)){  
    format(stringsizeof(string),"%f|%f|%f|%f|%d\n",GZInfo[idx][px1]
    ,
    GZInfo[idx][py1],GZInfo[idx][px2],  
    GZInfo[idx][py2],GZInfo[idx][pfrak]);  
    if(
    idx == 0){  
    file2 fopen("zone.ini"io_write);}  
    else{  
    file2 fopen("zone.ini"io_append);}  
    fwrite(file2,string);  
    idx++;  
    fclose(file2);}return 1;}  

    public 
    CheckArmour()  
    {  
    WarTimeSec--;  
    if(
    WarStop 0WarStop--;  
    if(
    WarStop == 0StopWar false;  
    if(
    WarTimeSec == && WarTimeMin == 0)  
    {  
    TextDrawDestroy(fon);  
    TextDrawDestroy(onecommand);  
    TextDrawDestroy(twocommand);  
    TextDrawDestroy(kolone);  
    TextDrawDestroy(koltwo);  
    TextDrawDestroy(time);  
    TextDrawDestroy(vremya);  
    GangZoneStopFlashForAll(WarZoneID);  
    SaveGZ();  
    if(
    CommandKill[0] > CommandKill[1])  
    {  
    for(new 
    0GetMaxPlayers(); i++)  
    {  
    if(
    IsPlayerConnected(i))  
    {  
    if(
    GZInfo[WarZoneID][pfrak] == 19GangZoneShowForPlayer(iWarZoneID0x00BC1E96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 20GangZoneShowForPlayer(iWarZoneID0xD800C796);  
    else if(
    GZInfo[WarZoneID][pfrak] == 21GangZoneShowForPlayer(iWarZoneID0x5418D696);  
    else if(
    GZInfo[WarZoneID][pfrak] == 22GangZoneShowForPlayer(iWarZoneID0x0098FF96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 23GangZoneShowForPlayer(iWarZoneID0xFFCF0096);  
    }  
    if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])  
    {  
    SendClientMessage(iCOLOR_GREEN"Вы выиграли эту битву.");  
    }  
    }  
    GZInfo[WarZoneID][pfrak] = Command[0];  
    }  
    else if(
    CommandKill[0] < CommandKill[1])  
    {  
    for(new 
    0GetMaxPlayers(); i++)  
    {  
    if(
    IsPlayerConnected(i))  
    {  
    if(
    GZInfo[WarZoneID][pfrak] == 19GangZoneShowForPlayer(iWarZoneID0x00BC1E96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 20GangZoneShowForPlayer(iWarZoneID0xD800C796);  
    else if(
    GZInfo[WarZoneID][pfrak] == 21GangZoneShowForPlayer(iWarZoneID0x5418D696);  
    else if(
    GZInfo[WarZoneID][pfrak] == 22GangZoneShowForPlayer(iWarZoneID0x0098FF96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 23GangZoneShowForPlayer(iWarZoneID0xFFCF0096);  
    }  
    if(
    PlayerInfo[i][pMember] == Command[1] || PlayerInfo[i][pLeader] == Command[1])  
    {  
    SendClientMessage(iCOLOR_GRAD1"Вы выиграли эту битву.");  
    }  
    else if(
    PlayerInfo[i][pMember] == Command[0] || PlayerInfo[i][pLeader] == Command[0])  
    {  
    new 
    string[64],ftext[16];  
    if(
    GZInfo[WarZoneID][pfrak] == 19ftext "The Grove";  
    else if(
    GZInfo[WarZoneID][pfrak] == 20ftext "Ballas";  
    else if(
    GZInfo[WarZoneID][pfrak] == 21ftext "Rifa";  
    else if(
    GZInfo[WarZoneID][pfrak] == 22ftext "Aztecas";  
    else if(
    GZInfo[WarZoneID][pfrak] == 23ftext "Vagos";  
    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] == 19GangZoneShowForPlayer(iWarZoneID0x00BC1E96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 20GangZoneShowForPlayer(iWarZoneID0xD800C796);  
    else if(
    GZInfo[WarZoneID][pfrak] == 21GangZoneShowForPlayer(iWarZoneID0x5418D696);  
    else if(
    GZInfo[WarZoneID][pfrak] == 22GangZoneShowForPlayer(iWarZoneID0x0098FF96);  
    else if(
    GZInfo[WarZoneID][pfrak] == 23GangZoneShowForPlayer(iWarZoneID0xFFCF0096);  
    }  
    }  
    }  
    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(vremyastring);  

    В public OnGameModeInit() добавим:
    PHP код:
    SetTimer("CheckArmour",1000,1); // если такого нет  
    LoadGZ();  
    for(new 
    0sizeof(GZInfo); i++)  
    {  
    GangZoneCreate(GZInfo[i][px1],GZInfo[i][py1],GZInfo[
    i][px2],GZInfo[i][py2]);  

    В public OnPlayerConnect() добавим:
    PHP код:
    for(new 0sizeof(GZInfo); i++)  
    {  
    if(
    GZInfo[i][pfrak] == 0GangZoneShowForPlayer(playeridi0xB4B4B496);  
    else if(
    GZInfo[i][pfrak] == 19GangZoneShowForPlayer(playeridi0x00BC1E96);  
    else if(
    GZInfo[i][pfrak] == 20GangZoneShowForPlayer(playeridi0xD800C796);  
    else if(
    GZInfo[i][pfrak] == 21GangZoneShowForPlayer(playeridi0x5418D696);  
    else if(
    GZInfo[i][pfrak] == 22GangZoneShowForPlayer(playeridi0x0098FF96);  
    else if(
    GZInfo[i][pfrak] == 23GangZoneShowForPlayer(playeridi0xFFCF0096); 
    В public OnPlayerDisconnect() добавим:
    PHP код:
    if(PlayerInfo[playerid][pMember] == Command[0] || PlayerInfo[playerid][pLeader] == Command[0] ||  
    PlayerInfo[playerid][pMember] == Command[1] || PlayerInfo[playerid][pLeader] == Command[1])  
    {  
    TextDrawHideForPlayer(playeridfon);  
    TextDrawHideForPlayer(playeridonecommand);  
    TextDrawHideForPlayer(playeridtwocommand);  
    TextDrawHideForPlayer(playeridkolone);  
    TextDrawHideForPlayer(playeridkoltwo);  
    TextDrawHideForPlayer(playeridtime);  
    TextDrawHideForPlayer(playeridvremya);  

    В public OnPlayerDeath() добавим:
    PHP код:
    if(WarTimeSec 0)  
    {  
    if(
    PlayerInfo[playerid][pMember] == Command[0] || PlayerInfo[playerid][pLeader] == Command[0])  
    {  
    if(
    PlayerInfo[killerid][pMember] == Command[1] || PlayerInfo[killerid][pLeader] == Command[1])  
    {  
    new 
    Float:xFloat:yFloat:z;  
    GetPlayerPos(playeridx,y,z);  
    if((
    >= GZInfo[WarZoneID][px1] && <= GZInfo[WarZoneID][px2]) &&  
    (
    >= GZInfo[WarZoneID][py1] && <= GZInfo[WarZoneID][py2]))  
    {  
    CommandKill[1]++;  
    new 
    string[12];  
    format(stringsizeof(string),"%d",CommandKill[1]);  
    TextDrawSetString(kolonestring);  
    }  
    }  
    }  
    if(
    PlayerInfo[playerid][pMember] == Command[1] || PlayerInfo[playerid][pLeader] == Command[1])  
    {  
    if(
    PlayerInfo[killerid][pMember] == Command[0] || PlayerInfo[killerid][pLeader] == Command[0])  
    {  
    new 
    Float:xFloat:yFloat:z;  
    GetPlayerPos(playeridx,y,z);  
    if((
    >= GZInfo[WarZoneID][px1] && <= GZInfo[WarZoneID][px2]) &&  
    (
    >= GZInfo[WarZoneID][py1] && <= GZInfo[WarZoneID][py2]))  
    {  
    CommandKill[0]++;  
    new 
    string[12];  
    format(stringsizeof(string),"%d",CommandKill[0]);  
    TextDrawSetString(koltwostring);  
    }  
    }  
    }  

    В public OnPlayerCommandText(playerid, cmdtext[]) добавим:
    PHP код:
    else if(strcmp(cmd"/gzone"true) == 0)  
    {  
    if(
    PlayerInfo[playerid][pAdmin] >= 1)  
    {  
    tmp=strtok(cmdtextidx);  
    if(!
    strlen(tmp) || (!IsNumeric(tmp)))  
    {  
    SendClientMessage(playeridCOLOR_GRAD1"Используйте: /gzone [ 19 - 23 ]");  
    return 
    1;  
    }  
    new 
    banda strval(tmp);  
    if(
    banda 18 && banda 24)  
    {  
    new 
    zid;  
    new 
    Float:xFloat:yFloat:z;  
    GetPlayerPos(playeridx,y,z);  
    for(new 
    0sizeof(GZInfo); i++)  
    {  
    if((
    >= GZInfo[i][px1] && <= GZInfo[i][px2]) &&  
    (
    >= GZInfo[i][py1] && <= GZInfo[i][py2]))  
    {  
    zid i;  
    5555;  
    }  
    }  
    GZInfo[zid][pfrak] = banda;  
    SaveGZ();  
    if(
    GZInfo[zid][pfrak] == 19GangZoneShowForAll(zid0x00BC1E96);  
    else if(
    GZInfo[zid][pfrak] == 20GangZoneShowForAll(zid0xD800C796);  
    else if(
    GZInfo[zid][pfrak] == 21GangZoneShowForAll(zid0x5418D696);  
    else if(
    GZInfo[zid][pfrak] == 22GangZoneShowForAll(zid0x0098FF96);  
    else if(
    GZInfo[zid][pfrak] == 23GangZoneShowForAll(zid0xFFCF0096);  
    SendClientMessage(playerid,COLOR_GRAD1"Сделано.");  
    }  
    else  
    {  
    SendClientMessage(playeridCOLOR_GRAD1"Недопустимое значение.");  
    return 
    1;  
    }  
    }  


    else if(
    strcmp(cmd"/capture"true) == 0)  
    {  
    new 
    fntext[60];  
    new 
    string[128];  
    new 
    fztext[60];  
    if(
    PlayerInfo[playerid][pMember] >= 19 && PlayerInfo[playerid][pMember] <= 23)  
    {  
    if(
    PlayerInfo[playerid][pRang] >= 7)  
    {  
    if(
    StopWar == false)  
    {  
    if(
    Command[0] != 0) { SendClientMessage(playeridCOLOR_GRAD1"На данный момент уже захватывается территория"); return 1; }  
    new 
    zid,mid;  
    new 
    Float:xFloat:yFloat:z;  
    GetPlayerPos(playeridx,y,z);  
    for(new 
    0sizeof(GZInfo); i++)  
    {  
    if((
    >= GZInfo[i][px1] && <= GZInfo[i][px2]) &&  
    (
    >= GZInfo[i][py1] && <= GZInfo[i][py2]))  
    {  
    zid i;  
    5555;  
    }  
    }  
    if(
    PlayerInfo[playerid][pMember] != 0mid PlayerInfo[playerid][pMember];  
    else if(
    PlayerInfo[playerid][pLeader] != 0mid PlayerInfo[playerid][pLeader];  
    if(
    mid == GZInfo[zid][pfrak]) { SendClientMessage(playeridCOLOR_GRAD1"Данная территория принадлежит вам"); return 1; }  
    if(
    GZInfo[zid][pfrak] == 0)  
    {  
    GZInfo[zid][pfrak] = mid;  
    SaveGZ();  
    if(
    GZInfo[zid][pfrak] == 19GangZoneShowForPlayer(playeridzid0x03c03cAA);  
    else if(
    GZInfo[zid][pfrak] == 20GangZoneShowForPlayer(playeridzid0xcd00cdAA);  
    else if(
    GZInfo[zid][pfrak] == 21GangZoneShowForPlayer(playeridzid0x3D62F296);  
    else if(
    GZInfo[zid][pfrak] == 22GangZoneShowForPlayer(playeridzid0x1ee7ffAA);  
    else if(
    GZInfo[zid][pfrak] == 23GangZoneShowForPlayer(playeridzid0xffd700AA);  
    return 
    1;  
    }  
    new 
    kol;  
    for(new 
    0GetMaxPlayers(); i++)  
    {  
    if(
    PlayerInfo[i][pMember] == GZInfo[zid][pfrak] ||  
    PlayerInfo[i][pLeader] == GZInfo[zid][pfrak])  
    {  
    kol++;  
    }  
    }  
    if(
    kol 1) { SendClientMessage(playeridCOLOR_GRAD1"У данной банды нету онлайна"); return 1; }  
    if(
    mid == 19fntext "Grove Street";  
    else if(
    mid == 20fntext "The Ballas";  
    else if(
    mid == 21fntext "The Rifa";  
    else if(
    mid == 22fntext "Varios Los Aztecas";  
    else if(
    mid == 23fntext "Los Santos Vagos";  
    if(
    GZInfo[zid][pfrak] == 19fztext "Grove Street";  
    else if(
    GZInfo[zid][pfrak] == 20fztext "The Ballas";  
    else if(
    GZInfo[zid][pfrak] == 21fztext "The Rifa";  
    else if(
    GZInfo[zid][pfrak] == 22fztext "Varios Los Aztecas";  
    else if(
    GZInfo[zid][pfrak] == 23fztext "Los Santos Vagos";  
    format(stringsizeof(string), "Банда '%s' начала захват территории у '%s' в районе '%s'",fntextfztextGetPlayerZone(playerid));  
    SendFamilyMessage(190xdd4400AAstring),SendFamilyMessage(200xdd4400AAstring),SendFamilyMessage(210xdd4400AAstring),SendFamilyMessage(220xdd4400AAstring),SendFamilyMessage(230xdd4400AAstring);  
    GangZoneFlashForAll(zidCOLOR_RED);  
    Command[0] = mid;  
    Command[1] = GZInfo[zid][pfrak];  
    WarZoneID zid;  
    new 
    ftext[16];  
    fon TextDrawCreate(1285"_");  
    TextDrawUseBox(fon1);  
    TextDrawBoxColor(fon0x00000075);  
    TextDrawTextSize(fon150.0400.0);  
    TextDrawLetterSize(fon0.05.3);  
    time TextDrawCreate(10.0285.0"Time:");  
    TextDrawLetterSize(time0.41.2);  
    TextDrawColor(time0x37FA00FF);  
    TextDrawFont(time2);  
    TextDrawSetProportional(time1);  
    TextDrawSetOutline(time2);  
    vremya TextDrawCreate(50.0285.0"5:00");  
    TextDrawLetterSize(vremya0.41.2);  
    TextDrawColor(vremya0x37FA00FF);  
    TextDrawFont(vremya2);  
    TextDrawSetOutline(vremya2);  
    if(
    mid == 19ftext "Grove";  
    else if(
    mid == 20ftext "Ballas";  
    else if(
    mid == 21ftext "Rifa";  
    else if(
    mid == 22ftext "Aztecas";  
    else if(
    mid == 23ftext "Vagos";  
    onecommand TextDrawCreate(10.0300.0ftext);  
    TextDrawLetterSize(onecommand0.41.2);  
    TextDrawFont(onecommand2);  
    TextDrawSetOutline(onecommand2);  
    if(
    GZInfo[zid][pfrak] == 19ftext "Grove";  
    else if(
    GZInfo[zid][pfrak] == 20ftext "Ballas";  
    else if(
    GZInfo[zid][pfrak] == 21ftext "Rifa";  
    else if(
    GZInfo[zid][pfrak] == 22ftext "Aztecas";  
    else if(
    GZInfo[zid][pfrak] == 23ftext "Vagos";  
    twocommand TextDrawCreate(10.0315.0ftext);  
    TextDrawUseBox(twocommand0);  
    TextDrawLetterSize(twocommand0.41.2);  
    TextDrawFont(twocommand2);  
    TextDrawSetOutline(twocommand2);  
    kolone TextDrawCreate(133.0315.0"0");  
    TextDrawLetterSize(kolone0.41.2);  
    TextDrawFont(kolone2);  
    TextDrawSetOutline(kolone2);  
    koltwo TextDrawCreate(133.0300.0"0");  
    TextDrawLetterSize(koltwo0.41.2);  
    TextDrawFont(koltwo2);  
    TextDrawSetOutline(koltwo2);  
    for(new 
    0GetMaxPlayers();i++)  
    {  
    if((
    PlayerInfo[i][pMember] >= 19 && PlayerInfo[i][pMember] <= 23) ||  
    (
    PlayerInfo[i][pLeader] >= 19 && PlayerInfo[i][pLeader] <= 23))  
    {  
    TextDrawShowForPlayer(i,fon);  
    TextDrawShowForPlayer(i,time);  
    TextDrawShowForPlayer(i,vremya);  
    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(playeridCOLOR_GRAD1"Захват территории возможен 1 раз в час");  
    return 
    1;  
    }  
    }  
    else  
    {  
    SendClientMessage(playeridCOLOR_GRAD1"Данная функция доступна с 7 ранга");  
    return 
    1;  
    }  
    }  
    else  
    {  
    SendClientMessage(playeridCOLOR_GRAD1"Данная функция Вам не доступна");  
    return 
    1;  
    }  

    Очень буду вам благодарен, с ув.Артур Саван ...

  2. #2
    Аватар для Osetin
    •Администратор•

    Статус
    Оффлайн
    Регистрация
    26.03.2013
    Адрес
    ♔Osetia, Vladikavkaz♔
    Сообщений
    3,432
    Репутация:
    1093 ±
    Выкладывай сюда, что не получается, а не готовый код, который взял откуда-то.

  3. #3
    Аватар для Artur_Savan
    Пользователь

    Статус
    Оффлайн
    Регистрация
    15.02.2017
    Сообщений
    2
    Репутация:
    0 ±
    Osetin, я могу дать тебе мод что бы ты вставил туда это всё, у меня просто миллион ошибок!
    Вот сылка: https://yadi.sk/d/jbQMltxh3E8WyN
    Мне очень нужна твоя помощь!

 

 

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

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

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

Ваши права

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