LucasViniciusLV

[FilterScript]: AG Efficient Anti Glitch

Sep 18th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.81 KB | None | 0 0
  1. /*
  2.  
  3. --------------------------------------------------------------------------------
  4.   • AG - Efficient Anti-Glith •
  5.  
  6.  Autor: Allan Jader
  7.  Date: 18/08/2010
  8.  Function: Proibir o uso de glitch em combate
  9.  
  10. ------------------------------------------------------------------------------*/
  11.  
  12. #include <a_samp>
  13. #pragma tabsize 0
  14. #define Branco 0xFFFFFFAA
  15.  
  16. //------------------------------------------------------------------------------
  17.  
  18. forward Descongelar(playerid);
  19.  
  20. //------------------------------------------------------------------------------
  21.  
  22. new Stock_Keys[MAX_PLAYERS][30];
  23. new temp_Stock_Keys[MAX_PLAYERS][20];
  24. new Glitch_Sequences[8][10]={ "1324020","132020","13220","132128","132420","1361281","1321280","13240"};
  25. new GS;
  26.  
  27. //------------------------------------------------------------------------------
  28.  
  29. public OnFilterScriptInit()
  30. {
  31.     for(new i=0; i<MAX_PLAYERS; i++)
  32.     {
  33.         if(IsPlayerConnected(i))
  34.         {
  35.         SetPVarInt(i,"Avisado",0);//to debug
  36.         }
  37.     }
  38.  
  39.     return 1;
  40. }
  41.  
  42. //------------------------------------------------------------------------------
  43.  
  44. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  45. {
  46.        if(strlen(Stock_Keys[playerid]) >= 20) format(Stock_Keys[playerid],30,"");
  47.  
  48.        format(temp_Stock_Keys[playerid],20,"%d",newkeys);
  49.      
  50.        strcat(Stock_Keys[playerid],temp_Stock_Keys[playerid],30);
  51.  
  52.        for(GS=0; GS<10; GS++)
  53.        {
  54.            if(strfind(Stock_Keys[playerid], Glitch_Sequences[GS], false ) != -1)
  55.            {
  56.                TogglePlayerControllable(playerid,false);
  57.                SetPlayerArmedWeapon(playerid,0);
  58.  
  59.                if(GetPVarInt(playerid,"Avisado") == 0)
  60.                {
  61.                SendClientMessage(playerid,Branco,"[AVISO] Sem glitch, não persista ou será kikado!");
  62.                SetPVarInt(playerid,"Avisado",1);
  63.                SetPVarInt(playerid,"Avisos",GetPVarInt(playerid,"Avisos")+1);
  64.                SetTimerEx("Descongelar",3000,false,"i",playerid);
  65.                format(Stock_Keys[playerid],30,"AG");
  66.                }
  67.  
  68.                if(GetPVarInt(playerid,"Avisos") == 4) //ou outra quantidade a sua preferência
  69.                {
  70.                new Name[MAX_PLAYER_NAME],string[80];
  71.  
  72.                GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
  73.                format(string,80,"%s foi kikado(a) por fazer glitch.",Name);
  74.                SendClientMessageToAll(Branco,string);
  75.                format(Stock_Keys[playerid],30,"AG");
  76.                Kick(playerid);
  77.                }
  78.            }
  79.        }
  80.  
  81.        return 1;
  82. }
  83.  
  84. //------------------------------------------------------------------------------
  85.  
  86. public Descongelar(playerid)
  87. {
  88.       SetPVarInt(playerid,"Avisado",0);
  89.  
  90.       TogglePlayerControllable(playerid,true);
  91.  
  92.       format(Stock_Keys[playerid],30,"AG");
  93.       return 1;
  94. }
  95.  
  96. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment