Advertisement
mja00

Prompts - RedM

Nov 18th, 2019
1,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.80 KB | None | 0 0
  1. -- Initial Setup of Prompts
  2. -- All of these must be called only ONCE
  3. local str = CreateVarString(10, "LITERAL_STRING", text) -- Set text to what you want on the prompt
  4. prompt = CreatePrompt(keyHash, str, 6, 1, 1, -1) -- the 3 & 6th param must be 6 and -1 respectively otherwise prompt breaks
  5. PromptSetEnabled(prompt, false)
  6. PromptSetVisible(prompt, false)
  7.  
  8. -- Displaying prompt
  9. -- These are called ONCE. Set them to false again to remove the prompt. If not set to false and the resource is restarted the prompts are then stuck on the screen.
  10. PromptSetEnabled(prompt, true)
  11. PromptSetVisible(prompt, true)
  12.  
  13. -- Prompt Modifiers
  14. -- These modify how the button should be pressed. These go into the initial setup and the first param is always the prompt variable.
  15.  
  16. -- Finite button mash
  17. -- iParam17 is how many times you want the button mashed
  18. Citizen.InvokeNative(0xDF6423BF071C7F71, prompt, iParam17)
  19.  
  20. -- Set mash but auto fill
  21. -- Seems to not work as the name suggests?
  22. -- iParam16 must be a float for it to work but it doesn't seem to affect anything
  23. -- iParam17 is how many times button must be pressed
  24. Citizen.InvokeNative(0x6C39587D7CC66801, prompt, iParam16, iParam17)
  25.  
  26. -- Mash indefinitely
  27. -- Just takes the prompt variable. Does as name suggests
  28. Citizen.InvokeNative(0x7B66E89312727274, prompt)
  29.  
  30. -- Set target mode
  31. -- No fucking clue
  32. Citizen.InvokeNative(0x5F6503D9CD2754EB, prompt, 0.6, 0.5, 1)
  33.  
  34. -- Mash with resistance
  35. -- iParam17 how many times to press button without resistance. Must be int
  36. -- iParam18 how "fast" the resistance is. Float
  37. -- iParam19 starting position for the prompt. Between 0.0 and 1.0. 0.0 being completely empty and 1.0 being already full. Float
  38. Citizen.InvokeNative(0xCD1BDFF15EFA79F5, prompt, iParam17, iParam18, iParam19)
  39.  
  40. -- Standardized hold mode
  41. -- iParam24 being how long to hold it for, not in seconds. Int
  42. Citizen.InvokeNative(0x74C7D7B72ED0D3CF, prompt, iParam24)
  43.  
  44. -- Mash with resistance CAN fail
  45. -- Same variable as mash with resistance but if the prompt runs out it turns red and the button can no longer be hit
  46. Citizen.InvokeNative(0xDC0CB602DEADBA53, prompt, iParam17, iParam18, iParam19)
  47.  
  48. -- Make prompt rotate prompt
  49. -- Only usable with controllers
  50. -- iParam20 is how much to rotate
  51. -- iParam21 is bool and dictates if rotation should be CCW
  52. Citizen.InvokeNative(0x7ABE7095FB3D2581, prompt, iParam20, iParam21)
  53.  
  54. -- The original file that these were retrieved from was https://pastebin.com/Ty4snZEe
  55. -- I just simply threw them ingame and testing what each needed to work and what they did.
  56. -- There's probably a few I missed or just didn't notice. I'm being lazy tbh. Fuck it
  57.  
  58. -- Update 11/18/19 later in day.
  59. -- Figured out how to actually handle the prompts being completed/progress of the prompts.
  60.  
  61. -- To get the current progress of a mash MODE prompt. ONLY WORKS ON MASH DOES NOT WORK ON HOLD
  62. print(Citizen.InvokeNative(0x8A9585293863B8A5, prompt, Citizen.ResultAsFloat()))
  63. -- This returns a value from 0.0 to 1.0, pretty much a percent on how complete the prompt is.
  64.  
  65. -- Checks to see if the specified MASH mode prompt completes. Must be a mash prompt.
  66. Citizen.InvokeNative(0x845CE958416DC473, prompt) -- Will return false when not on screen/not completed. Returns 1 when completed
  67. -- Also a native to check to see if the MASH mode prompt fails.
  68. Citizen.InvokeNative(0x25B18E530CF39D6F, prompt) -- Also returns false and 1.
  69.  
  70. -- Checks to see if HOLD mode prompt is completed
  71. Citizen.InvokeNative(0xE0F65F0640EF0617, prompt)
  72.  
  73. -- Checks to see if STANDARD mode prompt is complete, triggers very quickly and then resets.
  74. -- The second param must be false for it to work. Unknown what 2nd param does.
  75. -- The prompt must also be set as a standard prompt by doing Citizen.InvokeNative(0xCC6656799977741B, prompt, 0)
  76. Citizen.InvokeNative(0xC92AC953F0A982AE, prompt, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement