Advertisement
Eddlm

Cheap queued help text

Feb 11th, 2018
263
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         List<string> Messages = new List<string>();
  2.         void HandleQueuedHelp() //ontick
  3.         {
  4.             if (Messages.Count > 0)
  5.             {
  6.                 if (!Function.Call<bool>(Hash.IS_HELP_MESSAGE_BEING_DISPLAYED))
  7.                 {
  8.                     DisplayHelpTextThisFrame(Messages[0]);
  9.  
  10.                     Messages.RemoveAt(0);
  11.                 }
  12.             }
  13.         }
  14.         void DisplayHelpTextThisFrame(string text)
  15.         {
  16.             Function.Call(Hash._SET_TEXT_COMPONENT_FORMAT, "STRING");
  17.             Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text);
  18.             Function.Call(Hash._DISPLAY_HELP_TEXT_FROM_STRING_LABEL, 0, false, false, -1);
  19.         }
  20.  
  21.  
  22.  
  23. //Usage: Messages.Add("text") whenever needed.
Advertisement
RAW Paste Data Copied
Advertisement