toribio

toribio

Dec 11th, 2008
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.44 KB | None | 0 0
  1. #include a_samp
  2.  
  3. #define ANTICHEATER 0xFF912296
  4.  
  5. forward AntiCheater();
  6.  
  7. new
  8.     ginvalidw[9] = {35, 36, 37, 38, 39, 40, 43, 44, 45},
  9.     ginvalidv[3] = {520, 432, 425},
  10.     ginvalidvn[3][0xF] = {"Hydra", "Rhino", "Hunter"},
  11.     gspeedhw[MAX_PLAYERS][2],
  12.     Float:gsppedhlc[MAX_PLAYERS][2],
  13.     Float:gspeed[MAX_PLAYERS];
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     SetTimer("AntiCheater", 1000, 1);
  18.     return 1;
  19. }
  20.  
  21. public AntiCheater()
  22. {
  23.     for(new i; i < MAX_PLAYERS; i++)
  24.     {
  25.         if(!IsPlayerConnected(i))continue;
  26.  
  27.         new
  28.             pname[0x18],
  29.             string[0x80],
  30.             Float:phealth;
  31.  
  32.         GetPlayerName(i, pname, sizeof pname);
  33.         for(new j; j < sizeof ginvalidw; j++)
  34.         {
  35.             if(GetPlayerWeapon(i) == ginvalidw[j])
  36.             {
  37.                 new
  38.                     wname[0x40];
  39.  
  40.                 GetWeaponName(ginvalidw[j], wname, sizeof wname);
  41.                 format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de %s!", pname, wname);
  42.                 SendClientMessageToAll(ANTICHEATER, string);
  43.                 kick:
  44.                 Kick(i);
  45.                 return;
  46.             }
  47.         }
  48.         if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  49.         {
  50.             new
  51.                 Float:vhealth,
  52.                 Float:x,
  53.                 Float:y,
  54.                 Float:z;
  55.  
  56.             for(new j; j < sizeof ginvalidv; j++)
  57.             {
  58.                 if(GetVehicleModel(GetPlayerVehicleID(i)) == ginvalidv[j])
  59.                 {
  60.                     if(!i)SendClientMessageToAll(ANTICHEATER, "carro invοΏ½lido");
  61.                     format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de %s!", pname, ginvalidvn[j]);
  62.                     SendClientMessageToAll(ANTICHEATER, string);
  63.                     goto kick;
  64.                 }
  65.             }
  66.             GetVehicleHealth(i, vhealth);
  67.             if(vhealth > 1000.0)
  68.             {
  69.                 format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de GodCar!", pname);
  70.                 SendClientMessageToAll(ANTICHEATER, string);
  71.                 goto kick;
  72.             }
  73.             GetPlayerPos(i, x, y, z);
  74.             gspeedhw[i][1]++;
  75.             gspeed[i] = floatround(floatsqroot(
  76.                 floatpower(floatabs(floatsub(gsppedhlc[i][0], x)), 2) +
  77.                 floatpower(floatabs(floatsub(gsppedhlc[i][1], y)), 2)));
  78.             gsppedhlc[i][0] = x;
  79.             gsppedhlc[i][1] = y;
  80.  
  81.             new
  82.                 isaero, isnaval,
  83.                 aero[0x16] = {0x1A1, 0x1A9, 0x1BF, 0x1D1, 0x1D5, 0x1E7, 0x1E8, 0x1F1, 0x224, 0x223,
  84.                     0x1CC, 0x1D0, 0x1DC, 0x1FF, 0x200, 0x201, 0x207, 0x208, 0x229, 0x241, 0x250, 0x251},
  85.                 naval[0x1A] = {0x1AE, 0x1BE, 0x1C4, 0x1C5, 0x1C6, 0x1D8, 0x1D9, 0x1E4, 0x1ED, 0x253,
  86.                     0x192, 0x199, 0x19B, 0x19F, 0x1A8, 0x1AD, 0x1B2, 0x1C3, 0x1E0, 0x1FA, 0x215, 0x216,
  87.                     0x218, 0x21D, 0x22B, 0x25A};
  88.  
  89.             for(new j; j < sizeof aero; j++)
  90.                 if(GetVehicleModel(GetPlayerVehicleID(i)) == aero[j])
  91.                     isaero = true;
  92.             for(new j; j < sizeof naval; j++)
  93.                 if(GetVehicleModel(GetPlayerVehicleID(i)) == naval[j])
  94.                     isnaval = true;
  95.  
  96.             if((gspeed[i] > 0xA0 && !isaero) || (!isnaval && gspeed[i] > 0xB4) || (gspeed[i] > 0xD0))
  97.                 gspeedhw[i][0]++;
  98.  
  99.             if(gspeedhw[i][1] > 0x03)
  100.             {
  101.                 if(gspeedhw[i][0] > 0x03)
  102.                 {
  103.                     format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de SpeedHack!", pname);
  104.                     SendClientMessageToAll(ANTICHEATER, string);
  105.                     for(new j; j < 2; j++)
  106.                         gspeedhw[i][j] = 0;
  107.                     goto kick;
  108.                 }
  109.                 for(new j; j < 2; j++)
  110.                     gspeedhw[i][j] = 0;
  111.             }
  112.         }
  113.         GetPlayerHealth(i, phealth);
  114.         if(phealth > 100.0)
  115.         {
  116.             format(string, sizeof string, "[Kill-Kill ANTI CHEATER]: %s foi kickado por usar cheat de GodMode!", pname);
  117.             SendClientMessageToAll(ANTICHEATER, string);
  118.             goto kick;
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment