public override bool OnCalloutAccepted() { // Set the player as responding to the call. state = EGangAttackState.EnRoute; // Attach a blip to our peds and so the player knows where to go. B1 = A1.AttachBlip(); B2 = A2.AttachBlip(); B3 = A3.AttachBlip(); B4 = A4.AttachBlip(); B5 = A5.AttachBlip(); B6 = A6.AttachBlip(); B7 = A7.AttachBlip(); B8 = A8.AttachBlip(); B9 = A9.AttachBlip(); B10 = A10.AttachBlip(); // Display the message Game.DisplaySubtitle("Get to the ~r~scene~w~.", 6500); B1.EnableRoute(Color.Red); return(base.OnCalloutAccepted()); }
public void StartGangAttackScenario() { GameFiber.StartNew(delegate { // Create our pursuit pursuit = Functions.CreatePursuit(); // Set the state to decision made state = EGangAttackState.DecisionMade; // Make everybody point their guns NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A1, A6, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A2, A7, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A3, A8, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A4, A9, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A5, A10, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A6, A1, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A7, A2, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A8, A3, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A9, A4, -1, true); NativeFunction.CallByName <uint>("TASK_AIM_GUN_AT_ENTITY", A10, A5, -1, true); // Request backup Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.LocalUnit); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.SwatTeam); new RelationshipGroup("BALLAS"); new RelationshipGroup("GROVE"); A1.RelationshipGroup = "BALLAS"; A2.RelationshipGroup = "BALLAS"; A3.RelationshipGroup = "BALLAS"; A4.RelationshipGroup = "BALLAS"; A5.RelationshipGroup = "BALLAS"; A6.RelationshipGroup = "GROVE"; A7.RelationshipGroup = "GROVE"; A8.RelationshipGroup = "GROVE"; A9.RelationshipGroup = "GROVE"; A10.RelationshipGroup = "GROVE"; Game.SetRelationshipBetweenRelationshipGroups("BALLAS", "GROVE", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("GROVE", "BALLAS", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("BALLAS", "BLUE", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("BLUE", "BALLAS", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("GROVE", "BLUE", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("BLUE", "GROVE", Relationship.Hate); A1.Tasks.FightAgainstClosestHatedTarget(1000f); A2.Tasks.FightAgainstClosestHatedTarget(1000f); A3.Tasks.FightAgainstClosestHatedTarget(1000f); A4.Tasks.FightAgainstClosestHatedTarget(1000f); A5.Tasks.FightAgainstClosestHatedTarget(1000f); A6.Tasks.FightAgainstClosestHatedTarget(1000f); A7.Tasks.FightAgainstClosestHatedTarget(1000f); A8.Tasks.FightAgainstClosestHatedTarget(1000f); A9.Tasks.FightAgainstClosestHatedTarget(1000f); A10.Tasks.FightAgainstClosestHatedTarget(1000f); //// Start one of the random outcomes //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A1, A6, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A2, Game.LocalPlayer.Character, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A3, A8, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A4, A9, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A5, Game.LocalPlayer.Character, 0, 1); //// Grove st. //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A6, A1, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A7, Game.LocalPlayer.Character, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A8, A3, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A9, A4, 0, 1); //NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A10, Game.LocalPlayer.Character, 0, 1); // Wait 20 seconds before adding 5 people to the pursuit the other ones will continue shooting at the player or the other gangsters GameFiber.Sleep(25000); if (A1.IsDead) { B1.Delete(); } if (A2.IsDead) { B2.Delete(); } if (A3.IsDead) { B3.Delete(); } if (A4.IsDead) { B4.Delete(); } if (A5.IsDead) { B5.Delete(); } if (A6.IsDead) { B6.Delete(); } if (A7.IsDead) { B7.Delete(); } if (A8.IsDead) { B8.Delete(); } if (A9.IsDead) { B9.Delete(); } if (A10.IsDead) { B10.Delete(); } //Functions.AddPedToPursuit(pursuit, A1); //Functions.AddPedToPursuit(pursuit, A3); //Functions.AddPedToPursuit(pursuit, A4); //Functions.AddPedToPursuit(pursuit, A7); //Functions.AddPedToPursuit(pursuit, A9); Game.LogTrivialDebug("Adding peds to pursuit."); if (A1.IsAlive) { Functions.AddPedToPursuit(pursuit, A1); } if (A2.IsAlive) { Functions.AddPedToPursuit(pursuit, A2); } if (A3.IsAlive) { Functions.AddPedToPursuit(pursuit, A3); } if (A4.IsAlive) { Functions.AddPedToPursuit(pursuit, A4); } if (A5.IsAlive) { Functions.AddPedToPursuit(pursuit, A5); } if (A6.IsAlive) { Functions.AddPedToPursuit(pursuit, A6); } if (A7.IsAlive) { Functions.AddPedToPursuit(pursuit, A7); } if (A8.IsAlive) { Functions.AddPedToPursuit(pursuit, A8); } if (A9.IsAlive) { Functions.AddPedToPursuit(pursuit, A9); } if (A10.IsAlive) { Functions.AddPedToPursuit(pursuit, A10); } Game.LogTrivialDebug("Added peds to pursuit."); }); }
public override void Process() { base.Process(); // Remove the dead people blips if (A1.IsDead) { if (B1.Exists()) { B1.Delete(); } } if (A2.IsDead) { if (B2.Exists()) { B2.Delete(); } } if (A3.IsDead) { if (B3.Exists()) { B3.Delete(); } } if (A4.IsDead) { if (B4.Exists()) { B4.Delete(); } } if (A5.IsDead) { if (B5.Exists()) { B5.Delete(); } } if (A6.IsDead) { if (B6.Exists()) { B6.Delete(); } } if (A7.IsDead) { if (B7.Exists()) { B7.Delete(); } } if (A8.IsDead) { if (B8.Exists()) { B8.Delete(); } } if (A9.IsDead) { if (B9.Exists()) { B9.Delete(); } } if (A10.IsDead) { if (B10.Exists()) { B10.Delete(); } } if (A1.IsCuffed) { if (B1.Exists()) { B1.Delete(); } } if (A2.IsCuffed) { if (B2.Exists()) { B2.Delete(); } } if (A3.IsCuffed) { if (B3.Exists()) { B3.Delete(); } } if (A4.IsCuffed) { if (B4.Exists()) { B4.Delete(); } } if (A5.IsCuffed) { if (B5.Exists()) { B5.Delete(); } } if (A6.IsCuffed) { if (B6.Exists()) { B6.Delete(); } } if (A7.IsCuffed) { if (B7.Exists()) { B7.Delete(); } } if (A8.IsCuffed) { if (B8.Exists()) { B8.Delete(); } } if (A9.IsCuffed) { if (B9.Exists()) { B9.Delete(); } } if (A10.IsCuffed) { if (B10.Exists()) { B10.Delete(); } } // If the player is driving to the scene, and their distance to the scene is less than 15, start the callout's logic if (state == EGangAttackState.EnRoute && Game.LocalPlayer.Character.Position.DistanceTo(spawnPoint) <= 50f) { // Set the player as on scene state = EGangAttackState.OnScene; // Start the callout's logic StartGangAttackScenario(); } if (state == EGangAttackState.DecisionMade && !Functions.IsPursuitStillRunning(pursuit) || A1.IsDead && A2.IsDead && A3.IsDead && A4.IsDead && A5.IsDead && A6.IsDead && A7.IsDead && A8.IsDead && A9.IsDead && A10.IsDead) { this.End(); } }