Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CreateSquad1()
- {
- Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION, Squad1Group, 1);
- Function.Call(GTA.Native.Hash.SET_GROUP_FORMATION_SPACING, Squad1Group, 1.0f, 1.0f, 1.0f);
- if (Squad1Vehicle != "OnFoot")
- {
- var pasengerz = Function.Call<int>(GTA.Native.Hash._GET_VEHICLE_MODEL_MAX_NUMBER_OF_PASSENGERS, (Model)Squad1Vehicle);
- if (pasengerz < Squad1Number) { Squad1Number = pasengerz; }
- }
- if (Squad1Followplayer.Checked) { Squad1Followplayer.Checked = false; }
- Squad1.Clear();
- Vector3 pos = Game.Player.Character.Position;
- if (Squad1DispatchToWaypoint.Checked && GetWaypointVector() != Vector3.Zero) { pos = GetWaypointVector(); }
- if (Squad1Vehicle != "OnFoot")
- {
- Squad1Car = World.CreateVehicle(Squad1Vehicle, World.GetNextPositionOnStreet(pos.Around(SquadSpawnDistance)), 0);
- Squad1Leader = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], Squad1Car.Position.Around(5));
- }
- else
- {
- Squad1Leader = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], pos.Around(SquadSpawnDistance));
- }
- PreparePed(Squad1Leader, MainWeaponSquad1, SecondaryWeaponSquad1);
- PrepareSquadLeader(Squad1Leader, Squad1);
- Squad1.Add(Squad1Leader);
- Squad1Leader.BlockPermanentEvents = !Squad1ReactToEvents.Checked;
- if (Squad1Vehicle != "OnFoot")
- {
- Squad1Leader.SetIntoVehicle(Squad1Car, VehicleSeat.Driver);
- }
- for (int i = 1; i < Squad1Number; i++)
- {
- Squad1Member = GTA.World.CreatePed(Squad1Models[GetRandomInt(0, Squad1Models.Count)], Squad1Leader.Position.Around(4));
- PreparePed(Squad1Member, MainWeaponSquad1, SecondaryWeaponSquad1);
- Squad1.Add(Squad1Member);
- }
- foreach (Ped ped in Squad1)
- {
- if (ShowBlips.Checked)
- {
- ped.AddBlip();
- ped.CurrentBlip.Color = BlipColor.Blue;
- ped.CurrentBlip.Scale = 0.7f;
- }
- ped.AlwaysKeepTask = true;
- ped.RelationshipGroup = Squad1RelationshipGroup;
- Function.Call(Hash.SET_PED_SHOOT_RATE, ped, 1000);
- Function.Call(Hash.REMOVE_PED_FROM_GROUP, ped.Handle);
- ped.IsInvincible = Squad1GodMode.Checked;
- SetBlipName(ped.CurrentBlip, "Squad Member");
- if (Squad1Vehicle != "OnFoot")
- {
- if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_THIS_MODEL_A_HELI, Squad1Car.Model))
- {
- GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_SEEING_RANGE, ped, 150f);
- GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_VISUAL_FIELD_MIN_ELEVATION_ANGLE, ped, -90f);
- GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_VISUAL_FIELD_MAX_ELEVATION_ANGLE, ped, 180f);
- }
- Squad1Car.IsInvincible = Squad1GodMode.Checked;
- }
- }
- if (Squad1Vehicle != "OnFoot")
- {
- int max_seats = GTA.Native.Function.Call<int>(GTA.Native.Hash.GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS, Squad1Car);
- for (int i = -1; i < max_seats; i++)
- {
- if (i == Squad1.Count - 1)
- {
- break;
- }
- if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_VEHICLE_SEAT_FREE, Squad1Car, i) && (CanWeUse(Squad1[i + 1])))
- {
- GTA.Native.Function.Call<bool>(GTA.Native.Hash.TASK_ENTER_VEHICLE, Squad1[i + 1], Squad1Car, 10000, i, 2.0, 16, 0);
- }
- }
- if (Squad1DispatchToWaypoint.Checked)
- {
- DriveTo(Squad1Leader, pos, 30);
- }
- else
- {
- DriveTo(Squad1Leader, Game.Player.Character.Position, 30);
- }
- if (Squad1Car.Model == (Model)VehicleHash.Polmav)
- {
- Squad1Car.Livery = 0;
- }
- if (Squad1Car.Model == (Model)VehicleHash.Swift)
- {
- Squad1Car.Livery = 0;
- }
- GetSquadIntoVehicle(Squad1, Squad1Car);
- if (GTA.Native.Function.Call<bool>(GTA.Native.Hash.IS_THIS_MODEL_A_HELI, Squad1Car.Model))
- {
- Squad1Car.Position = Squad1Car.Position + new Vector3(0, 0, 50f);
- GTA.Native.Function.Call(GTA.Native.Hash.SET_HELI_BLADES_FULL_SPEED, Squad1Car);
- }
- }
- else
- {
- Squad1Leader.Task.RunTo(pos);
- }
- Squad1GroupFix();
- if (Squad1Vehicle != "OnFoot")
- {
- GTA.Native.Function.Call(GTA.Native.Hash._SET_NOTIFICATION_TEXT_ENTRY, "STRING");
- GTA.Native.Function.Call(GTA.Native.Hash._ADD_TEXT_COMPONENT_STRING, "Boutta pull up on " + World.GetStreetName(pos) + ". Look for a " + Squad1Car.FriendlyName + ".");
- 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());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement