Jump to content

RelationshipGroup


epicmrjuan

Recommended Posts

Did you check the example projects from RPH? You can download them here: http://ragepluginhook.net/Downloads.aspx?Category=2

This is the example about relationships, the comments in there explain how it works:

Spoiler

// Required attribute to provide the hook with information about this plugin.
[assembly: Rage.Attributes.Plugin("RAGE Plugin Hook Example: Relationship Groups", Author = "MulleDK19 / LMS", Description = "An example of using relationship groups.")]

namespace RelationshipGroups
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using Rage;

    internal static class EntryPoint
    {
        /// <summary>
        /// Defines the entry point of the plugin.
        /// </summary>
        private static void Main()
        {
            // Create 3 peds.
            Ped blue = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront * 5f));
            Ped red = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeBack * 5f));
            Ped neutral = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeRight * +5f));

            // Assign each one to separate relationship groups.
            blue.RelationshipGroup = "BLUE";
            red.RelationshipGroup = "RED";
            neutral.RelationshipGroup = "NEUTRAL";

            // Mark them on the map for convenience.
            blue.AttachBlip().Color = System.Drawing.Color.Blue;
            red.AttachBlip().Color = System.Drawing.Color.Red;
            neutral.AttachBlip().Color = System.Drawing.Color.White;

            // Set their relationships. BLUE and RED hate each other, and respect NEUTRAL. NEUTRAL respect both BLUE and RED.
            Game.SetRelationshipBetweenRelationshipGroups("BLUE", "RED", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("RED", "BLUE", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("BLUE", "NEUTRAL", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("RED", "NEUTRAL", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("NEUTRAL", "BLUE", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("NEUTRAL", "RED", Relationship.Respect);

            // Make blue and neutral go to red.
            blue.Tasks.GotoOffsetFromEntity(red, -1, 5f, 0f, 3f);
            neutral.Tasks.GotoOffsetFromEntity(red, -1, 5f, 90f, 3f);

            // Wait 15 seconds.
            GameFiber.Wait(15000);

            // Add neutral to RED.
            neutral.RelationshipGroup = "RED";

            // Wait 15 seconds.
            GameFiber.Wait(15000);

            // Then delete them.
            blue.Delete();
            red.Delete();
            neutral.Delete();
        }
    }
}

 

 

Link to comment
Share on other sites

7 minutes ago, alexguirre said:

Did you check the example projects from RPH? You can download them here: http://ragepluginhook.net/Downloads.aspx?Category=2

This is the example about relationships, the comments in there explain how it works:

  Hide contents


// Required attribute to provide the hook with information about this plugin.
[assembly: Rage.Attributes.Plugin("RAGE Plugin Hook Example: Relationship Groups", Author = "MulleDK19 / LMS", Description = "An example of using relationship groups.")]

namespace RelationshipGroups
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using Rage;

    internal static class EntryPoint
    {
        /// <summary>
        /// Defines the entry point of the plugin.
        /// </summary>
        private static void Main()
        {
            // Create 3 peds.
            Ped blue = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeFront * 5f));
            Ped red = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeBack * 5f));
            Ped neutral = new Ped(Game.LocalPlayer.Character.GetOffsetPosition(Vector3.RelativeRight * +5f));

            // Assign each one to separate relationship groups.
            blue.RelationshipGroup = "BLUE";
            red.RelationshipGroup = "RED";
            neutral.RelationshipGroup = "NEUTRAL";

            // Mark them on the map for convenience.
            blue.AttachBlip().Color = System.Drawing.Color.Blue;
            red.AttachBlip().Color = System.Drawing.Color.Red;
            neutral.AttachBlip().Color = System.Drawing.Color.White;

            // Set their relationships. BLUE and RED hate each other, and respect NEUTRAL. NEUTRAL respect both BLUE and RED.
            Game.SetRelationshipBetweenRelationshipGroups("BLUE", "RED", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("RED", "BLUE", Relationship.Hate);
            Game.SetRelationshipBetweenRelationshipGroups("BLUE", "NEUTRAL", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("RED", "NEUTRAL", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("NEUTRAL", "BLUE", Relationship.Respect);
            Game.SetRelationshipBetweenRelationshipGroups("NEUTRAL", "RED", Relationship.Respect);

            // Make blue and neutral go to red.
            blue.Tasks.GotoOffsetFromEntity(red, -1, 5f, 0f, 3f);
            neutral.Tasks.GotoOffsetFromEntity(red, -1, 5f, 90f, 3f);

            // Wait 15 seconds.
            GameFiber.Wait(15000);

            // Add neutral to RED.
            neutral.RelationshipGroup = "RED";

            // Wait 15 seconds.
            GameFiber.Wait(15000);

            // Then delete them.
            blue.Delete();
            red.Delete();
            neutral.Delete();
        }
    }
}

 

 

Thank you, no i didn't looked at the examples

Thank you

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...