Guest User

ANT HACK

a guest
Jan 19th, 2011
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.13 KB | None | 0 0
  1. /*
  2.        .:: Hack Fighter AntiCheat ::.
  3.           .:: Coded by Homer ::.
  4.      .:: Traduzido Por [BC]Scooby ::.
  5.               .:: 2008 ::.
  6.        .:: All Rights Reserved ::.
  7. */
  8.  
  9. #include <a_samp>
  10. #include <HFunc>
  11.  
  12. #define FILTERSCRIPT
  13.  
  14. #define ORANGE          0xFF8C00AA
  15. #define GREEN           0x33AA33AA
  16. #define YELLOW          0xFFFF00AA
  17. #define HOMER           0xFF0000AA
  18. #define BLUE            0x33CCFFAA
  19. #define ABLUE           0x2641FEAA
  20.  
  21. new MaxPing;
  22. new IsPlayerSpawned[MAX_PLAYERS];
  23.  
  24. forward CheckPing();
  25. forward CheckHacks();
  26.  
  27. public OnFilterScriptInit()
  28. {
  29.     print("\n-------------LOADING------------------");
  30.     print(" ANT HACK MATA MATA 2012");
  31.     print("--------------------------------------\n");
  32.     SetTimer("CheckHacks",2000,1);
  33.     SetTimer("CheckPing",5000,1);
  34.     MaxPing = 99999999;
  35.     if(!fexist("hf.txt"))
  36.     {
  37.        print("AVISO! Arquivo hf.txt Foi Passado Para A Pasta Scriptfiles!");
  38.     }
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     print("\n-------------UNLOADING----------------");
  45.     print(" Mata-Mata 2012! Ant Hack!");
  46.     print("--------------------------------------\n");
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52.    if(IsPlayerConnected(playerid))
  53.    {
  54.    IsPlayerSpawned[playerid] = 0;
  55.    }
  56.    return 1;
  57. }
  58.  
  59. public OnPlayerSpawn(playerid)
  60. {
  61.    if(IsPlayerConnected(playerid))
  62.    {
  63.    IsPlayerSpawned[playerid] = 1;
  64.    }
  65.    return 1;
  66. }
  67.  
  68. public OnPlayerDeath(playerid, killerid, reason)
  69. {
  70.    new pName[MAX_PLAYER_NAME];
  71.    new kName[MAX_PLAYER_NAME];
  72.    new string[256];
  73.  
  74.    GetPlayerName(killerid, kName, sizeof(kName));
  75.    GetPlayerName(playerid, pName, sizeof(pName));
  76.  
  77.    if(GetPlayerState(killerid) == PLAYER_STATE_DRIVER)
  78.    {
  79.    format(string,256,"[Ant-Hack] %s[ID:%d] Matou %s[ID:%d] Com Drive-By!",kName,killerid,pName,playerid);
  80.    KickMessage(string);
  81.    }
  82.    return 1;
  83. }
  84.  
  85. public OnPlayerCommandText(playerid, cmdtext[])
  86. {
  87.     new string[256];
  88.     new tmp[256], cmd[256], idx;
  89.     cmd = strtok(cmdtext, idx);
  90.     new pName[MAX_PLAYER_NAME];
  91.  
  92.     if(strcmp(cmd, "/setarping",true ) == 0)
  93.     {
  94.        if(IsPlayerAdmin(playerid))
  95.        {
  96.           if(IsPlayerConnected(playerid))
  97.           {
  98.              tmp = strtok(cmdtext, idx);
  99.              if(!strlen(tmp))
  100.              {
  101.                  SendClientMessage(playerid,ORANGE,"[Ant-Hack] USAGE: /setarping [MaxPing]");
  102.                  return 1;
  103.              }
  104.              if(strval(tmp) < 30 || strval(tmp) > 2000)
  105.              {
  106.                  SendClientMessage(playerid,ORANGE,"[Ant-Hack] ERRO! Minimo é 30 e o Maximo é 2000!");
  107.                  return 1;
  108.              }
  109.              MaxPing = strval(tmp);
  110.              GetPlayerName(playerid, pName, sizeof(pName));
  111.              format(string,256,"[Ant-Hack] %d[ID:%d] Setou o Ping Maximo Para %d!",pName,playerid,MaxPing);
  112.              SendClientMessageToAll(HOMER,string);
  113.           }
  114.        }else{
  115.        SendClientMessage(playerid,ORANGE,"[Ant-Hack] Você não é admin!");
  116.        return 1;
  117.        }
  118.        return 1;
  119.     }
  120.     return 0;
  121. }
  122.  
  123. public CheckPing()
  124. {
  125.    for(new i; i < MAX_PLAYERS; i++)
  126.    {
  127.       if(IsPlayerConnected(i))
  128.       {
  129.          if(GetPlayerPing(i) >= MaxPing && IsPlayerSpawned[i] == 1)
  130.          {
  131.          new Year,Month,Day;
  132.          new Hour,Min,Sec;
  133.          new pName[MAX_PLAYER_NAME];
  134.          new string[256];
  135.  
  136.          getdate(Year,Month,Day);
  137.          gettime(Hour,Min,Sec);
  138.  
  139.          GetPlayerName(i, pName, sizeof(pName));
  140.          format(string,256,"[Ant-Hack] %s[ID:%d] foi kickado. Motivo: Ping Alto (Maximo: %d)",pName,i,MaxPing);
  141.          SendClientMessageToAll(HOMER,string);
  142.          format(string,256,"%s[ID:%d] foi kickado - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  143.          KickMessage(string);
  144.          Kick(i);
  145.          }
  146.       }
  147.    }
  148. }
  149.  
  150. public CheckHacks()
  151. {
  152.    new pName[MAX_PLAYER_NAME];
  153.    new string[256];
  154.    new Float:HP,Float:ARM,Float:VehHP;
  155.    new Ammo,VID,Money;
  156.    new Year,Month,Day;
  157.    new Hour,Min,Sec;
  158.  
  159.    for(new i; i < MAX_PLAYERS; i++)
  160.    {
  161.       GetPlayerHealth(i,HP);
  162.       GetPlayerArmour(i,ARM);
  163.       GetVehicleHealth(VID,VehHP);
  164.       Ammo = GetPlayerAmmo(i);
  165.       VID = GetPlayerVehicleID(i);
  166.       Money = GetPlayerMoney(i);
  167.       getdate(Year,Month,Day);
  168.       gettime(Hour,Min,Sec);
  169.  
  170.       if(IsPlayerConnected(i))
  171.       {
  172.          if(GetPlayerWeapon(i) == 38) //Minigun
  173.          {
  174.          GetPlayerName(i, pName, sizeof(pName));
  175.          format(string,256,"[Ant-Hack] %s[ID:%d] Foi Banido. Motivo: Arma Proibida (Minigun - %d Ammo)",pName,i,Ammo);
  176.          SendClientMessageToAll(HOMER,string);
  177.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  178.          KickMessage(string);
  179.          if(i == i) return 0;
  180.          Ban(i);
  181.          }
  182.          if(GetPlayerWeapon(i) == 40) //Detonator
  183.          {
  184.          GetPlayerName(i, pName, sizeof(pName));
  185.          format(string,256,"[Ant-Hack] %s[ID:%d] Foi Banido. Motivo: Arma Proibida (Detonador - %d Ammo)",pName,i,Ammo);
  186.          SendClientMessageToAll(HOMER,string);
  187.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  188.          KickMessage(string);
  189.          Ban(i);
  190.          }
  191.          if(GetPlayerWeapon(i) == 36) //RPG
  192.          {
  193.          GetPlayerName(i, pName, sizeof(pName));
  194.          format(string,256,"[Ant-Hack] %s[ID:%d] Foi Banido. Motivo: Arma Proibida (Bazooka Teleguiada - %d Ammo)",pName,i,Ammo);
  195.          SendClientMessageToAll(HOMER,string);
  196.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  197.          KickMessage(string);
  198.          Ban(i);
  199.          }
  200.          if(GetPlayerWeapon(i) == 35) //Rocket Launcher
  201.          {
  202.          GetPlayerName(i, pName, sizeof(pName));
  203.          format(string,256,"[Ant-Hack] %s[ID:%d] Foi Banido. Motivo: Arma Proibida (Bazooka - %d Ammo)",pName,i,Ammo);
  204.          SendClientMessageToAll(HOMER,string);
  205.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  206.          KickMessage(string);
  207.          Ban(i);
  208.          }
  209.          if(GetPlayerWeapon(i) == 37) //Flame-Tower
  210.          {
  211.          GetPlayerName(i, pName, sizeof(pName));
  212.          format(string,256,"[Ant-Hack] %s[ID:%d] Foi Banido. Motivo: Arma Proibida (Lança-Chamas - %d Ammo)",pName,i,Ammo);
  213.          SendClientMessageToAll(HOMER,string);
  214.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  215.          KickMessage(string);
  216.          Ban(i);
  217.          }
  218.          if(GetPlayerSpecialAction(i) == 2) //JetPack
  219.          {
  220.          GetPlayerName(i, pName, sizeof(pName));
  221.          format(string,256,"[HackFighter] %s[ID:%d] Foi Banido. Motivo: Jet Pack",pName,i);
  222.          SendClientMessageToAll(HOMER,string);
  223.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d Há %d:%d e %d Segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  224.          KickMessage(string);
  225.          Ban(i);
  226.          }
  227.          if(HP > 101) //GodMode - Len ak má health nad 100 - Nepoužíva /god
  228.          {
  229.          GetPlayerName(i, pName, sizeof(pName));
  230.          format(string,256,"[HackFighter] %s[ID:%d] Foi Banido. Motivo: GOD (%d HP)",pName,i,HP);
  231.          SendClientMessageToAll(HOMER,string);
  232.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d Há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  233.          KickMessage(string);
  234.          Ban(i);
  235.          }
  236.          if(Ammo > 100001) //Viac ako 100000 Ammo - Prenastavte si ako potrebujete
  237.          {
  238.          GetPlayerName(i, pName, sizeof(pName));
  239.          format(string,256,"[HackFighter] %s[ID:%d] Foi Banido. Motivo: Munição Hack (%d Ammo)",pName,i,Ammo);
  240.          SendClientMessageToAll(HOMER,string);
  241.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d Há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  242.          KickMessage(string);
  243.          Ban(i);
  244.          }
  245.          if(GetPlayerMoney(i) == 99999999) //Money Cheat - Taký pokus xD
  246.          {
  247.          format(string,256,"[HackFighter] %s[ID:%d] Foi Banido. Motivo: Dinheiro Hack ($%d)",pName,i,Money);
  248.          SendClientMessageToAll(HOMER,string);
  249.          format(string,256,"%s[ID:%d] Foi Banido - %d/%d/%d Há %d:%d e %d segundos",pName,i,Day,Month,Year,Hour,Min,Sec);
  250.          KickMessage(string);
  251.          Ban(i);
  252.          }
  253.          if(VehHP > 1000) //Auto má viac healthu ako 1000 - Maximum
  254.          {
  255.          RemovePlayerFromVehicle(i);
  256.          DestroyVehicle(VID); //Auto sa proste znièí, pretože sa nevie ktorý cheater to auto urobil
  257.          }
  258.       }
  259.    }
  260.    return 1;
  261. }
  262.  
  263. stock KickMessage(const string[])
  264. {
  265.     new File:HF = fopen("hf.txt",io_append);
  266.     fwrite(HF, string);
  267.     fclose(HF);
  268. }
Add Comment
Please, Sign In to add comment