//This is where it all happens, run all of your callouts logic here public override void Process() { if (ped.Exists() && Vector3.Distance(Game.LocalPlayer.Character.Position, ped.Position) < 17.5f && state == EWantedFelonInVehicleState.Searching) { state = EWantedFelonInVehicleState.Found; SuspectFound(); } if (state == EWantedFelonInVehicleState.Found) { if (ped.Exists() && shouldAttack && !ped.IsInAnyVehicle(false) && !Functions.IsPedGettingArrested(ped) && !Functions.IsPedArrested(ped)) { ped.AttackPed(Game.LocalPlayer.Character); } } base.Process(); if (!ped.Exists() || ped.IsDead || Functions.IsPedArrested(ped)) { this.End(); } }
public override bool OnCalloutAccepted() { Game.SetRelationshipBetweenRelationshipGroups("COUGAR", "PED", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("COUGAR", "PLAYER", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("PED", "PLAYER", Relationship.Companion); attackedPed.MaxHealth = 200; attackedPedBlip = new Blip(attackedPed); attackedPedBlip.Color = Color.ForestGreen; animalBlip = new Blip(animal); animalBlip.Color = Color.DarkRed; attackedPed.ReactAndFlee(animal); animal.AttackPed(attackedPed); return(base.OnCalloutAccepted()); }
// SCENARIOS public void Shoot() // SHOOT SCENARIO { Logger.LogTrivial(this.GetType().Name, "Shoot()"); scenario = EScenario.Shoot; GameFiber.StartNew(delegate { if (!licenseHasBeenGiven) { Game.DisplaySubtitle("~b~Hunter: ~w~" + hunterNoLicenseAndAttackAnswers.GetRandomElement(), 2500); } else if (licenseHasBeenGiven) { Game.DisplaySubtitle("~b~Hunter: ~w~" + hunterLicenseSuspended.GetRandomElement(), 2500); } hunter.PlayAmbientSpeech(Globals.Random.Next(2) == 1 ? Globals.Random.Next(2) == 1 ? Speech.GENERIC_FUCK_YOU : Speech.GENERIC_INSULT_HIGH : Speech.GENERIC_INSULT_MED); Game.SetRelationshipBetweenRelationshipGroups("HUNTER", "COP", Relationship.Hate); Game.SetRelationshipBetweenRelationshipGroups("HUNTER", "PLAYER", Relationship.Hate); this.pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(this.pursuit, this.hunter); Functions.SetPursuitIsActiveForPlayer(pursuit, true); isPursuitRunning = true; while (true) { GameFiber.Yield(); if (breakForceEnd) { break; } if (hunter.Exists() && hunter.IsAlive && !hunter.IsInAnyVehicle(false) && !LSPD_First_Response.Mod.API.Functions.IsPedGettingArrested(hunter) && !LSPD_First_Response.Mod.API.Functions.IsPedArrested(hunter)) { hunter.AttackPed(Game.LocalPlayer.Character); } state = EIllegalHuntingState.End; } }); }