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

    • terro
      By terro
      AddPlayerClass(104,1757.4983,-1898.6315,13.5621,88.2737,0,0,0,0,0,0); //  что из этого нужно прописать чтобы эти корды стали спавном на сервере, дайте конкретные цифры
    • bogdan@gmail
      By bogdan@gmail
      ошибка
      C:\Users\пк\Desktop\pawnoyeudjd\gamemodes\frozen.pwn(45794) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
      Pawn compiler 3.2.3664              Copyright (c) 1997-2017, ITB CompuPhase
       
      текст
      stock GetArendCarID( vehicleid, &arend_id = INVALID_PLAYER_ID ) {     for( new i = 0; i < sizeof(ArendInfo); i ++ )     {         if( vehicleid == ArendInfo[i][aID] )         {             if(IsPlayerConnected(ArendInfo[i][aPlayerID]))             {                 arend_id = ArendInfo[i][aPlayerID];             }             return i;         }     }     return -1; }  

      помогите пж