Advertisement
Guest User

AntiGod by DraKoN

a guest
Aug 10th, 2010
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.68 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define SLOTS (500)
  4.  
  5. #define MAX_MONEY 99999999
  6. #define MAX_AVISOS_HACK 3
  7.  
  8. new AvisosHack[SLOTS];
  9. new Cash[SLOTS];
  10.  
  11. stock MoneyHack()
  12. {
  13.     print("\n-----------------------------------------------------------------");
  14.     print("*-*-*-**-* Sistema de Anti-MH Criado por DraKoN Iniciado *-*-*-*-*");
  15.     printf("Configurações do [FS] | Max Money %d | Max de Avisos Hacks %d |",MAX_MONEY,MAX_AVISOS_HACK);
  16.     print("--------------------------------------------------------------\n");
  17.     new HackFile[26];
  18.     format(HackFile, sizeof HackFile,"AvisosMoneyHack.log");
  19.     if(!fexist(HackFile)) CriarArquivo(HackFile);
  20.     SetTimer("CheckMoney",1000,true);
  21.     return 1;
  22. }
  23.  
  24. forward CheckMoney();
  25. public CheckMoney()
  26. {
  27.     for(new a = 0 ; a <= SLOTS ; ++ a)
  28.     {
  29.     if(GetPlayerMoney(a) < GetPlayerCash(a))
  30.     {
  31.         ResetPlayerCash(a);
  32.         GivePlayerCash(a,GetPlayerMoney(a));
  33.         return 0;
  34.     }
  35.     if(GetPlayerMoney(a) > GetPlayerCash(a))
  36.     {
  37.         ResetPlayerMoney(a);
  38.         GivePlayerMoney(a,GetPlayerCash(a));
  39.         new name[MAX_PLAYER_NAME];
  40.         new string[100];
  41.         GetPlayerName(a, name, sizeof(name));
  42.         format(string, sizeof(string), "%s Tentiva de Anti Money Hack",name);
  43.         SendMessageToAdmins(0xFFFF00AA,string);
  44.         SalvarAquivo(string);
  45.         AvisosHack[a]++;
  46.         if(AvisosHack[a] > MAX_AVISOS_HACK)
  47.         {
  48.             SendClientMessage(a,0xFFFF00AA,"Banido por Excesso de Tentativas de Money Hack");
  49.             BanEx(a,"Money-Hack by Bot");
  50.             AvisosHack[a]=0;
  51.         }
  52.         return 0;
  53.         }
  54.     }
  55.     return 1;
  56. }
  57.  
  58. stock comandos(const string[], &index)
  59. {
  60.     new length = strlen(string);
  61.     while ((index < length) && (string[index] <= ' '))
  62.     {
  63.         index++;
  64.     }
  65.     new offset = index;
  66.     new result[20];
  67.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  68.     {
  69.         result[index - offset] = string[index];
  70.         index++;
  71.     }
  72.     result[index - offset] = EOS;
  73.     return result;
  74. }
  75. stock SendMessageToAdmins(color,const msg[])
  76. {
  77.     for(new a = 0 ; a <= SLOTS ; ++ a)
  78.     {
  79.     if(IsPlayerConnected(a) && IsPlayerAdmin(a))
  80.     {
  81.     SendClientMessage(a,color,msg);
  82.     }
  83.     }
  84.     return 1;
  85. }
  86. stock GivePlayerCash(playerid,valor)
  87. {
  88.     Cash[playerid]+=valor;
  89.     return 1;
  90. }
  91. stock GetPlayerCash(playerid)
  92. {
  93.     new cashtotal;
  94.     cashtotal = Cash[playerid];
  95.     return cashtotal;
  96. }
  97. stock ResetPlayerCash(playerid)
  98. {
  99.     Cash[playerid] = 0;
  100.     return 1;
  101. }
  102. stock SalvarAquivo(const ahahah[])
  103. {
  104.     new string[128];
  105.     new File:HF = fopen("AvisosMoneyHack.log",io_append);
  106.     format(string, sizeof (string), "%s \r\n", ahahah);
  107.     fwrite(HF, string);
  108.     fclose(HF);
  109. }
  110. stock CriarArquivo(filename[])
  111. {
  112.     new File:files;
  113.     if (fexist(filename)) return false;
  114.     files=fopen(filename,io_write);
  115.     fclose(files);
  116.     return true;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement