Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////// RECRUIT SQUADS
- void RecruitSquad1()
- {
- float maxDistance = 25f;
- pedsGroup = World.GetNearbyPeds(player.Character, maxDistance);
- Ped Squad1Leader = null;
- float lastDistance = maxDistance;
- foreach (Ped ped in pedsGroup)
- {
- float distance = ped.Position.DistanceTo(player.Character.Position);
- if (distance < lastDistance)
- {
- Squad1Leader = ped;
- lastDistance = distance;
- }
- }
- if (Squad1Leader != null)
- {
- Squad1Group = Function.Call<int>(Hash.CREATE_GROUP);
- 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 (Squad1Followplayer.Checked)
- {
- Squad1Followplayer.Checked = false;
- }
- Squad1.Add(Squad1Leader);
- Squad1GroupFix();
- foreach (Ped recruit in Squad1)
- {
- recruit.RelationshipGroup = Squad1RelationshipGroup;
- Function.Call(Hash.SET_PED_SHOOT_RATE, recruit, 1000);
- Function.Call(Hash.SET_PED_COMBAT_ABILITY, recruit, 100);
- if (recruit.CurrentBlip.Color != BlipColor.Blue)
- {
- recruit.AddBlip();
- recruit.CurrentBlip.Color = BlipColor.Blue;
- recruit.CurrentBlip.Scale = 0.7f;
- SetBlipName(recruit.CurrentBlip, "Squad Member");
- PreparePed(recruit, MainWeaponSquad1, SecondaryWeaponSquad1);
- recruit.Task.ClearAll();
- recruit.Task.StandStill(-1);
- recruit.AlwaysKeepTask = true;
- recruit.IsPersistent = true;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment