Jump to content

Armed Pursuit [HELP]


Kolopsel

Recommended Posts

Hello,

so today ive "finished" my pursuit Plugin, which would create a pursuit like the basic ones from LSPDFR. Now i thought it would be a lot more fun, that the suspects in vehicle would shoot 

out of it. So i gave my suspects weapons and created a Relationshipgroup for them. Now i made that the Suspect Relationshipgroup hates the Cop Relationshipgroup. But when im in game they just flee.

My Code :

Suspect.RelationshipGroup = "RelSuspect";
            Suspect1.RelationshipGroup = "RelSuspect";
            Suspect2.RelationshipGroup = "RelSuspect";
            Suspect3.RelationshipGroup = "RelSuspect";
            Suspect4.RelationshipGroup = "RelSuspect";
            Suspect5.RelationshipGroup = "RelSuspect";
            Suspect6.RelationshipGroup = "RelSuspect";
            Suspect7.RelationshipGroup = "RelSuspect";
            Game.SetRelationshipBetweenRelationshipGroups("RelSuspect", "COP", Relationship.Hate);

            Suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect1.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect2.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect3.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect4.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect5.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect6.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);
            Suspect7.Inventory.GiveNewWeapon("WEAPON_PISTOL", 9999, true);

Sorry for the hard coding, i should have made lists.

It would be nice if you could help me.

Thanks for reading,

- Kolopsel

Edited by Kolopsel
Link to comment
Share on other sites

6 hours ago, Kolopsel said:

And what about my question ?

what I did for a callout I created(this works):

public Ped A1;
...
  
public override bool OnCalloutAccepted()
{
  A1.RelationshipGroup = "RED";
  Game.LocalPlayer.Character.RelationshipGroup = "BLUE";
  
  Game.SetRelationshipBetweenRelationshipGroups("BLUE", "RED", Relationship.Hate);
  Game.SetRelationshipBetweenRelationshipGroups("RED", "BLUE", Relationship.Hate);
  
  A1.Tasks.FightAgainstClosestHatedTarget(1000f);
  //From what you have written above, I think you have forgoten A1.Tasks.FightAgainstClosestHatedTarget(1000f); so the Ped fights against his closest hated target.
  //you could also give the peds weapons and make them fight with the NativeFunction.CallByName<uint>("TASK_COMBAT_PED", A1, WhoYouWantToBeTargeted, 0, 1)
}  

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...