KMM
Members-
Posts
11 -
Joined
-
Last visited
Personal Information
-
Country
United States
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
KMM's Achievements
Feller (1/10)
0
Reputation
-
Hi, I've updated my code to the following but I'm still not having any luck. The prompt appears correctly but I am unable to trigger a script once a button is pressed. I've also tried using _UIPROMPT_IS_VALID for testing purposes and it returns false. namespace RDR2Mod { using System; using System.Windows.Forms; using Rage; internal static class RDR2Mod { // These variables are shared between all functions! static int prompt; static Entity target; public static void Start() { // Announce us to the world :) Game.DisplayHelp("RDR2Mod Loaded."); } public static void Process() { if (Game.CallNative<bool>((ulong)Natives.HUD._UIPROMPT_IS_ACTIVE, prompt)) { if (Rage.Game.CallNative<bool>((ulong)Natives.HUD._UIPROMPT_HAS_STANDARD_MODE_COMPLETED, prompt)) { Game.DisplayHelp("ACTIVE PROMPT"); } } if (Game.CallNative<bool>((ulong)Natives.PLAYER.IS_PLAYER_TARGETTING_ANYTHING, Game.LocalPlayer)) { if (Rage.Game.LocalPlayer.Target == target) { togglePrompt(prompt, true); } } else { if (Game.LocalPlayer.IsFreeAimingAtAnyEntity) { if (TempApi.WasKeyJustPressed(Keys.G)) { target = Rage.Game.LocalPlayer.FreeAimingTarget; Game.DisplayHelp(Rage.Game.CallNative<ulong>((ulong)Natives.HUD._UIPROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY, target).ToString()); Game.CallNative((ulong)Natives.HUD._UIPROMPT_DELETE, prompt); registerPrompt(prompt, "INPUT_SPRINT", "TEST", false, true, target); } } } } public static void End() { // You would free any resources here when the plugin is being unloaded. } public static void registerPrompt(int prompt, string input, string name, bool toggle, bool addToGroup, Entity entity) { prompt = Rage.Game.CallNative<int>((ulong)Natives.HUD._UIPROMPT_REGISTER_BEGIN); ulong inputHash = Rage.Game.CallNative<ulong>((ulong)Natives.MISC.GET_HASH_KEY, input); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_CONTROL_ACTION, prompt, inputHash); long promptText = Game.CallNative<long>((ulong)Natives.MISC._CREATE_VAR_STRING, 10, "LITERAL_STRING", name); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_TEXT, prompt, promptText); //Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_HOLD_MODE, prompt, 1); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_PRIORITY, prompt, 1); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_TRANSPORT_MODE, prompt, 1); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_ATTRIBUTE, prompt, 18, 1); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_STANDARD_MODE, prompt, 1); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_REGISTER_END, prompt); togglePrompt(prompt, true); if (addToGroup) { ulong group = Rage.Game.CallNative<ulong>((ulong)Natives.HUD._UIPROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY, entity); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_GROUP, prompt, group, 0); } } public static void togglePrompt(int prompt, bool enable) { Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_VISIBLE, prompt, enable); Rage.Game.CallNative((ulong)Natives.HUD._UIPROMPT_SET_ENABLED, prompt, enable); } } }
-
@LMS Thank you for your help! This worked perfectly! How would I run a script once the prompt has been activated? For example, after holding the "INPUT_SPRINT" key run a particular function in the script. I have tried using _UIPROMPT_HAS_HOLD_MODE_COMPLETED but have had no luck.
-
Hi, I'm trying the following code but cannot get a prompt to appear. For testing purposes, I have the script setup to assign a prompt to the player free aiming entity target, after hitting the "G" key, so that the next time the entity is targeted the prompt should appear. namespace RDR2Mod { using System; using System.Windows.Forms; using Rage; internal static class RDR2Mod { // These variables are shared between all functions! static int prompt; static Entity target; public static void Start() { // Announce us to the world :) Game.DisplayHelp("RDR2Mod Loaded."); } public static void Process() { if (Game.CallNative<bool>((ulong)natives.PLAYER.IS_PLAYER_TARGETTING_ANYTHING, Game.LocalPlayer)) { if (Rage.Game.LocalPlayer.Target == target) { togglePrompt(prompt, true); } } else { if (Game.LocalPlayer.IsFreeAimingAtAnyEntity) { if (TempApi.WasKeyJustPressed(Keys.G)) { target = Rage.Game.LocalPlayer.FreeAimingTarget; registerPrompt(prompt, "INPUT_SPRINT", "TEST", false, true, target); } } } } public static void End() { // You would free any resources here when the plugin is being unloaded. } public static void registerPrompt(int prompt, string input, string name, bool toggle, bool addToGroup, Entity entity) { prompt = Rage.Game.CallNative<int>((ulong)natives.HUD._UIPROMPT_REGISTER_BEGIN); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_CONTROL_ACTION, prompt, natives.INPUTS.INPUT_SPRINT); string promptText = Game.CallNative<string>((ulong)natives.MISC._CREATE_VAR_STRING, 10, "LITERAL_STRING", name); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_TEXT, prompt, promptText); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_HOLD_MODE, prompt, 1); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_PRIORITY, prompt, 1); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_TRANSPORT_MODE, prompt, 1); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_ATTRIBUTE, prompt, 18, 1); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_STANDARD_MODE, prompt, 1); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_REGISTER_END, prompt); togglePrompt(prompt, true); if (addToGroup) { ulong group = Rage.Game.CallNative<ulong>((ulong)natives.HUD._UIPROMPT_GET_GROUP_ID_FOR_TARGET_ENTITY, entity); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_GROUP, prompt, group, 0); } } public static void togglePrompt(int prompt, bool enable) { Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_VISIBLE, prompt, enable); Rage.Game.CallNative((ulong)natives.HUD._UIPROMPT_SET_ENABLED, prompt, enable); } } }
-
How would you do this with Rage Plugin Hook? I'm trying to learn how to create prompts.
-
KMM started following Is there a way to check if a mission has been completed in RagePluginHook? , How to assign Menu Prompt to Object in Rage Plugin? , Door Hashes and 1 other
-
Hi all, I'm trying to create and assign a menu prompt to a Object in a Rage plugin using the following code: ulong menuprompt = Game.CallNative<ulong>(0x04F97DE45A519419); //Register Prompt Game.CallNative(0x5DD02A8318420DD7, menuprompt, "TEST MENU"); //Set Text Game.CallNative(0xB5352B7494A08258, menuprompt, Game.GetHashKey("INPUT_FRONTEND_LS")); //Set Control Action Game.CallNative(0xEA5CCF4EEB2F82D1, menuprompt); //Set Hold Indefintely mode Game.CallNative(0x2F11D3A254169EA4, menuprompt, 806749976, 0); //Assign Prompt to Entity Group Game.CallNative(0x315C81D760609108, menuprompt, 806749976); //Assign Prompt to Ambient Entity Group Game.CallNative(0xF7AA2696A22AD8B9, menuprompt); //Prompt Register End Game.CallNative(0x8A0FB4D03A630D21, menuprompt, true); //Set Enabled Game.CallNative(0x71215ACCFDE075EE, menuprompt, true); //Set Visible Group ID = 806749976. I'm not having any luck at this point. Any ideas?
-
@LMS How do I register doors? I have tried the following while making a rage plugin: Game.CallNative("_ADD_DOOR_TO_SYSTEM_NEW", "1716899875"); but the plugin just crashes.
-
@LMS Thank you! This was just what I was looking for. I have tried using the following code in my Rage Plugin to unlock some doors but it isn't working for me. Game.CallNative("DOOR_SYSTEM_SET_DOOR_STATE", 1716899875, 0); Do you know what I am doing wrong?
-
How do you get door hashes? I would like to unlock some doors and I am interested in the procedure to get them. I seen in another section that you can get door hashes by reading the game memory. If so, what software is required and what are the steps to do so?
-
What software do you use to read the game memory?
-
KMM joined the community
-
I want to unlock bank doors but do not know how to get the hashes for the doors. Is there any tool available to view hashes of objects?