icdb

[PD2] Rats / Cook Off / Mex ingredient teller

Apr 27th, 2015
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. #if not DialogManager then return end
  2.  
  3. if not ingredient then
  4.  
  5.     local ingredient_dialog = {}
  6.     ingredient_dialog["pln_rt1_20"] = "Muriatic Acid"
  7.     ingredient_dialog["pln_rt1_22"] = "Caustic Soda"
  8.     ingredient_dialog["pln_rt1_24"] = "Hydrogenchlorid"
  9.     ingredient_dialog["pln_rat_stage1_20"] = "Muriatic Acid"
  10.     ingredient_dialog["pln_rat_stage1_22"] = "Caustic Soda"
  11.     ingredient_dialog["pln_rat_stage1_24"] = "Hydrogenchlorid"
  12.     ingredient_dialog["pln_rat_stage1_28"] = "Bag done"
  13.     ingredient_dialog["Play_loc_mex_cook_03"] = "Muriatic Acid"
  14.     ingredient_dialog["Play_loc_mex_cook_04"] = "Caustic Soda"
  15.     ingredient_dialog["Play_loc_mex_cook_05"] = "Hydrogenchlorid"
  16.     ingredient_dialog["Play_loc_mex_cook_17"] = "Bag done"
  17.  
  18.     local _queue_dialog_orig = DialogManager.queue_dialog
  19.     function DialogManager:queue_dialog(id, ...)
  20.         if ingredient_dialog[id] then
  21.             if not ingredient_online_toggle then
  22.                 managers.chat:feed_system_message(ChatManager.GAME, "Add: " .. ingredient_dialog[id])
  23.             else
  24.                 managers.chat:send_message(ChatManager.GAME, managers.network.account:username() or "Offline", "Add: " .. ingredient_dialog[id])
  25.             end
  26.         end
  27.         return _queue_dialog_orig(self, id, ...)
  28.     end
  29.    
  30.     ingredient = true
  31.     managers.hud:show_hint( { text = "ingredient teller loaded" } )
  32.  
  33. else
  34.     if not ingredient_online_toggle then
  35.         managers.hud:show_hint( { text = "ingredient teller public" } )
  36.         ingredient_online_toggle = true
  37.     else
  38.         managers.hud:show_hint( { text = "ingredient teller local" } )
  39.         ingredient_online_toggle = false
  40.     end
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment