Sign in to follow this  
Followers 0
Guest stibs

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

2 posts in this topic

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

В начало мода, ко всем #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

+сик заслужил

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

    • August_Rothschild
      By August_Rothschild
      Всем привет , как заменять анимации в игре ? Имеется ввиду анимации танцев , как прочесть файлы с анимациями или как заменять определенную анимацию 
    • hotlive
      By hotlive
      я создал свою копию радмира и хочу дать доступ игрокам  к команде /getv, так как она доступна только админам, помогите сделать