public override void End() { calloutState = CalloutState.End; if (Suspect.Exists()) { Suspect.Dismiss(); } if (Victim.Exists()) { Victim.Dismiss(); } if (Victim2.Exists()) { Victim2.Dismiss(); } if (SuspectVehicle.Exists()) { SuspectVehicle.Dismiss(); } if (SuspectBlip.Exists()) { SuspectBlip.Delete(); } Game.LogTrivialDebug("Raven.Clean"); base.End(); }
public override void Process() { /// <summary /// This is for the main callout scripts that are in the StartProwler section, also tells the script when to execute the End command. /// /// </summary> base.Process(); Game.LogTrivial("Raven.Process"); int Callerkill = new Random().Next(1, 100); if (Callerkill >= 65) { caller.Inventory.GiveNewWeapon("PUMP_SHOTGUN", 20, true); caller.Tasks.FightAgainst(suspect); if (suspect.IsDead) { caller.Tasks.Clear(); caller.Tasks.StandStill(-1); } callerKill = true; } if (calloutState == CalloutState.Enroute && Game.LocalPlayer.Character.Position.DistanceTo(caller) <= 15f) { calloutState = CalloutState.WithCaller; StartCaller(); callerBlip.Delete(); callerBlip.DisableRoute(); } if (calloutState == CalloutState.End && !Functions.IsPursuitStillRunning(Pursuit)) { this.End(); } }
public override void End() { if (calloutState == CalloutState.End) { Game.LogTrivialDebug("CalloutState = CalloutState.End Proceeding"); if (suspect.Exists()) { suspect.Dismiss(); } if (victim.Exists()) { victim.Dismiss(); } if (suspectBlip.Exists()) { suspectBlip.Delete(); } Game.LogTrivialDebug("Raven.Clean"); base.End(); } else if (calloutState != CalloutState.End) { Game.LogTrivialDebug("CalloutState does not = CalloutState.End, setting now"); calloutState = CalloutState.End; } }
public override bool OnCalloutAccepted() { GameFiber.Wait(10000); calloutState = CalloutState.Enroute; victim.Tasks.Clear(); if (r1 == 1) { victim.Health = 0; Game.LogTrivialDebug("Victim Killed"); } else if (r1 == 2) { shooter = new Ped(victim.FrontPosition); shooter.Inventory.GiveNewWeapon("WEAPON_COMBAT_KNIFE", 0, true); shooter.Tasks.FightAgainst(victim, 5000); victim.Health = 0; Game.LogTrivialDebug("Shooter spawned"); } if (victim.IsDead) { shooter.Tasks.Flee(victim, 100, 10000); GameFiber.Wait(10000); shooter.Tasks.Wander(); } victimBlip = victim.AttachBlip(); Game.DisplaySubtitle("Dispatch: ", 10000); Game.LogTrivialDebug("Raven.Attached"); return(base.OnCalloutAccepted()); }
public override bool OnCalloutAccepted() { /// <summary /// Once accepted creates the blips, the routes, and gives the ped a weapon. /// </summary suspect.IsPersistent = true; caller.Tasks.StandStill(-1); caller.IsPersistent = true; suspect.BlockPermanentEvents = true; caller.BlockPermanentEvents = true; callerBlip = caller.AttachBlip(); callerBlip.EnableRoute(System.Drawing.Color.MintCream); callerBlip.Color = System.Drawing.Color.MintCream; calloutState = CalloutState.Enroute; suspect.Tasks.Wander(); suspect.Inventory.GiveNewWeapon(1593441988, 120, false); Game.DisplayNotification("Attend to the caller to find out information."); Game.LogTrivialDebug("RG:Callout created"); return(base.OnCalloutAccepted()); }
public override bool OnCalloutAccepted() { State = CalloutState.Dispatched; Helpers.VoiceHelper.PlayAudioDispatch10_4(); GetDirectionsToCall(CalloutPosition); CreateScene(CalloutPosition); return(base.OnCalloutAccepted()); }
public override void Process() { base.Process(); if (calloutState == CalloutState.Enroute && Game.LocalPlayer.Character.Position.DistanceTo(location) <= 15) { calloutState = CalloutState.OnScene; StartDomestic(); suspectBlip.DisableRoute(); Game.LogTrivialDebug("Raven arrived"); } if (calloutState == CalloutState.DecisionMade && !Functions.IsPursuitStillRunning(pursuit)) { this.End(); } }
public override bool OnCalloutAccepted() { calloutState = CalloutState.Enroute; suspectBlip = suspect.AttachBlip(); suspectBlip.Color = System.Drawing.Color.Red; suspectBlip.EnableRoute(System.Drawing.Color.Red); suspect.Tasks.AimWeaponAt(victim, -1); victim.Tasks.PutHandsUp(-1, suspect); Game.DisplaySubtitle("Dispatch:", 10000); Game.LogTrivialDebug("Raven.Attached"); return(base.OnCalloutAccepted()); }
public override void End() { calloutState = CalloutState.End; if (victim.Exists()) { victim.Dismiss(); } if (victimBlip.Exists()) { victimBlip.Delete(); } Game.LogTrivialDebug("Raven.Clean"); base.End(); }
public override bool OnCalloutAccepted() { calloutState = CalloutState.Enroute; SuspectBlip = Suspect.AttachBlip(); SuspectBlip.Color = System.Drawing.Color.Red; SuspectBlip.EnableRoute(System.Drawing.Color.Red); Suspect.Tasks.CruiseWithVehicle(SuspectVehicle, 75f, VehicleDrivingFlags.Emergency); // Dialouge needs to be rewritten. Mention something about a person slumped over in the back or passenger seat and that the driver was driving erratic or something, as it is, it doesnt make much sense. Game.DisplaySubtitle("Dispatch: Caller reports seeing two slumped passengers and the driver driving erraticly, no futher details at the moment. Be Advise use caution when aproching vehicle"); Game.LogTrivialDebug("Raven.Attached"); return(base.OnCalloutAccepted()); }
public override bool OnCalloutAccepted() { calloutState = CalloutState.Enroute; suspectBlip = suspect.AttachBlip(); suspectBlip.Color = System.Drawing.Color.Red; suspectBlip.EnableRoute(System.Drawing.Color.Red); suspect.Tasks.AimWeaponAt(victim, -1); victim.Tasks.PutHandsUp(-1, suspect); Game.DisplaySubtitle("Dispatch: RP reports two shots fired just before calling, saw two people arguing outside just before shots fired, not further details at this time. Advise caution on scene", 10000); Game.LogTrivialDebug("Raven.Attached"); return(base.OnCalloutAccepted()); }
public override void Process() { base.Process(); if (isBrokenVehicleInPosition()) { } if (State == CalloutState.Dispatched && Game.LocalPlayer.Character.DistanceTo(CalloutPosition) < 50f) { State = CalloutState.AtScene; HandleOfficerArrivedAtScene(); } }
public override void Process() { /// <summary /// This is for the main callout scripts that are in the StartProwler section, also tells the script when to execute the End command. /// /// </summary> base.Process(); Game.LogTrivialDebug("Raven.Process"); if (calloutState == CalloutState.Enroute && Game.LocalPlayer.Character.Position.DistanceTo(caller) <= 15f) { calloutState = CalloutState.WithCaller; StartCaller(); callerBlip.Delete(); callerBlip.DisableRoute(); } if (calloutState == CalloutState.End && !Functions.IsPursuitStillRunning(Pursuit)) { this.End(); } }
public override void Process() { base.Process(); if (calloutState == CalloutState.End) { End(); } if (calloutState == CalloutState.Enroute && Game.LocalPlayer.Character.Position.DistanceTo(victim) <= 5) { calloutState = CalloutState.OnScene; startMedical(); victimBlip.DisableRoute(); Game.LogTrivial("Raven arrived"); } if (calloutState == CalloutState.End && !Functions.IsPursuitStillRunning(pursuit)) { End(); } }
public override void Process() { base.Process(); if (calloutState == CalloutState.End) { End(); } if (calloutState == CalloutState.Enroute && Game.LocalPlayer.Character.Position.DistanceTo(SuspectVehicle) <= 10) { calloutState = CalloutState.OnScene; startBody(); SuspectBlip.DisableRoute(); Game.LogTrivial("Raven arrived"); } if (calloutState == CalloutState.End && !Functions.IsPursuitStillRunning(Pursuit)) { End(); } }
public override void End() { base.End(); State = CalloutState.Completed; Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "TrafficCallouts", "~r~Version 1.0~r~", "Callout has ended!"); if (driver.Exists()) { driver.Dismiss(); } if (brokenVehicle.Exists()) { brokenVehicle.Dismiss(); } if (driverBlip.Exists()) { driverBlip.Delete(); } }
public override bool OnCalloutAccepted() { ///Create Suspect Vehicle suspectVehicle = new Vehicle(location); //Find a vehicle to use instead of random cause of helicopters and blimps spawning. suspectVehicle.IsPersistent = true; vehicleBlip = suspectVehicle.AttachBlip(); vehicleBlip.IsFriendly = false; vehicleBlip.EnableRoute(System.Drawing.Color.Black); vehicleBlip.Color = System.Drawing.Color.Black; ///Create Suspect Ped suspect = new Ped(location.Around(10f)); suspect.IsPersistent = true; suspect.BlockPermanentEvents = true; suspect.Tasks.Wander(); //Set Callout using Random numbers. calloutState = (CalloutState) new Random().Next(1, 3); Game.DisplayNotification("Citizens report vehicle blocking traffic lanes, get to the vehicle and get it towed, than find the owner and cite them. (Don't forget to search the car)"); return(base.OnCalloutAccepted()); }
public void StartCaller() { GameFiber.StartNew(delegate { if (calloutState == CalloutState.WithCaller && callerKill == false && Game.LocalPlayer.Character.Position.DistanceTo(caller) <= 5f) { #region Caller Dialouge Game.DisplaySubtitle("Caller:Officer! Officer! Over here!", 5000); GameFiber.Sleep(5000); Game.DisplayNotification("Officer: Dispatch, show me 10-75 with the RP"); Game.DisplaySubtitle("Caller:Officer, I saw someone creeping around in my yard peeking in my windows, I came out to investigate when they took off.", 10000); GameFiber.Sleep(10000); Game.DisplaySubtitle("You:Do you know what they look like?", 5000); GameFiber.Sleep(10000); Game.DisplaySubtitle("Caller:I Have him on CCTV, the stupid f****r.", 5000); GameFiber.Sleep(10000); Game.DisplaySubtitle("You:Did you see what direction they went?", 5000); GameFiber.Sleep(5000); Game.DisplaySubtitle("Caller:They went off in that direction.", 5000); GameFiber.Sleep(5000); Game.DisplayNotification("Officer: Dispatch, show me as looking for that 10-14"); GameFiber.Sleep(3000); Game.DisplayNotification("Dispatch: Copy, showing you on that 10-14"); calloutState = CalloutState.Searching; #endregion Game.LogTrivial("Raven.Caller1"); } if (calloutState == CalloutState.WithCaller && callerKill == true) { ///<summary> ///Caller shoots suspect, investigate and arrest the caller if needed. ///</summary> if (Game.LocalPlayer.Character.Position.DistanceTo(caller.Position) <= 5f) { ///<summary> ///Caller explains situation and what happened. up to offier to determine if the shooting is justified or not, ///multiple checks will be needed here, this will get quite complex. ///</summary> int t = new Random().Next(1, 5); #region Caller speech #endregion } if (caller.IsCuffed) { caller.Inventory.Weapons.Remove("PUMP_SHOTGUN"); } } if (calloutState == CalloutState.Searching && Game.LocalPlayer.Character.Position.DistanceTo(suspect) >= 10f) { ///<summary> ///Create Search area and attach it to suspect. ///</summary> #region Search area SearchBlip = suspect.AttachBlip(); SearchBlip.Alpha = 100; SearchBlip.Color = System.Drawing.Color.Yellow; SearchBlip.Scale = 30; SearchBlip.EnableRoute(System.Drawing.Color.Yellow); Game.DisplayNotification("Search the area for the suspect and investigate."); if (callerBlip.Exists()) { callerBlip.Delete(); } if (caller.Exists()) { caller.Dismiss(); } Game.LogTrivial("Raven.Caller.Complete"); StartProwler(); #endregion Game.LogTrivial("Raven.Caller2"); } }); }
public void startBody() { ///<summary> ///Add flee options and than add a iscuffed check, than create dialouge for suspect after suspect is cuffed. /// </summary> /// GameFiber.StartNew(delegate { speechCheck = 1; this.Pursuit = Functions.CreatePursuit(); // Find new Random Number Gen, better results are needed. if (Debug == true) { r = 2; //Debug only } else { r = new Random().Next(4, 100); //Release } calloutState = CalloutState.DecisionMade; #region Suspect Flee (On Foot) if (r <= 49 && r >= 11 || r == 1) { Game.LogTrivialDebug("Raven1"); Suspect.Tasks.LeaveVehicle(flags: LeaveVehicleFlags.LeaveDoorOpen); Suspect.Tasks.Clear(); GameFiber.Wait(1000); if (!Suspect.IsInAnyVehicle(false)) { Suspect.Tasks.Flee(Game.LocalPlayer.Character, 10000, -1); Pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(Pursuit, Suspect); Functions.SetPursuitIsActiveForPlayer(Pursuit, true); PursuitCreated = true; Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); } if (Suspect.IsDead) { calloutState = CalloutState.End; End(); } if (Suspect.IsCuffed) { calloutState = CalloutState.End; End(); } } #endregion #region Suspect Fight if (r >= 50 && r >= 11 && r > 3 || r == 2) { Game.LogTrivialDebug("Raven2"); Suspect.Tasks.LeaveVehicle(flags: LeaveVehicleFlags.LeaveDoorOpen); GameFiber.Wait(500); Suspect.Tasks.Clear(); GameFiber.Wait(500); if (!Suspect.IsInAnyVehicle(false)) { Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character, -1); GameFiber.Wait(3000); // Created a pursuit so backup works properly. Looks good and should run flawlessly here. Pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(Pursuit, Suspect); Functions.SetPursuitIsActiveForPlayer(Pursuit, true); PursuitCreated = true; /* * 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.LocalUnit); */ } if (Suspect.IsDead) { calloutState = CalloutState.End; End(); } if (Suspect.IsCuffed) { calloutState = CalloutState.End; End(); } } #endregion #region Suspect Flee (In Vehicle) if (r <= 10 && r > 3 || r == 3) { Game.LogTrivialDebug("Raven3"); SuspectBlip = Suspect.AttachBlip(); Pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(Pursuit, Suspect); Functions.SetPursuitIsActiveForPlayer(Pursuit, true); PursuitCreated = true; if (Suspect.IsDead) { calloutState = CalloutState.End; End(); } if (Suspect.IsCuffed) { calloutState = CalloutState.End; End(); } } #endregion }); }
public void StartTraffic() { GameFiber.StartNew(delegate //Start new gameFiber { #region Callout Settings ///<summary> ///Sets the internal callout ints for use for random generation, speech and more. /// </summary> if (speechCheck == 0) { speechCheck = 1; } //Set speech check to one else { End(); } this.pursuit = Functions.CreatePursuit(); if (Debug == true) { r = 3; // Debug settings } else if (Debug == false) { r = new Random().Next(4, 100); } // Release Settings calloutState = CalloutState.DecisionMade; #endregion #region Suspect Flees if (r >= 50 && r >= 11 && r > 3 || r == 1) { ///<summary> ///Have suspect get back into car and flee starting a pursuit, maybe find way to damage vehicle. add variable to determine if suspect flees on foot or in the vehicle /// </summary> if (Debug == true) { flee = 1; } else if (Debug == false) { flee = new Random().Next(1, 2); } if (flee == 2) { Game.LogTrivialDebug("Raven.accident1.flee2.start"); Game.DisplaySubtitle("Suspect: Oh shit the pigs are here!", 5000); suspect.Tasks.Flee(Game.LocalPlayer.Character, 10000, -1); pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(pursuit, suspect); Functions.SetPursuitIsActiveForPlayer(pursuit, true); pursuitCreated = true; Game.DisplayNotification("Officer: Suspect is fleeing, in pursuit!"); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); GameFiber.Wait(6000); Game.LogTrivialDebug("Raven.accident1.complete"); if (suspect.IsDead) { calloutState = CalloutState.End; End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; End(); } } else if (flee == 1) { Game.LogTrivialDebug("Raven.accident1.flee1.start"); Game.DisplaySubtitle("Suspect: I'm not going back to jail!", 5000); suspect.Tasks.EnterVehicle(suspectVehicle, 0); suspect.Tasks.Flee(location, 10000, -1); pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(pursuit, suspect); Functions.SetPursuitIsActiveForPlayer(pursuit, true); pursuitCreated = true; Game.DisplayNotification("Officer: Suspect is fleeing, in pursuit!"); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); GameFiber.Wait(6000); Game.LogTrivialDebug("Raven.accident1.complete"); if (suspect.IsDead) { calloutState = CalloutState.End; End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; End(); } } } #endregion #region suspect fight if (r <= 49 && r >= 11 || r == 2) //need testing to ensure properly working { ///<summary> ///Gives suspect a weapon and suspect attacks officer, after ten seconds the suspect flees on foot /// </summary> Game.LogTrivialDebug("Raven.accident2.fight.start"); //give suspect a knife(preffered) or gun(Temp) suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", 120, true); suspect.Tasks.FireWeaponAt(Game.LocalPlayer.Character, -1, FiringPattern.BurstFirePistol); GameFiber.Wait(4000); suspect.Tasks.Clear(); suspect.Tasks.Flee(Game.LocalPlayer.Character, 1000, -1); pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(pursuit, suspect); Functions.SetPursuitIsActiveForPlayer(pursuit, true); pursuitCreated = true; Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); if (suspect.IsDead) { calloutState = CalloutState.End; End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; End(); } Game.LogTrivialDebug("Raven.accident2.complete"); } #endregion #region Suspect Surrender if (r <= 10 && r > 3 || r == 3) { Game.LogTrivialDebug("Raven.accident1.surrender1.start"); suspect.Tasks.PutHandsUp(-1, Game.LocalPlayer.Character); Game.DisplaySubtitle("Suspect: I didn't do anything, I tried to stop but couldn't. I'm so sorry officer."); speechCheck = 0; //Add more investigative things to this callout //foreach (var item in speechSuspect) needs testing to see if works without the foreach loops, //{ // Currently disabled until completed. /* remove once complete * while (true && speechCheck == 1) * { * Game.DisplayHelp("Press Y to talk."); * GameFiber.Yield(); * if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) * { * break; * } * } * //Add dialouge * Game.DisplaySubtitle("", 5000); * Game.DisplaySubtitle(",", 5000); * speechCheck = 2; * * while (true && speechCheck == 2) * { * Game.DisplayHelp("Press Y to talk."); * GameFiber.Yield(); * if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) * { break; } * } * * Game.DisplaySubtitle(".", 5000); * Game.DisplaySubtitle("", 5000); * speechCheck = 3; * while (true && speechCheck == 3) * { * Game.DisplayHelp("Press Y to talk."); * GameFiber.Yield(); * if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) * { break; } * } * * Game.DisplaySubtitle("", 5000); * Game.DisplaySubtitle(""); * speechCheck = 4; * * while (true && speechCheck == 4) * { * Game.DisplayHelp("Press Y to talk."); * GameFiber.Yield(); * if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) * { break; } * } * * //} * * if (suspect.IsDead) * { calloutState = CalloutState.End; End(); } * if (suspect.IsCuffed) * { calloutState = CalloutState.End; End(); } * Game.LogTrivialDebug("Raven.accident3.complete"); * *///remove once complete } #endregion }); }
public void StartDomestic() { GameFiber.StartNew(delegate { speechCheck = 1; this.pursuit = Functions.CreatePursuit(); // Find new Random Number Gen, better results are needed. if (Debug == true) { r = 2; //Debug only } else { r = new Random().Next(4, 100); //Release } calloutState = CalloutState.DecisionMade; #region Suspect Fight if (r <= 49 && r >= 11 || r == 1) { Game.LogTrivialDebug("Raven1"); suspect.Tasks.FightAgainst(Game.LocalPlayer.Character, -1); victim.Tasks.Flee(suspect, 100000, 5000); GameFiber.Wait(4000); suspect.Tasks.Clear(); suspect.Tasks.Flee(Game.LocalPlayer.Character, 1000, -1); pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(pursuit, suspect); Functions.SetPursuitIsActiveForPlayer(pursuit, true); pursuitCreated = true; Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); if (suspect.IsDead) { calloutState = CalloutState.End; this.End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; this.End(); } } #endregion #region Suspect Kill Victim if (r >= 50 && r >= 11 && r > 3 || r == 2) { Game.LogTrivialDebug("Raven2"); pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(pursuit, suspect); Functions.SetPursuitIsActiveForPlayer(pursuit, true); pursuitCreated = true; Game.DisplayNotification("Officer: Dispatch shots fired 10-99 emergency!"); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); if (speechCheck == 1) { Game.DisplaySubtitle("Suspect: I'm gonna f*****g kill you!"); suspect.Tasks.FightAgainst(victim, 5000); victim.Tasks.Flee(suspect, 10000, -1); speechCheck = 2; } GameFiber.Wait(6000); suspect.Tasks.Clear(); suspect.Tasks.Flee(Game.LocalPlayer.Character, 1000, -1); if (suspect.IsDead) { calloutState = CalloutState.End; this.End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; this.End(); } } #endregion #region Suspect Surrender if (r <= 10 && r > 3 || r == 3) { Game.LogTrivialDebug("Raven3"); suspect.Tasks.PutHandsUp(-1, Game.LocalPlayer.Character); Game.DisplaySubtitle("Suspect: I didn't do anything, I give up."); //Add more investigative things to this callout //foreach (var item in speechSuspect) needs testing to see if works with foreach loops //{ while (true && speechCheck == 1) { Game.DisplayHelp("Press Y to talk."); GameFiber.Yield(); if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) { break; } } Game.DisplaySubtitle("Suspect: She had a knife and was threating to kill me, I had no choice", 5000); Game.DisplaySubtitle("Suspect: I ran from the house to my car and she followed me,", 5000); speechCheck = 2; while (true && speechCheck == 2) { Game.DisplayHelp("Press Y to talk."); GameFiber.Yield(); if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) { break; } } Game.DisplaySubtitle("Suspect: I managed to get my pistol out of the glove box.", 5000); Game.DisplaySubtitle("Suspect: Thats when I saw her charging me from the porch with the knife still in her hand", 5000); speechCheck = 3; while (true && speechCheck == 3) { Game.DisplayHelp("Press Y to talk."); GameFiber.Yield(); if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) { break; } } Game.DisplaySubtitle("Suspect: I had no choice, I needed to defend myself so I fired one shot, not sure if I hit her or not though.", 5000); Game.DisplaySubtitle("Speak with the Victim"); speechCheck = 4; while (true && speechCheck == 4) { Game.DisplayHelp("Press Y to talk."); GameFiber.Yield(); if (Game.IsKeyDown(System.Windows.Forms.Keys.Y) && Game.LocalPlayer.Character.Position.DistanceTo(suspect) <= 5f) { break; } } ///<summary> ///Create more random outcomes for this here at least three. /// </summary> Game.DisplaySubtitle("Victim: I'm going to cut that cheaters heart out!"); victim.Inventory.GiveNewWeapon("WEAPON_KNIFE", 1, true); victim.Tasks.FightAgainst(suspect, 10000); GameFiber.Wait(10000); victim.Tasks.Flee(Game.LocalPlayer.Character, 50000, -1); //} if (suspect.IsDead) { calloutState = CalloutState.End; this.End(); } if (suspect.IsCuffed) { calloutState = CalloutState.End; this.End(); } } #endregion } ); }
public void StartDomestic() { GameFiber.StartNew(delegate { speechCheck = 1; this.pursuit = Functions.CreatePursuit(); // Find new Random Number Gen, better results are needed. //int r = new Random().Next(1, 3); int r = 1; calloutState = CalloutState.DecisionMade; #region Suspect Fight if (r == 1) { Game.LogTrivialDebug("Raven1"); suspect.Tasks.FightAgainst(Game.LocalPlayer.Character, -1); victim.Tasks.Flee(suspect, 100000, -1); GameFiber.Sleep(5000); suspect.Tasks.Flee(Game.LocalPlayer.Character, 0, -1); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); if (suspect.IsDead) { this.End(); } else if (suspect.IsCuffed) { this.End(); } } #endregion #region Suspect Kill Victim if (r == 2) { Game.LogTrivialDebug("Raven2"); suspect.Tasks.FireWeaponAt(victim, 5000, FiringPattern.BurstFirePistol); victim.Tasks.Flee(suspect, 10000, -1); Functions.AddPedToPursuit(this.pursuit, suspect); Game.DisplayNotification("Offcer: Dispatch shots fired 10-99 emergency!"); Functions.RequestBackup(Game.LocalPlayer.Character.Position, LSPD_First_Response.EBackupResponseType.Pursuit, LSPD_First_Response.EBackupUnitType.LocalUnit); Game.DisplaySubtitle("Suspect: I'm gonna f*****g kill you!"); GameFiber.Sleep(5000); suspect.Tasks.Flee(Game.LocalPlayer.Character, 0, -1); if (suspect.IsDead) { this.End(); } else if (suspect.IsCuffed) { this.End(); } } #endregion #region Suspect Surrender if (r == 0) { Game.LogTrivialDebug("Raven3"); suspect.Tasks.PutHandsUp(-1, Game.LocalPlayer.Character); if (suspect.IsDead) { this.End(); } else if (suspect.IsCuffed) { this.End(); } } #endregion } ); }
public void StartCaller() { GameFiber.StartNew(delegate { if (calloutState == CalloutState.WithCaller && Game.LocalPlayer.Character.Position.DistanceTo(caller) <= 5f) { #region Caller Dialouge Game.DisplaySubtitle("Caller:Officer! Officer! Over here!", 5000); GameFiber.Sleep(5000); Game.DisplayNotification("Officer: Dispatch, show me 10-75 with the RP"); Game.DisplaySubtitle("Caller:Officer, I saw someone creeping around in my yard peeking in my windows, I came out to investigate when they took off.", 10000); GameFiber.Sleep(10000); Game.DisplaySubtitle("You:Do you know what they look like?", 5000); GameFiber.Sleep(10000); Game.DisplaySubtitle("Caller:I Have him on CCTV, the stupid f****r.", 5000); GameFiber.Sleep(10000); Game.DisplaySubtitle("You:Did you see what direction they went?", 5000); GameFiber.Sleep(5000); Game.DisplaySubtitle("Caller:They went off in that direction.", 5000); GameFiber.Sleep(5000); Game.DisplayNotification("Officer: Dispatch, show me as looking for that 10-14"); GameFiber.Sleep(3000); Game.DisplayNotification("Dispatch: Copy, showing you on that 10-14"); calloutState = CalloutState.Searching; #endregion Game.LogTrivialDebug("Raven.Caller1"); } if (calloutState == CalloutState.Searching && Game.LocalPlayer.Character.Position.DistanceTo(suspect) >= 10f) { ///<summary> ///Create Search area and attach it to suspect. ///</summary> #region Search area SearchBlip = suspect.AttachBlip(); SearchBlip.Alpha = 100; SearchBlip.Color = System.Drawing.Color.Yellow; SearchBlip.Scale = 30; SearchBlip.EnableRoute(System.Drawing.Color.Yellow); Game.DisplayNotification("Search the area for the suspect and investigate."); if (callerBlip.Exists()) { callerBlip.Delete(); } if (caller.Exists()) { caller.Dismiss(); } Game.LogTrivialDebug("Raven.Caller.Complete"); StartProwler(); #endregion Game.LogTrivialDebug("Raven.Caller2"); } }); }