Log in to reply
 

How to change peds relationShip ?



  • i have started programming in csharp a while , and im stuck at a script . i want to change the relation ship of my ped to like me so he won't kiil me while im shooting at someone . Can someone please explain it in a way that i could understand ? Tnx very much i appreciate it and good day.



  • @avivr

    PedGroup PlayerGroup = Game.Player.Character.PedGroup;
    Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, CurrentPed, PlayerGroup);



  • @JohnFromGWN yes , but how do i make him : hate , companion , like , pedestrian ? because i need 2 of them and i want to know how to use it so if you know pls help





  • @JohnFromGWN bro still not working for me im really dont know what im doing worng



  • @avivr post your code.



  • yourPed.RelationshipGroup.SetRelationshipBetweenGroups(Game.Player.Character.RelationshipGroup, Relationship.Companion);
    

    Replace yourPed with the variable of the ped you want a good relationship with. Replace Relationship.Companion with the relationship you want.



  • @avivr
    There are groups and there are relationship groups. A group is limited to 7 members (companions). AFAIK, relationship groups are unlimited.

    If you just want a ped to like you, you can create a companion.
    Ped Mila = World.CreatePed("Mila", Game.Player.Character.Position + Game.Player.Character.ForwardVector * 3.0f, Game.Player.Character.Heading + 90);
    PedGroup PlayerGroup = Game.Player.Character.PedGroup;
    Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Mila, PlayerGroup);

    If you want your ped as part of a relationship group, as per the post from @Jitnaught :
    Ped Mila = World.CreatePed("Mila", Game.Player.Character.Position + Game.Player.Character.ForwardVector * 3.0f, Game.Player.Character.Heading + 90);
    Mila.RelationshipGroup.SetRelationshipBetweenGroups(Game.Player.Character.RelationshipGroup, Relationship.Companion); //Companion
    OR
    Mila.RelationshipGroup.SetRelationshipBetweenGroups(Game.Player.Character.RelationshipGroup, Relationship.Hate); //Hate
    OR
    Mila.RelationshipGroup.SetRelationshipBetweenGroups(Game.Player.Character.RelationshipGroup, Relationship.Respect); //Respect

    (Companion, Respect, Like, Neutral, Dislike, Hate, Pedestrians)

    There are many relationship groups besides the one for the player. For example: PLAYER, CIVMALE, CIVFEMALE, COP, GANG_1, GANG_2, AMBIENT_GANG_MEXICAN)

    https://pastebin.com/GaihypFC



  • @Jitnaught i don't have Mila.RelationshipGroup.SetRelationshipBetweenGroups() , you know why ?

    Edit : Nvm , tnx i got it i found another solution for my problem ! tnx for your help



  • @avivr yes, he knows why.
    Mila is the name of the ped spawned in the example.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.