Jump to content
Fiskey111

Peds fighting each other!

Recommended Posts

So I'm getting close to finishing the basics of my callout.  I want my peds to shoot at the officer only, not each other, however one always ends up killing the other which ruins the point of having 2 peds.  Anyway to stop this?  I tried to focus them on the cop but apparently it isn't working (see attached code).

Be aware I am VERY new to coding and am mostly fooling around.

Thanks!

 

CalloutHelp1.jpg

Share this post


Link to post
Share on other sites

Set a relationship group between the peds and the officers.

Coming from my code:
 

 //Put our gunmen in a relationship group
            gunman1.RelationshipGroup = "Gunmen";
            gunman2.RelationshipGroup = "Gunmen";
            gunman3.RelationshipGroup = "Gunmen";
            //Relationship with gunmen to cops/player
            Game.SetRelationshipBetweenRelationshipGroups("Gunmen", "COP", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("Gunmen", "PLAYER", Relationship.Hate);

(Thanks to Luigi4518 for this)

Edited by tanu1215

Share this post


Link to post
Share on other sites
27 minutes ago, tanu1215 said:

Set a relationship group between the peds and the officers.

Coming from my code:
 


 //Put our gunmen in a relationship group
            gunman1.RelationshipGroup = "Gunmen";
            gunman2.RelationshipGroup = "Gunmen";
            gunman3.RelationshipGroup = "Gunmen";
            //Relationship with gunmen to cops/player
            Game.SetRelationshipBetweenRelationshipGroups("Gunmen", "COP", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("Gunmen", "PLAYER", Relationship.Hate);

(Thanks to Luigi4518 for this)

Thank you thank you thank you!!! I literally could not get this to work before this!  You're the best!

Share this post


Link to post
Share on other sites
2 minutes ago, fiskey111 said:

Thank you thank you thank you!!! I literally could not get this to work before this!  You're the best!

No problem. Again, Luigi4518 helped me when I had a similar problem, so it's best to thank him :thumbsup:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×