//Primary public Cop(string vehmodel, SpawnPt pos, SpawnPt targetPos, bool isSwat = false, ICollection <Cop> copList = null) { string copModel = isSwat ? "s_m_y_swat_01" : "s_m_y_cop_01"; Veh = new Vehicle(vehmodel, pos.Spawn, pos.Heading); Ped = new Ped(copModel, Veh.LeftPosition, Veh.Heading); Ped.RelationshipGroup = RelationshipGroup.Cop; if (isSwat) { var w = new Weapon(new WeaponAsset("WEAPON_CARBINERIFLE"), Ped.Position, 120); if (w.Exists()) { w.GiveTo(Ped); } NativeFunction.Natives.SetPedPropIndex(Ped, 0, 0, 0, true); } Functions.SetPedAsCop(Ped); Functions.SetCopAsBusy(Ped, true); TargetPosition = targetPos; Ped.MakeMissionPed(); Veh.MakeMissionVehicle(); Ped.BlockPermanentEvents = true; Ped.Tasks.StandStill(-1); copList?.Add(this); }
protected override bool Initialize() { "Initializing L.S. Noir Callout: Sexual Assault -- Stage 4a [Suspect Home]".AddLog(); var spawn_scene = LoadDict(); var random = Rand.RandomNumber(spawn_scene.Count); _scenario = spawn_scene.Values.ToArray()[random]; _oneSpawn = spawn_scene.Keys.ToArray()[random]; _areaBlip = new Blip(_oneSpawn.Spawn) { Sprite = BlipSprite.GangAttackPackage, Color = Color.DarkOrange, Name = "Interrogate Suspect" }; _cData = Serializer.LoadItemFromXML <CaseData>(Main.CDataPath); _sData = Serializer.GetSelectedListElementFromXml <PedData>(Main.SDataPath, s => s.FirstOrDefault <PedData>(c => String.Equals(c.Name, _cData.CurrentSuspect, StringComparison.CurrentCultureIgnoreCase))); "Sexual Assault Case Update".DisplayNotification("Speak to suspect", _cData.Number); return(true); }
protected override bool Initialize() { "Initializing L.S. Noir Callout: Sexual Assault -- Stage 3 [Victim Family]".AddLog(); _oneSpawn = GetRandomSpawn(); _areaBlip = new Blip(_oneSpawn.Spawn) { Sprite = BlipSprite.GangAttackPackage, Color = Color.DarkOrange, Name = "Victim's Family" }; ExtensionMethods.LogDistanceFromCallout(_oneSpawn.Spawn); _cData = Serializer.LoadItemFromXML <CaseData>(Main.CDataPath); _pData = Serializer.GetSelectedListElementFromXml <PedData>(Main.PDataPath, p => Enumerable.FirstOrDefault <PedData>(p, f => f.Type == PedType.VictimFamily)); $"Case number: {_cData.Number}".AddLog(); "Sexual Assault Case Update".DisplayNotification("Speak to family of the victim", _cData.Number); return(true); }
private void CreateStage() { var vehs = World.GetAllVehicles(); foreach (var v in vehs) { if (!v || Game.LocalPlayer.Character.CurrentVehicle == v) { continue; } if (v.DistanceTo(GetLocation("Mortuary", "Meeting", "P2").Spawn) > 35f) { continue; } v.Delete(); } _swat11 = new Cop("POLICE4", GetLocation("Mortuary", "Meeting", "P1"), GetLocation("Mortuary", "Location", "P1"), true, _copList); _swat12 = new Cop(_swat11.Veh, true, _copList); _swat21 = new Cop("FBI", GetLocation("Mortuary", "Meeting", "P2"), GetLocation("Mortuary", "Location", "P2"), true, _copList); _swat22 = new Cop(_swat21.Veh, true, _copList); _swat3 = new Cop("FBI2", GetLocation("Mortuary", "Meeting", "P3"), GetLocation("Mortuary", "Location", "P3"), true, _copList); _swat4 = new Cop("POLICE4", GetLocation("Mortuary", "Meeting", "P4"), GetLocation("Mortuary", "Location", "P4"), true, _copList); _traffic1 = new Cop("Police2", GetLocation("Mortuary", "Meeting", "T1"), GetLocation("Mortuary", "Location", "T1"), false, _copList); _traffic2 = new Cop("Police3", GetLocation("Mortuary", "Meeting", "T2"), GetLocation("Mortuary", "Location", "T2"), false, _copList); var loc = MathHelper.GetRandomInteger(1, 5); var name = ""; if (loc == 1) { name = "Wall"; } else if (loc == 2) { name = "Clip"; } else if (loc == 3) { name = "Clip2"; } else if (loc == 4) { name = "Tool"; } else { name = "Phone"; } _susSpawn = GetLocation("Mortuary", "Suspect", name); _sus = new Ped(_sData.Model, _susSpawn.Spawn, _susSpawn.Heading); SetAnimation(name); _stageCreated = true; }