private void RequestBackup(GangType type) { var array = type == GangType.Ballas ? _ballasModelArray : _lostModelArray; var sp = World.GetNextPositionOnStreet(SpawnPoint.Around2D(60f, 80f)); var list = new List <Ped>(); for (int i = 0; i < RandomNumber(1, 4); i++) { var ped = new Ped(array[RandomNumber(array.Length)], sp.Around2D(1f), 0f); if (type == GangType.Ballas) { _ballasList.Add(ped); } else { _lostList.Add(ped); } list.Add(ped); } GiveWeapons(list); AddPedListWeapons(list, PedType.Type.Suspect); var model = type == GangType.Ballas ? _ballasVehicles : _lostVehicles; var length = type == GangType.Ballas ? _ballasVehicles.Length : _lostVehicles.Length; _vehList.Add(new Vehicle(model[RandomNumber(length)], sp)); var seat = -1; foreach (var p in list) { p.WarpIntoVehicle(_vehList.Last(), seat); seat++; } var driver = _vehList.Last().Driver; driver.KeepTasks = true; driver.Tasks.DriveToPosition(SpawnPoint, 60f, VehicleDrivingFlags.Emergency, 10f); var relGroup = type == GangType.Ballas ? _ballasList.FirstOrDefault().RelationshipGroup : _lostList.FirstOrDefault().RelationshipGroup; SetRelationshipGroups(list, relGroup.Name); $"Backup requested: {list.Count} peds, vehicle {_vehList.Last().Model.Name}".AddLog(); CallName.DisplayNotification("Backup is arriving for one of the ~r~gangs~w~.\nRemain alert."); }
public Gang this[GangType g] { get { return(Gangs[(int)g]); } set { Gangs[(int)g] = value; OnPropertyChanged(); } }