Advertisement
actuallykane

Untitled

Sep 17th, 2020
1,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1.                         if (GetScriptTaskStatus(ped.Handle, 0x2e85a751) == 7)
  2.                         {
  3.                             SetPedCombatMovement(ped.Handle, 2);
  4.                             SetPedAsEnemy(ped.Handle, true);
  5.                             SetPedShootRate(ped.Handle, 1000);
  6.                             if (ped.State["weaponHash"] != null)
  7.                             {
  8.                                 GiveWeaponToPed(ped.Handle, (uint)ped.State["weaponHash"], 10000, false, true);
  9.                             }
  10.  
  11.                             if (!ped.IsDead && !ped.IsPlayer)
  12.                             {
  13.                                 Ped lowestDistance = Game.PlayerPed;
  14.  
  15.                                 foreach (int playerId in GetActivePlayers())
  16.                                 {
  17.                                     Ped playerPed = (Ped)Ped.FromHandle(GetPlayerPed(playerId));
  18.                                     if (playerPed.IsPlayer && !playerPed.IsDead)
  19.                                     {
  20.                                         lowestDistance = playerPed;
  21.                                         if (Vdist(playerPed.Position.X, playerPed.Position.Y, playerPed.Position.Z, ped.Position.X, ped.Position.Y, ped.Position.Z) < Vdist(lowestDistance.Position.X, lowestDistance.Position.Y, lowestDistance.Position.Z, ped.Position.X, ped.Position.Y, ped.Position.Z))
  22.                                         {
  23.                                             lowestDistance = playerPed;
  24.                                         }
  25.                                     }
  26.                                 }
  27.  
  28.                                 TaskCombatPed(ped.Handle, lowestDistance.Handle, 0, 16);
  29.                             }
  30.                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement