Kain2030

Auto Carry Plugin - Teemo Edition - v1.05e

Aug 3rd, 2013
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.95 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Teemo Edition
  4.         Author: Kain
  5.         Version: 1.05e
  6.         Copyright 2013
  7.  
  8.         Dependency: Sida's Auto Carry: Revamped
  9.  
  10.         How to install:
  11.             Make sure you already have AutoCarry installed.
  12.             Name the script EXACTLY "SidasAutoCarryPlugin - Teemo.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Features:
  16.             Shroom Bomb
  17.             Escape Wizard
  18.             Shroom Placement Helper for Summoner's Rift
  19.             Range Circle
  20.  
  21.         History:
  22.             Version: 1.05e: http://pastebin.com/9CXgfxeD
  23.                 Fixed "Blinding Dart" range to 680.
  24.                 Fixed "Shroom Bomb" not firing.
  25.                 Added on screen text to indicate when "Shroom Bomb" occurs.
  26.                 Made improvements to target detection. Will not shoot at Kog'maw passive, Karthus, etc.
  27.                 Fixed issue with Q not working sometimes.
  28.             Version: 1.04: http://pastebin.com/EjLX4Vrq
  29.                 Added support for more items.
  30.             Version: 1.03: http://pastebin.com/GGWEjni1
  31.                 Fixed shrooms snapping/magnetism. Added toggle for this.
  32.                 Added more ranges; changed colors.
  33.                 Added experimental flash during escape toggle option. Off by default.
  34.  
  35.             Version: 1.02: http://pastebin.com/uJ2p7aaQ
  36.                 Random Fixes
  37. --]]
  38.  
  39. if myHero.charName ~= "Teemo" then return end
  40.  
  41. local Target
  42. local EscapeHotkey = string.byte("T")
  43.  
  44. -- Prediction
  45. local QRange = 680
  46. local RRange = 230
  47.  
  48. local SkillQ = {spellKey = _Q, range = QRange, speed = 2, delay = 0, width = 200, configName = "blindingDart", displayName = "Q (Blinding Dart)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  49. local SkillW = {spellKey = _W, range = 0, speed = 2, delay = 0}
  50. local SkillR = {spellKey = _R, range = RRange, speed = 2, delay = 0}
  51.  
  52. local DFGSlot, HXGSlot, BWCSlot, BRKSlot, FlashSlot = nil, nil, nil, nil, nil
  53. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, BRKReady, FlashReady = false, false, false, false, false, false, false, false, false
  54.  
  55. AutoCarry.PluginMenu:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  56. AutoCarry.PluginMenu:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  57. AutoCarry.PluginMenu:addParam("Escape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  58. AutoCarry.PluginMenu:addParam("EscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  59. AutoCarry.PluginMenu:addParam("Ultimate", "Use Shroom Bomb with combo", SCRIPT_PARAM_ONOFF, true)
  60. AutoCarry.PluginMenu:addParam("DrawShrooms", "Shroom Placement Helper", SCRIPT_PARAM_ONOFF, true)
  61. AutoCarry.PluginMenu:addParam("SnapShrooms", "Snap Shrooms into place", SCRIPT_PARAM_ONOFF, true)
  62. AutoCarry.PluginMenu:addParam("AutoShroomsHigh", "Auto-shroom high priority locations", SCRIPT_PARAM_ONOFF, true)
  63. AutoCarry.PluginMenu:addParam("Draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  64.  
  65. -- Shrooms Config
  66. local highEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable High Priority Mushrooms
  67. local medEnabled      = AutoCarry.PluginMenu.DrawShrooms -- Enable Medium Priority Mushrooms
  68. local lowEnabled      = AutoCarry.PluginMenu.DrawShrooms -- Enable Low Priority Mushrooms
  69. local blueEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable Blue Team Mushrooms (in and around blue jungle)
  70. local purpEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable Purple Team Mushrooms (in and around purple jungle)
  71.  
  72. local showLocationsInRange = 3000 -- When you press R, locations in this range will be shown
  73. local showClose = true -- Show shroom locations that are close to you
  74. local showCloseRange = 800
  75.  
  76. local FlashSlot = nil
  77.  
  78. -- Main
  79. function PluginOnLoad()
  80.     InitializeShrooms()
  81. end
  82.  
  83. function PluginOnTick()
  84.     Target = AutoCarry.GetAttackTarget()
  85.  
  86.     SpellCheck()
  87.  
  88.     if AutoCarry.PluginMenu.Combo then
  89.         Combo()
  90.     end
  91.  
  92.     if AutoCarry.PluginMenu.Harass then
  93.         Harass()
  94.     end
  95.  
  96.     if AutoCarry.PluginMenu.Escape then
  97.         EscapeCombo()
  98.     end
  99.  
  100.     -- Shrooms
  101.     PlaceAutoShrooms()
  102. end
  103.  
  104. function Combo()
  105.     if Target ~= nil and not Target.dead then
  106.         CastSlots()
  107.  
  108.         if QReady and GetDistance(Target) < QRange then
  109.             if not AutoCarry.GetCollision(SkillQ, myHero, Target) then
  110.                 CastSpell(SkillQ.spellKey, Target)
  111.             end
  112.         end
  113.  
  114.         -- Shroom under enemy
  115.         if AutoCarry.PluginMenu.Ultimate and RReady and GetDistance(Target) < RRange then
  116.             if not shroomExists(shroomSpot) then
  117.                 Message.AddMessage("Shroom Bomb!", ColorARGB.Green, myHero)
  118.                 AutoCarry.CastSkillshot(SkillR, Target)
  119.             end
  120.         end
  121.     end
  122. end
  123.  
  124. function EscapeCombo()
  125.     if WReady then
  126.         AutoCarry.CastSpell(SkillW.spellKey)
  127.     end
  128.  
  129.     if RReady then
  130.         CastSpell(SkillR.spellKey, myHero.x, myHero.z)
  131.     end
  132.  
  133.     if AutoCarry.PluginMenu.EscapeFlash and FlashSlot ~= nil and FlashReady and GetDistance(mousePos) > 300 then
  134.         CastSpell(FlashSlot, mousePos.x, mousePos.z)
  135.     end
  136.  
  137.     if AutoCarry.PluginMenu.EscapeFlash then
  138.         myHero:MoveTo(mousePos.x, mousePos.z)
  139.     end
  140. end
  141.  
  142. function Harass()
  143.     if Target ~= nil and not Target.dead then
  144.         if QReady and GetDistance(Target) < QRange then
  145.             CastSpell(SkillQ.spellKey, Target)
  146.             myHero:Attack(Target)
  147.         end
  148.     end
  149. end
  150.  
  151. function SpellCheck()
  152.     DFGSlot, HXGSlot, BWCSlot, BRKSlot = GetInventorySlotItem(3128),
  153.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3153)
  154.  
  155.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  156.         FlashSlot = SUMMONER_1
  157.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  158.         FlashSlot = SUMMONER_2
  159.     end
  160.  
  161.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  162.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  163.     EReady = (myHero:CanUseSpell(_E) == READY)
  164.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  165.  
  166.     DFGReady   = (DFGSlot   ~= nil and myHero:CanUseSpell(DFGSlot)   == READY)
  167.     HXGReady   = (HXGSlot   ~= nil and myHero:CanUseSpell(HXGSlot)   == READY)
  168.     BWCReady   = (BWCSlot   ~= nil and myHero:CanUseSpell(BWCSlot)   == READY)
  169.     BRKReady   = (BRKSlot   ~= nil and myHero:CanUseSpell(BRKSlot)   == READY)
  170.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  171. end
  172.  
  173. function CastSlots()
  174.     if Target ~= nil and not Target.dead then
  175.         if GetDistance(Target) <= QRange then
  176.             if DFGReady then CastSpell(DFGSlot, Target) end
  177.             if HXGReady then CastSpell(HXGSlot, Target) end
  178.             if BWCReady then CastSpell(BWCSlot, Target) end
  179.             if BRKReady then CastSpell(BRKSlot, Target) end
  180.         end
  181.     end
  182. end
  183.  
  184. function PlaceAutoShrooms()
  185.     for i,group in pairs(shroomSpots) do
  186.         for x, shroomSpot in pairs(group.Locations) do
  187.             if group.Enabled and group.Auto and GetDistance(shroomSpot) <= 250 and not shroomExists(shroomSpot) then
  188.                 CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  189.             end
  190.         end
  191.     end
  192. end
  193.  
  194. function PluginOnDraw()
  195.     -- Draw Ranges
  196.     if AutoCarry.PluginMenu.Draw then
  197.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  198.  
  199.         if QReady then
  200.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  201.         end
  202.  
  203.         if RReady then
  204.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  205.         end
  206.     end
  207.  
  208.     -- Draw Shrooms
  209.         if (AutoCarry.PluginMenu.DrawShrooms) then
  210.         for i,group in pairs(shroomSpots) do
  211.             if group.Enabled == true then
  212.                 if drawShroomSpots then
  213.                     for x, shroomSpot in pairs(group.Locations) do
  214.                         if GetDistance(shroomSpot) < showLocationsInRange then
  215.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  216.                                 shroomColour = 0xFFFFFF
  217.                             else
  218.                                 shroomColour = group.Colour
  219.                             end
  220.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  221.                         end
  222.                     end
  223.                 elseif showClose then
  224.                     for x, shroomSpot in pairs(group.Locations) do
  225.                         if GetDistance(shroomSpot) <= showCloseRange then
  226.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  227.                                 shroomColour = 0xFFFFFF
  228.                             else
  229.                                 shroomColour = group.Colour
  230.                             end
  231.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  232.                         end
  233.                     end
  234.                 end
  235.             end
  236.         end
  237.     end
  238. end
  239.  
  240. -- Shrooms Main
  241. function InitializeShrooms()
  242.     red, yellow, green, blue, purple = 0x990000, 0x993300, 0x00FF00, 0x000099, 0x660066
  243.  
  244.     shroomSpots = {
  245.         -- High priority for both sides
  246.         HighPriority =  {
  247.                             Locations = {
  248.                                             { x = 3316.20,  y = -74.06, z = 9334.85},
  249.                                             { x = 4288.76,  y = -71.71, z = 9902.76},
  250.                                             { x = 3981.86,  y = 39.54,  z = 11603.55},
  251.                                             { x = 6435.51,  y = 47.51,  z = 9076.02},
  252.                                             { x = 9577.91,  y = 45.97,  z = 6634.53},
  253.                                             { x = 7635.25,  y = 45.09,  z = 5126.81},
  254.                                             { x = 10731.51, y = -30.77, z = 5287.01},
  255.                                             { x = 9662.24,  y = -70.79, z = 4536.15},
  256.                                             { x = 10080.45, y = 44.48,  z = 2829.56}  
  257.                                         },
  258.                             Colour = red,
  259.                             Enabled = highEnabled,
  260.                             Auto = AutoCarry.PluginMenu.AutoShroomsHigh,
  261.                             Snap = false
  262.                         },
  263.     -- Medium priority for both sides
  264.         MediumPriority ={
  265.                             Locations = {
  266.                                             { x = 3283.18,  y = -69.64, z = 10975.15},
  267.                                             { x = 2595.85,  y = -74.00, z = 11044.66},
  268.                                             { x = 2524.10,  y = 23.36,  z = 11912.28},
  269.                                             { x = 4347.64,  y = 43.34,  z = 7796.28},
  270.                                             { x = 6093.20,  y = -67.90, z = 8067.45},
  271.                                             { x = 7960.99,  y = -73.41, z = 6233.09},
  272.                                             { x = 10652.57, y = -58.96, z = 3507.64},
  273.                                             { x = 11460.14, y = -63.94, z = 3544.83},
  274.                                             { x = 11401.81, y = -11.72, z = 2626.61}  
  275.                                         },
  276.                             Colour = yellow,
  277.                             Enabled = medEnabled,
  278.                             Auto = false,
  279.                             Snap = false
  280.                         },
  281.     -- Low priority/situational for both sides
  282.         LowPriority =   {
  283.                             Locations = {
  284.                                             { x = 1346.10,  y = 26.56,  z = 11064.81},
  285.                                             { x = 705.87,   y = 26.93,  z = 11359.88},
  286.                                             { x = 762.80,   y = 26.15,  z = 12210.61},
  287.                                             { x = 1355.53,  y = 24.13,  z = 12936.99},
  288.                                             { x = 1926.92,  y = 25.14,  z = 11567.44},
  289.                                             { x = 1752.22,  y = 24.02,  z = 13176.95},
  290.                                             { x = 2512.96,  y = 21.74,  z = 13524.44},
  291.                                             { x = 3577.42,  y = 25.27,  z = 12429.88},
  292.                                             { x = 5246.01,  y = 30.91,  z = 12508.33},
  293.                                             { x = 5549.60,  y = 42.94,  z = 10917.27},
  294.                                             { x = 6552.56,  y = 47.09,  z = 9688.99},
  295.                                             { x = 5806.41,  y = 46.01,  z = 9918.99},
  296.                                             { x = 7112.27,  y = 46.86,  z = 8443.55},
  297.                                             { x = 4896.10,  y = -72.08, z = 8964.81},
  298.                                             { x = 3096.10,  y = 45.41,  z = 8164.81},
  299.                                             { x = 2390.53,  y = 46.57,  z = 5232.34},
  300.                                             { x = 4358.81,  y = 45.83,  z = 5834.64},
  301.                                             { x = 5746.10,  y = 42.52,  z = 4864.81},
  302.                                             { x = 6307.66,  y = 46.07,  z = 7165.92},
  303.                                             { x = 5443.82,  y = 45.64,  z = 7110.85},
  304.                                             { x = 5153.75,  y = 45.41,  z = 3358.76},
  305.                                             { x = 6876.07,  y = 46.44,  z = 5897.48},
  306.                                             { x = 6881.30,  y = 46.08,  z = 6555.85},
  307.                                             { x = 8555.10,  y = 46.36,  z = 7267.04},
  308.                                             { x = 7946.10,  y = 44.19,  z = 7214.81},
  309.                                             { x = 9088.99,  y = -73.12, z = 5441.11},
  310.                                             { x = 7687.96,  y = 46.12,  z = 5203.08},
  311.                                             { x = 8559.97,  y = 47.97,  z = 3477.87},
  312.                                             { x = 8841.04,  y = 52.28,  z = 1944.09},
  313.                                             { x = 10582.93, y = 43.25,  z = 1707.35},
  314.                                             { x = 11046.10, y = 43.26,  z = 964.81},
  315.                                             { x = 11682.20, y = 43.40,  z = 1061.03},
  316.                                             { x = 12420.51, y = 46.87,  z = 1532.34},
  317.                                             { x = 12819.32, y = 45.74,  z = 1931.32},
  318.                                             { x = 13275.52, y = 45.38,  z = 2873.69},
  319.                                             { x = 11978.71, y = 45.49,  z = 2914.69},
  320.                                             { x = 13379.36, y = 45.37,  z = 3499.62},
  321.                                             { x = 12818.08, y = 45.38,  z = 3625.44},
  322.                                             { x = 10985.17, y = 45.69,  z = 6305.81},
  323.                                             { x = 11580.80, y = 41.26,  z = 9214.09},
  324.                                             { x = 9574.88,  y = 44.40,  z = 8679.65},
  325.                                             { x = 8359.96,  y = 44.37,  z = 9595.58},
  326.                                             { x = 8927.12,  y = 48.17,  z = 11175.70}  
  327.                                         },
  328.                             Colour = green,
  329.                             Enabled = lowEnabled,
  330.                             Auto = false,
  331.                             Snap = false
  332.                         },
  333.     -- blue team areas
  334.         BlueOnly = {
  335.                         Locations = {
  336.                                         { x = 2112.87, y = 43.81, z = 7047.48},
  337.                                         { x = 2646.25, y = 45.84, z = 7545.78},
  338.                                         { x = 1926.95, y = 44.83, z = 9515.71},
  339.                                         { x = 4239.97, y = 44.40, z = 7132.02},
  340.                                         { x = 6149.34, y = 42.51, z = 4481.88},
  341.                                         { x = 6630.28, y = 46.56, z = 2836.88},
  342.                                         { x = 7687.62, y = 45.54, z = 3210.98},
  343.                                         { x = 7050.22, y = 46.46, z = 2351.33}  
  344.                                     },
  345.                         Colour = blue,
  346.                         Enabled = blueEnabled,
  347.                         Auto = false,
  348.                         Snap = false
  349.                     },
  350.     -- purple team areas
  351.         PurpleOnly =    {
  352.                         Locations = {
  353.                                         { x = 7466.52, y = 41.54, z = 11720.22},
  354.                                         { x = 6945.85, y = 43.53, z = 11901.30},
  355.                                         { x = 6636.28, y = 45.03, z = 11079.65},
  356.                                         { x = 7878.53, y = 43.83, z = 10042.65},
  357.                                         { x = 9701.57, y = 45.72, z = 7298.22},
  358.                                         { x = 11358.86, y = 45.71, z = 6872.10},
  359.                                         { x = 11946.10, y = 45.80, z = 7414.81},
  360.                                         { x = 12169.52, y = 44.03, z = 4858.85}  
  361.                                     },
  362.                         Colour = purple,
  363.                         Enabled = purpEnabled,
  364.                         Auto = false,
  365.                         Snap = false
  366.                     }
  367.     }
  368. end
  369.  
  370. drawShroomSpots = false
  371.  
  372. function shroomExists(shroomSpot)
  373.     for i=1, objManager.maxObjects do
  374.     local obj = objManager:getObject(i)
  375.         if obj ~= nil and obj.name:find("Noxious Trap") then
  376.             if GetDistance(obj) <= 260 then
  377.                 return true
  378.             end
  379.         end
  380.     end
  381.     return false
  382. end
  383.  
  384. function PluginOnWndMsg(msg,key)
  385.     if msg == KEY_DOWN and key == string.byte("R") then
  386.         if player:CanUseSpell(SkillR.spellKey) == READY then
  387.             drawShroomSpots = true
  388.         end
  389.     elseif msg == WM_LBUTTONDOWN and drawShroomSpots then
  390.         for i,group in pairs(shroomSpots) do
  391.             for x, shroomSpot in pairs(group.Locations) do
  392.                 if group.Snap or AutoCarry.PluginMenu.SnapShrooms then
  393.                     if GetDistance(shroomSpot, mousePos) <= 250 then
  394.                         CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  395.                     end
  396.                 end
  397.             end
  398.         end
  399.     elseif msg == WM_RBUTTONDOWN and drawShroomSpots then
  400.         drawShroomSpots = false
  401.     end
  402. end
  403.  
  404. function drawShroomCircles(x,y,z,colour)
  405.     DrawCircle(x, y, z, 28, colour)
  406.     DrawCircle(x, y, z, 29, colour)
  407.     DrawCircle(x, y, z, 30, colour)
  408.     DrawCircle(x, y, z, 31, colour)
  409.     DrawCircle(x, y, z, 32, colour)
  410.     DrawCircle(x, y, z, 250, colour)
  411.     if colour == red or colour == blue
  412.         or colour == purple or colour == yellow then
  413.         DrawCircle(x, y, z, 251, colour)
  414.         DrawCircle(x, y, z, 252, colour)
  415.         DrawCircle(x, y, z, 253, colour)
  416.         DrawCircle(x, y, z, 254, colour)
  417.     end
  418. end
  419.  
  420. class 'ColorARGB' -- {
  421.  
  422.     function ColorARGB:__init(red, green, blue, alpha)
  423.         self.R = red or 255
  424.         self.G = green or 255
  425.         self.B = blue or 255
  426.         self.A = alpha or 255
  427.     end
  428.  
  429.     function ColorARGB.FromArgb(red, green, blue, alpha)
  430.         return Color(red,green,blue, alpha)
  431.     end
  432.  
  433.     function ColorARGB:ToARGB()
  434.         return ARGB(self.A, self.R, self.G, self.B)
  435.     end
  436.  
  437.     ColorARGB.Red = ColorARGB(255, 0, 0, 255)
  438.     ColorARGB.Yellow = ColorARGB(255, 255, 0, 255)
  439.     ColorARGB.Green = ColorARGB(0, 255, 0, 255)
  440.     ColorARGB.Aqua = ColorARGB(0, 255, 255, 255)
  441.     ColorARGB.Blue = ColorARGB(0, 0, 255, 255)
  442.     ColorARGB.Fuchsia = ColorARGB(255, 0, 255, 255)
  443.     ColorARGB.Black = ColorARGB(0, 0, 0, 255)
  444.     ColorARGB.White = ColorARGB(255, 255, 255, 255)
  445. -- }
  446.  
  447. --Notification class
  448. class 'Message' -- {
  449.  
  450.     Message.instance = ""
  451.  
  452.     function Message:__init()
  453.         self.notifys = {}
  454.  
  455.         AddDrawCallback(function(obj) self:OnDraw() end)
  456.     end
  457.  
  458.     function Message.Instance()
  459.         if Message.instance == "" then Message.instance = Message() end return Message.instance
  460.     end
  461.  
  462.     function Message.AddMessage(text, color, target)
  463.         return Message.Instance():PAddMessage(text, color, target)
  464.     end
  465.  
  466.     function Message:PAddMessage(text, color, target)
  467.         local x = 0
  468.         local y = 200
  469.         local tempName = "Screen"
  470.         local tempcolor = color or ColorARGB.Red
  471.  
  472.         if target then  
  473.             tempName = target.networkID
  474.         end
  475.  
  476.         self.notifys[tempName] = { text = text, color = tempcolor, duration = GetGameTimer() + 2, object = target}
  477.     end
  478.  
  479.     function Message:OnDraw()
  480.         for i, notify in pairs(self.notifys) do
  481.             if notify.duration < GetGameTimer() then notify = nil
  482.             else
  483.                 notify.color.A = math.floor((255/2)*(notify.duration - GetGameTimer()))
  484.  
  485.                 if i == "Screen" then  
  486.                     local x = 0
  487.                     local y = 200
  488.                     local gameSettings = GetGameSettings()
  489.                     if gameSettings and gameSettings.General then
  490.                         if gameSettings.General.Width then x = gameSettings.General.Width/2 end
  491.                         if gameSettings.General.Height then y = gameSettings.General.Height/4 - 100 end
  492.                     end  
  493.                     --PrintChat(tostring(notify.color))
  494.                     local p = GetTextArea(notify.text, 40).x
  495.                     self:DrawTextWithBorder(notify.text, 40, x - p/2, y, notify.color:ToARGB(), ARGB(notify.color.A, 0, 0, 0))
  496.                 else    
  497.                     local pos = WorldToScreen(D3DXVECTOR3(notify.object.x, notify.object.y, notify.object.z))
  498.                     local x = pos.x
  499.                     local y = pos.y - 25
  500.                     local p = GetTextArea(notify.text, 40).x
  501.  
  502.                     self:DrawTextWithBorder(notify.text, 30, x- p/2, y, notify.color:ToARGB(), ARGB(notify.color.A, 0, 0, 0))
  503.                 end
  504.             end
  505.         end
  506.     end
  507.  
  508.     function Message:DrawTextWithBorder(textToDraw, textSize, x, y, textColor, backgroundColor)
  509.         DrawText(textToDraw, textSize, x + 1, y, backgroundColor)
  510.         DrawText(textToDraw, textSize, x - 1, y, backgroundColor)
  511.         DrawText(textToDraw, textSize, x, y - 1, backgroundColor)
  512.         DrawText(textToDraw, textSize, x, y + 1, backgroundColor)
  513.         DrawText(textToDraw, textSize, x , y, textColor)
  514.     end
  515. -- }
Advertisement
Add Comment
Please, Sign In to add comment