Advertisement
Guest User

SAMP - Hit-marker / Aimbot detection ( fixed )

a guest
Jun 16th, 2014
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.98 KB | None | 0 0
  1. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  2. {
  3.     new Float:X, Float:Y, Float:Z;
  4.     GetPlayerPos(playerid, X, Y, Z);
  5.     foreach(Player, i)
  6.     {
  7.         if(AdminImmunity{ i } && PLAYER_STATE_SPECTATING && i != playerid) //Replace these with your admin stuff..
  8.         {
  9.             if(IsPlayerInRangeOfPoint(i, 40, X, Y, Z))
  10.             {
  11.                 HitMarker[i] = CreatePlayerObject(i, 18647, fX, fY, fZ, 0, 0, 0); //18724 is a "fire" thing
  12.                 SetTimerEx("RemoveHitMarker", 4500, false, "ii", i, HitMarker);
  13.             }
  14.         }
  15.     }
  16.     /* For tests vvvvvv
  17.     foreach(Player, i)
  18.     {
  19.         if(IsPlayerInRangeOfPoint(i, 40, X, Y, Z))
  20.         {
  21.             HitMarker[i] = CreatePlayerObject(i, 18724, fX, fY, fZ-1.5, 0, 0, 0);
  22.             SetTimerEx("RemoveHitMarker", 4500, false, "ii", i, HitMarker);
  23.         }
  24.     }*/
  25.     return 1;
  26. }
  27.  
  28. forward RemoveHitMarker(playerid, objectid);
  29. public RemoveHitMarker(playerid, objectid)
  30. {
  31.     DestroyPlayerObject(playerid, objectid);
  32.     return 1;
  33. }
  34. //made by kyance ok?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement