Advertisement
Guest User

createsquad

a guest
Nov 22nd, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.72 KB | None | 0 0
  1. void CreateSquad1()
  2.         {
  3.             Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION, Squad1Group, 1);
  4.             Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION_SPACING, Squad1Group, 1.0f, 1.0f, 1.0f);
  5.  
  6.             if (Squad1Vehicle != "OnFoot")
  7.             {
  8.                 var pasengerz = Function.Call<int>(GTA.Native.Hash._GET_VEHICLE_MODEL_MAX_NUMBER_OF_PASSENGERS, (Model)Squad1Vehicle);
  9.                 if (pasengerz < Squad1Number) { Squad1Number = pasengerz; }
  10.             }
  11.  
  12.             if (Squad1Followplayer.Checked) { Squad1Followplayer.Checked = false; }
  13.             Squad1.Clear();
  14.             Vector3 pos = Game.Player.Character.Position;
  15.             if (Squad1DispatchToWaypoint.Checked && GetWaypointVector() != Vector3.Zero) { pos = GetWaypointVector(); }
  16.  
  17.             if (Squad1Vehicle != "OnFoot")
  18.             {
  19.                 Squad1Car = World.CreateVehicle(Squad1Vehicle, World.GetNextPositionOnStreet(pos.Around(SquadSpawnDistance)), 0);
  20.                 Squad1Leader = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], Squad1Car.Position.Around(5));
  21.             }
  22.             else
  23.             {
  24.                 Squad1Leader = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], pos.Around(SquadSpawnDistance));
  25.             }
  26.  
  27.             PreparePed(Squad1Leader, MainWeaponSquad1, SecondaryWeaponSquad1);
  28.             PrepareSquadLeader(Squad1Leader, Squad1);
  29.  
  30.             Squad1.Add(Squad1Leader);
  31.             Squad1Leader.BlockPermanentEvents = !Squad1ReactToEvents.Checked;
  32.  
  33.             if (Squad1Vehicle != "OnFoot")
  34.             {
  35.                 Squad1Leader.SetIntoVehicle(Squad1Car, VehicleSeat.Driver);
  36.             }
  37.  
  38.             for (int i = 1; i < Squad1Number; i++)
  39.             {
  40.                 Squad1Member = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], Squad1Leader.Position.Around(4));
  41.                 PreparePed(Squad1Member, MainWeaponSquad1, SecondaryWeaponSquad1);
  42.                 Squad1.Add(Squad1Member);
  43.             }
  44.  
  45.             foreach (Ped ped in Squad1)
  46.             {
  47.                 if (ShowBlips.Checked)
  48.                 {
  49.                     ped.AddBlip();
  50.                     ped.CurrentBlip.Color = BlipColor.Blue;
  51.                     ped.CurrentBlip.Scale = 0.7f;
  52.                 }
  53.  
  54.                 ped.AlwaysKeepTask = true;
  55.                 ped.RelationshipGroup = Squad1RelationshipGroup;
  56.                 Function.Call(Hash.SET_PED_SHOOT_RATE, ped, 1000);
  57.                 Function.Call(Hash.REMOVE_PED_FROM_GROUP, ped.Handle);
  58.                 ped.IsInvincible = Squad1GodMode.Checked;
  59.                 SetBlipName(ped.CurrentBlip, "Squad Member");
  60.  
  61.                 if (Squad1Vehicle != "OnFoot")
  62.                 {
  63.                     if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_THIS_MODEL_A_HELI, Squad1Car.Model))
  64.                     {
  65.                         GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_SEEING_RANGE, ped, 150f);
  66.                         GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_VISUAL_FIELD_MIN_ELEVATION_ANGLE, ped, -90f);
  67.                         GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_VISUAL_FIELD_MAX_ELEVATION_ANGLE, ped, 180f);
  68.                     }
  69.                     Squad1Car.IsInvincible = Squad1GodMode.Checked;
  70.                 }
  71.  
  72.             }
  73.  
  74.  
  75.             if (Squad1Vehicle != "OnFoot")
  76.             {
  77.                 int max_seats = GTA.Native.Function.Call<int>(GTA.Native.Hash.GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS, Squad1Car);
  78.                 for (int i = -1; i < max_seats; i++)
  79.                 {
  80.                     if (i == Squad1.Count - 1)
  81.                     {
  82.                         break;
  83.                     }
  84.                     if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_VEHICLE_SEAT_FREE, Squad1Car, i) && (CanWeUse(Squad1[i + 1])))
  85.                     {
  86.                         GTA.Native.Function.Call<bool>(GTA.Native.Hash.TASK_ENTER_VEHICLE, Squad1[i + 1], Squad1Car, 10000, i, 2.0, 16, 0);
  87.                     }
  88.                 }
  89.  
  90.                 if (Squad1DispatchToWaypoint.Checked)
  91.                 {
  92.                     DriveTo(Squad1Leader, pos, 30);
  93.                 }
  94.                 else
  95.                 {
  96.                     DriveTo(Squad1Leader, Game.Player.Character.Position, 30);
  97.                 }
  98.                 if (Squad1Car.Model == (Model)VehicleHash.Polmav)
  99.                 {
  100.                     Squad1Car.Livery = 0;
  101.                 }
  102.                 if (Squad1Car.Model == (Model)VehicleHash.Swift)
  103.                 {
  104.                     Squad1Car.Livery = 0;
  105.                 }
  106.                 GetSquadIntoVehicle(Squad1, Squad1Car);
  107.  
  108.                 if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_THIS_MODEL_A_HELI, Squad1Car.Model))
  109.                 {
  110.                     Squad1Car.Position = Squad1Car.Position + new Vector3(0, 0, 50f);
  111.                     GTA.Native.Function.Call(GTA.Native.Hash.SET_HELI_BLADES_FULL_SPEED, Squad1Car);
  112.                 }
  113.             }
  114.             else
  115.             {
  116.                 Squad1Leader.Task.RunTo(pos);
  117.             }
  118.             Squad1GroupFix();
  119.  
  120.             if (Squad1Vehicle != "OnFoot")
  121.             {
  122.                 GTA.Native.Function.Call(GTA.Native.Hash._SET_NOTIFICATION_TEXT_ENTRY, "STRING");
  123.                 GTA.Native.Function.Call(GTA.Native.Hash._ADD_TEXT_COMPONENT_STRING, "Boutta pull up on " + World.GetStreetName(pos) + ". Look for a " + Squad1Car.FriendlyName + ".");
  124.                 GTA.Native.Function.Call(GTA.Native.Hash._SET_NOTIFICATION_MESSAGE, "CHAR_MP_FAM_BOSS", "CHAR_MP_FAM_BOSS", true, 2, "~b~Shotta", "~c~" + Squad1StyleItem.IndexToItem(Squad1StyleItem.Index).ToString());
  125.             }
  126.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement