Guest User

nonworkingrecruit

a guest
Nov 23rd, 2017
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     //////////////////// RECRUIT SQUADS
  2.  
  3.     void RecruitSquad1()
  4.     {
  5.         float maxDistance = 25f;
  6.         pedsGroup = World.GetNearbyPeds(player.Character, maxDistance);
  7.         Ped Squad1Leader = null;
  8.         float lastDistance = maxDistance;
  9.         foreach (Ped ped in pedsGroup)
  10.         {
  11.             float distance = ped.Position.DistanceTo(player.Character.Position);
  12.             if (distance < lastDistance)
  13.             {
  14.                 Squad1Leader = ped;
  15.                 lastDistance = distance;
  16.             }
  17.         }
  18.         if (Squad1Leader != null)
  19.         {
  20.             Squad1Group = Function.Call<int>(Hash.CREATE_GROUP);
  21.  
  22.             Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION, Squad1Group, 1);
  23.             Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION_SPACING, Squad1Group, 1.0f, 1.0f, 1.0f);
  24.             if (Squad1Followplayer.Checked)
  25.             {
  26.                 Squad1Followplayer.Checked = false;
  27.             }
  28.             Squad1.Add(Squad1Leader);
  29.             Squad1GroupFix();
  30.  
  31.             foreach (Ped recruit in Squad1)
  32.             {
  33.                 recruit.RelationshipGroup = Squad1RelationshipGroup;
  34.                 Function.Call(Hash.SET_PED_SHOOT_RATE, recruit, 1000);
  35.                 Function.Call(Hash.SET_PED_COMBAT_ABILITY, recruit, 100);
  36.  
  37.                 if (recruit.CurrentBlip.Color != BlipColor.Blue)
  38.                 {
  39.                     recruit.AddBlip();
  40.                     recruit.CurrentBlip.Color = BlipColor.Blue;
  41.                     recruit.CurrentBlip.Scale = 0.7f;
  42.                     SetBlipName(recruit.CurrentBlip, "Squad Member");
  43.                     PreparePed(recruit, MainWeaponSquad1, SecondaryWeaponSquad1);
  44.                     recruit.Task.ClearAll();
  45.                     recruit.Task.StandStill(-1);
  46.                     recruit.AlwaysKeepTask = true;
  47.                     recruit.IsPersistent = true;
  48.                 }
  49.             }
  50.         }
  51.     }
RAW Paste Data