Sign in to follow this  
Followers 0

Система анти +c на текстдравах

2 posts in this topic

Guest stibs
Новичок

Всем привет! Сегодня сделаем систему анти +с баг. Т.е. пофиксим этот баг, система подойдет для РП серверов. 

В начало мода, ко всем #define:

Спойлер

#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 

 

Потом сразу после дефайна можно создать new:

Спойлер

new PlayerText:AntiCbug[MAX_PLAYERS][4]; 

 

Далее в OnPlayerConnect вставляем:

Спойлер

    AntiCbug[playerid][0] = CreatePlayerTextDraw(playerid, 256.470581, 228.083328, "LD_SPAC:white");
    PlayerTextDrawLetterSize(playerid, AntiCbug[playerid][0], 0.000000, 0.000000);
    PlayerTextDrawTextSize(playerid, AntiCbug[playerid][0], 131.764709, 29.749984);
    PlayerTextDrawAlignment(playerid, AntiCbug[playerid][0], 1);
    PlayerTextDrawColor(playerid, AntiCbug[playerid][0], -5963521);
    PlayerTextDrawSetShadow(playerid, AntiCbug[playerid][0], 0);
    PlayerTextDrawSetOutline(playerid, AntiCbug[playerid][0], 0);
    PlayerTextDrawFont(playerid, AntiCbug[playerid][0], 4);

    AntiCbug[playerid][1] = CreatePlayerTextDraw(playerid, 258.823516, 231.000000, "LD_SPAC:white");
    PlayerTextDrawLetterSize(playerid, AntiCbug[playerid][1], 0.000000, 0.000000);
    PlayerTextDrawTextSize(playerid, AntiCbug[playerid][1], 126.588226, 24.500000);
    PlayerTextDrawAlignment(playerid, AntiCbug[playerid][1], 1);
    PlayerTextDrawColor(playerid, AntiCbug[playerid][1], -1523963137);
    PlayerTextDrawSetShadow(playerid, AntiCbug[playerid][1], 0);
    PlayerTextDrawSetOutline(playerid, AntiCbug[playerid][1], 0);
    PlayerTextDrawFont(playerid, AntiCbug[playerid][1], 4);

    AntiCbug[playerid][2] = CreatePlayerTextDraw(playerid, 279.058746, 234.500015, "Anti +C Bug");
    PlayerTextDrawLetterSize(playerid, AntiCbug[playerid][2], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, AntiCbug[playerid][2], 1);
    PlayerTextDrawColor(playerid, AntiCbug[playerid][2], -5963521);
    PlayerTextDrawSetShadow(playerid, AntiCbug[playerid][2], 0);
    PlayerTextDrawSetOutline(playerid, AntiCbug[playerid][2], 0);
    PlayerTextDrawBackgroundColor(playerid, AntiCbug[playerid][2], 51);
    PlayerTextDrawFont(playerid, AntiCbug[playerid][2], 1);
    PlayerTextDrawSetProportional(playerid, AntiCbug[playerid][2], 1);

    AntiCbug[playerid][3] = CreatePlayerTextDraw(playerid, 254.588333, 224.583389, "LD_CHAT:badchat");
    PlayerTextDrawLetterSize(playerid, AntiCbug[playerid][3], 0.000000, 0.000000);
    PlayerTextDrawTextSize(playerid, AntiCbug[playerid][3], 8.941162, 14.583343);
    PlayerTextDrawAlignment(playerid, AntiCbug[playerid][3], 1);
    PlayerTextDrawColor(playerid, AntiCbug[playerid][3], -1);
    PlayerTextDrawSetShadow(playerid, AntiCbug[playerid][3], 0);
    PlayerTextDrawSetOutline(playerid, AntiCbug[playerid][3], 0);
    PlayerTextDrawFont(playerid, AntiCbug[playerid][3], 4); 

 

В самом OnPlayerKeyStateChange создаем блокировку самого +c с показом TextDraw'а. 

Спойлер

if(PRESSED(KEY_FIRE | KEY_CROUCH))
{
    new weapon = GetPlayerWeapon(playerid);
    if(weapon == 24)
    {
      ArataAnti(playerid);
      SetPVarInt(playerid, "LoadingAnti", 1);
      TogglePlayerControllable(playerid, 0);
      SetTimerEx("SafeLoadAnti", 2000, 0, "d", playerid);
    }
}

 

В конце мода создаем два паблика:

Спойлер

forward SafeLoadAnti(playerid);
public SafeLoadAnti(playerid)
{
    if(GetPVarInt(playerid, "LoadingAnti") == 1)
    {
        SetPVarInt(playerid, "LoadingAnti", 0);
        PlayerTextDrawHide(playerid, AntiCbug[playerid][0]);
        PlayerTextDrawHide(playerid, AntiCbug[playerid][1]);
        PlayerTextDrawHide(playerid, AntiCbug[playerid][2]);
        PlayerTextDrawHide(playerid, AntiCbug[playerid][3]);
        TogglePlayerControllable(playerid, 1);
    }
}
forward ArataAnti(playerid);
public ArataAnti(playerid)
{
    PlayerTextDrawShow(playerid, AntiCbug[playerid][0]);
    PlayerTextDrawShow(playerid, AntiCbug[playerid][1]);
    PlayerTextDrawShow(playerid, AntiCbug[playerid][2]);
    PlayerTextDrawShow(playerid, AntiCbug[playerid][3]);
}

 

 

Спойлер

Screenshot_40.pngScreenshot_41.png

 

Автор: Preskat

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • vexlinee
      By vexlinee
      Всем здравствуйте, сидел я на майнкрафт читиках и поднадоело, теперь хочу сделать студию либо свой крмп проектик
      Так вот вопросы:
      1. Какие программы лучше всего использовать для лаунчеров? В большенстве видел Android studio
      2. Как запустить сам мод, можно ли это сделать локально и быстро, или стоит переносить на хост 
      3. Про какой кеш говорят типы под лаунчерами 
      4. Как сделать установку сборки через лаунчер по кнопке играть 
    • crearot
      By crearot
      Мы ищем талантливого 3D-моделлера в команду.  Гибкий график, опытный коллектив.
      Что мы предлагаем:
      — Конкурентоспособную и стабильную заработную плату;
      — Гибкий график и возможность работать удаленно;
      — Работа в окружении специалистов, готовых способствовать развитию ваших навыков;
      — Перспективы карьерного и профессионального роста.
      От вас требуется:
      — Опыт владением 3ds Max и Blender для моделирования и текстурирования;
      — Работа по референсам;
      — Опыт создания интерьеров и экстерьеров;
      — Наличие портфолио.
      — Работа с текстурами (архивы (сборка, пересборка), добавление текстур, создание архивов под разные видеоускорители(PVR, DXT, ETC))
      — Работа с архивами моделей (.img образы) для добавления моделей и пересборки
      — Моделирование карты, работа по т/з для создания ландшафта на карте и т.д


      Отправьте резюме: → https://forms.gle/Trn4vjMEi58EDybv6