Advertisement
Guest User

[Delay Kick] for Anti auto-aim by ipsLeon

a guest
Apr 24th, 2015
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.95 KB | None | 0 0
  1. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  2. {
  3.         switch(weaponid){ case 0..18, 39..54: return 1;}//invalid weapons
  4.  
  5.         if(hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerConnected(hitid) && !IsPlayerNPC(hitid))
  6.         {
  7.                 new Float:Shot[3], Float:Hit[3];
  8.                 GetPlayerLastShotVectors(playerid, Shot[0], Shot[1], Shot[2], Hit[0], Hit[1], Hit[2]);
  9.  
  10.                 new playersurf = GetPlayerSurfingVehicleID(playerid);
  11.                 new hitsurf = GetPlayerSurfingVehicleID(hitid);
  12.                 new Float:targetpackets = NetStats_PacketLossPercent(hitid);
  13.                 new Float:playerpackets = NetStats_PacketLossPercent(playerid);
  14.  
  15.                 if(~(playersurf) && ~(hitsurf) && !IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(hitid))
  16.                 {                        
  17.                         if(!IsPlayerAimingAtPlayer(playerid, hitid) && !IsPlayerInRangeOfPoint(hitid, 5.0, Hit[0], Hit[1], Hit[2]))
  18.                         {
  19.                                 new string[128], issuer[24];
  20.                                 GetPlayerName(playerid, issuer, 24);
  21.                                 AimbotWarnings[playerid] ++;
  22.                                
  23.                                 format(string, sizeof(string), "{FFFFFF}Player %s warning of aimbot or lag [Target PL: %f | Shooter PL:%f]!", issuer, targetpackets, playerpackets);
  24.                                
  25.                                 for(new p; p < MAX_PLAYERS;p++)
  26.                                     if(IsPlayerConnected(p) && IsPlayerAdmin(p))
  27.                                          SendClientMessage(p, -1, string);
  28.                                                
  29.                                 if(AimbotWarnings[playerid] > 10)
  30.                                 {
  31.                                         if(targetpackets < 1.2 && playerpackets < 1.2)
  32.                                         {
  33.                                             format(string, 128, "Player %s has been kicked for aimbot!", issuer);
  34.                                             SendClientMessageToAll(0xFF0000, string);
  35.                                             SetTimerEx("DelayKick", 1500, false, "i", playerid);
  36.                                         }
  37.                                         else
  38.                                         {              
  39.                                                 format(string, sizeof(string), "{FFFFFF}Player %s is probably using aimbot [Target PL: %f | Shooter PL:%f]!", issuer, targetpackets, playerpackets);
  40.                                                 for(new p; p < MAX_PLAYERS;p++) if(IsPlayerConnected(p) && IsPlayerAdmin(p)) SendClientMessage(p, -1, string);
  41.                                         }
  42.                                 }
  43.                                 return 0;
  44.                         }
  45.                         else return 1;                    
  46.                 }
  47.                 else return 1;
  48.         }
  49.         return 1;
  50. }
  51.  
  52. forward DelayKick(playerid);
  53. public DelayKick(playerid) return Kick(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement