Jump to content

jmargel74

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jmargel74's Achievements

Upstanding Citizen

Upstanding Citizen (2/12)

2

Reputation

  1. Thank you! I will try it after work today.
  2. ToastinYou, I tried your code and modified it some. The first truck is fine, the second trucker seems to want to get out of his truck pretty quickly. With the traffic they don't seem to stay with each other. Give it a try and see what you recommend. It's hard to program these when the api functions really don't tell you what they do. I really appreciate your help, I think if we can work out the bugs we could have a really cool callout.
  3. Just making a simple callout, I want to Semi's to follow each other. First question, when they spawn I need them to spawn one behind the other, the second question is when they spawn they won't spawn facing the correct direction on a road. They just seem to spawn where they like. Below is my code. Any advice? I'm new to this.. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Rage; using LSPD_First_Response.Mod.API; using LSPD_First_Response.Mod.Callouts; using LSPD_First_Response.Engine.Scripting.Entities; namespace Mayhem { [CalloutInfo("StolenVehicle", CalloutProbability.High)] public class StolenVehicle : Callout { private Ped Suspect1; private Ped Suspect2; private Ped Suspect3; private Vehicle Truck1; private Vehicle Truck1Trailer; private Vehicle Truck2; private Vehicle Truck2Trailer; private Vehicle Truck3; private Vehicle Truck3Trailer; private Vector3 SpawnPoint; private Vector3 SpawnPoint2; private Vector3 SpawnPoint3; private Blip SuspectBlip; private Blip SuspectBlip1; private Blip SuspectBlip2; private Blip SuspectBlip3; private LHandle Pursuit; private bool PursuitCreated = false; public override bool OnBeforeCalloutDisplayed() { SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(250f)); ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 30f); AddMinimumDistanceCheck(20f, SpawnPoint); CalloutMessage = "Stolen Tractor Trailers!"; CalloutPosition = SpawnPoint; Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_GRAND_THEFT_AUTO IN_OR_ON_POSITION", SpawnPoint); return base.OnBeforeCalloutDisplayed(); } public override bool OnCalloutAccepted() { Truck1 = new Vehicle("PHANTOM", SpawnPoint); Truck1Trailer = new Vehicle("FREIGHTTRAILER", SpawnPoint); Truck1.Trailer = Truck1Trailer; Vector3 o1 = Truck1.GetOffsetPosition(new Vector3(25f, -25f, 0f)); Truck2 = new Vehicle("PHANTOM", o1); Truck2Trailer = new Vehicle("FREIGHTTRAILER", o1); Truck2.Trailer = Truck2Trailer; Suspect1 = Truck1.CreateRandomDriver(); Suspect1.IsPersistent = true; Suspect1.BlockPermanentEvents = true; Suspect1.RelationshipGroup = "Friends1"; Suspect2 = Truck2.CreateRandomDriver(); Suspect2.IsPersistent = true; Suspect2.BlockPermanentEvents = true; Suspect2.RelationshipGroup = "Friends2"; Game.SetRelationshipBetweenRelationshipGroups("Friends1", "Friends2", Relationship.Companion); SuspectBlip1 = Suspect1.AttachBlip(); SuspectBlip1.IsFriendly = false; SuspectBlip2 = Suspect2.AttachBlip(); SuspectBlip2.IsFriendly = false; Suspect1.Tasks.CruiseWithVehicle(20f, VehicleDrivingFlags.Emergency); Suspect2.Tasks.CruiseWithVehicle(20f, VehicleDrivingFlags.Emergency); Suspect1.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true); Suspect2.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true); Suspect1.Tasks.FightAgainst(Game.LocalPlayer.Character, -1); Suspect2.Tasks.FightAgainst(Game.LocalPlayer.Character, -1); Suspect2.Tasks.ChaseWithGroundVehicle(Suspect1); return base.OnCalloutAccepted(); } public override void Process() { base.Process(); if (!PursuitCreated && Game.LocalPlayer.Character.DistanceTo(Suspect1.Position) < 30f) { Pursuit = Functions.CreatePursuit(); Functions.AddPedToPursuit(Pursuit, Suspect1); Functions.AddPedToPursuit(Pursuit, Suspect2); Functions.SetPursuitIsActiveForPlayer(Pursuit, true); PursuitCreated = true; } if (PursuitCreated && !Functions.IsPursuitStillRunning(Pursuit)) { End(); } } public override void End() { base.End(); if (Suspect1.Exists()) { Suspect1.Dismiss(); } if (Truck1.Exists()) { Truck1.Dismiss(); } if (Truck1Trailer.Exists()) { Truck1Trailer.Dismiss(); } if (SuspectBlip1.Exists()) { SuspectBlip1.Delete(); } if (Suspect2.Exists()) { Suspect2.Dismiss(); } if (Truck2.Exists()) { Truck2.Dismiss(); } if (Truck2Trailer.Exists()) { Truck2Trailer.Dismiss(); } if (SuspectBlip2.Exists()) { SuspectBlip2.Delete(); } } } }
  4. What about a convoy? Between 10-20 tractor trailers working in unison. That would make for some great action. :)
  5. Can you have them hate objects? Not ones that you spawn. cmPLX how would I set the relationship.hate to the public peds (not the ones I spawn)? Does Ped.RelationshipGroup.SetRelationshipWith(RelationshipGroup.Player, Relationship.Hate); accomplish this? What really would be cool is to implement neurotechnology with artificial intelligence and basically have the peds think for themselves and watch what happens lol.. but back to the topic at hand :)
  6. Wanted to create a type of riot callout. I have the aggressors attacking victims, but I am looking for help on getting the aggressors attacking the public in general, just not the victims I spawn. I am also looking for help for them to attack parked cars and places like the gas pumps at gas stations, public buildings, fire hydrants, etc.. Any advice?
×
×
  • Create New...