LUA скрипт [NL] Fix Cord [Grenade Helper, DT Speed, Killsay]

axcord.ws
Забаненный
Статус
Оффлайн
Регистрация
8 Апр 2021
Сообщения
178
Реакции[?]
30
Поинты[?]
1K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Хелпер прикольный, решил фиксануть.
Взял скрипт с темы: https://yougame.biz/threads/224667/
Обычный фикс под ласт api нашего любимого чита.

Code:
-- neverlose cord
-- fixed for last neverlose api by august#6530

ffi.cdef[[
     void* CreateFileA(
          const char*                   lpFileName,
          unsigned long                 dwDesiredAccess,
          unsigned long                 dwShareMode,
          unsigned long                 lpSecurityAttributes,
          unsigned long                 dwCreationDisposition,
          unsigned long                 dwFlagsAndAttributes,
          void*                         hTemplateFile
     );
     bool ReadFile(
          void*                         hFile,
          char*                         lpBuffer,
          unsigned long                 nNumberOfBytesToRead,
          unsigned long*                lpNumberOfBytesRead,
          int                           lpOverlapped
     );
     unsigned long GetFileSize(
          void*                         hFile,
          unsigned long*                lpFileSizeHigh
     );
     bool CreateDirectoryA(
          const char*                   lpPathName,
          void*                         lpSecurityAttributes
     );
     void* CloseHandle(
          void*                         hFile
     );
 
     typedef struct _OVERLAPPED {
         unsigned long*                 Internal;
         unsigned long*                 InternalHigh;
         union {
              struct {
              unsigned long             Offset;
              unsigned long             OffsetHigh;
              } DUMMYSTRUCTNAME;
              void*                     Pointer;
          } DUMMYUNIONNAME;
         void*                          hEvent;
     }OVERLAPPED,                       *LPOVERLAPPED;
]]
ffi.C.CreateDirectoryA("lua\\grenade helper recode", nil)
local GameClientExports = ffi.cast("void***", Utils.CreateInterface("client.dll", "GameClientExports001"))[0] or error("Could not create GameClientExports interface")
local IsPlayerGameVoiceMuted = ffi.cast("bool(__thiscall*)(void*, int playerIndex)", GameClientExports[1]) or error("Could not get IsPlayerGameVoiceMuted")
local MutePlayerGameVoice = ffi.cast("void(__thiscall*)(void*, int playerIndex)", GameClientExports[2]) or error("Could not get MutePlayerGameVoice")
local UnmutePlayerGameVoice = ffi.cast("void(__thiscall*)(void*, int playerIndex)", GameClientExports[3]) or error("Could not get UnmutePlayerGameVoice")
local font = Render.InitFont("Tahoma", 13)
local font_p = Render.InitFont("Tahoma", 10)
local font_b = Render.InitFont("Tahoma bold", 12)


local menu_elements = {
     autostrafe = Menu.FindVar("Miscellaneous", "Main", "Movement", "Auto Strafe"),
}
local lua_elements = {
     dt_enable = Menu.Switch("Doubletap", "Enable", false),
     nade_helper = Menu.Switch("Grenade Helper", "Bind Key", false),
     screensize = EngineClient.GetScreenSize(),
     speed = Menu.SliderInt("Doubletap", "Doubletap Speed", 12, 14, 18),
     killsay = Menu.Switch("Communications", "Enable killsay", false),
     killtextBox = Menu.TextBox("Communications", "KillSay", 64, "1."),
     enable_automute = Menu.Combo("Communications", "Mute mode", {"Nothing", "Mute player", "Unmute player"}, 1),
}

local math_helpers = {
     normalizeangles = function(self, ang)
          if(ang.pitch > 180.0) then ang.pitch = ang.pitch - 360.0 end
          if(ang.yaw > 180.0) then ang.yaw = ang.yaw - 360.0 end
          return ang
     end,

     normalizefloat = function(self, ang)
          if(ang > 180.0) then ang = ang - 360.0 end
          if(ang < -180.0) then ang = ang + 360.0 end
          return ang
     end,

     calcangle = function(self, src, dst)
          local vecdelta = Vector.new(dst.x - src.x, dst.y - src.y, dst.z - src.z)
          local angles = QAngle.new(math.atan2(-vecdelta.z, vecdelta:Length2D()) * 180.0 / math.pi, (math.atan2(vecdelta.y, vecdelta.x) * 180.0 / math.pi), 0.0)
          return angles
     end,

     lerp = function(self, start, vend, time)
          return start + (vend - start) * time
     end,

     clamp = function(self, val, min, max)
          if(val > max) then
               val = max
          elseif(val < min) then
               val = min
          end
          return val
     end,
}

local grenade_helper = {
     maps = loadstring("return {" .. Http.Get("https://pastebin.com/raw/0z4h7JJn") .. "}")(),
     nade_type =
     {
          ["44"] = "HeGrenade",
          ["46"] = "Molotov",
          ["45"] = "Smoke",
          ["43"] = "FlashBang",
     },
     color_set =
     {
          body_r = 17/255, -- box behind the text
          body_g = 16/255,
          body_b = 14/255,
          target_r = 17/255, -- box (air) behind the text
          target_g = 16/266,
          target_b = 14/255,
          text_color_r = 150/255, -- text
          text_color_g = 150/255,
          text_color_b = 255/255,
     },

     movedirections =
     {
          [0] = 0,
          [1] = 180,
          [2] = 90,
          [3] = -90,
     },
     closest_nade = nil,
     closest_nade_position = Vector.new(0, 0, 0),
     render_stuff = {},
     should_throw = false,
     run_tick = 0,
     jump_tick = 0,
     old_autostrafe = false,
     strafe_backup_direction = 0,
     strafe_backup_button = 0,
     strafe_backup_tick = 0,
     strafe_backup_duration = 0,
     force_forward = false,
     extend_forward = function(self, cmd)
          if(self.force_forward == true) then
               local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
               if(localplayer == nil) then return end
               localplayer = localplayer:GetPlayer()
               local weapon = localplayer:GetActiveWeapon()
               if(weapon == nil) then return end
               if(weapon:IsGrenade() == false) then return end
               local throwtime = weapon:GetProp("DT_BaseCSGrenade", "m_fThrowTime")
               local curtime = localplayer:GetProp("DT_BasePlayer", "m_nTickBase") * GlobalVars.interval_per_tick
               local direction = 0
               if(self.closest_nade.movedirection == 2) then
                    direction = -45
               elseif(self.closest_nade.movedirection == 3) then
                    direction = 45
               end
               local movedirection = cmd.viewangles.yaw - (self.closest_nade.ang.yaw + direction)
               local move = Cheat.AngleToForward(QAngle.new(0, movedirection, 0))
               cmd.forwardmove = move.x * 450.0
               cmd.sidemove = move.y * 450.0
          end
     end,

     backup_strafe = function(self, cmd)
          if(cmd.tick_count - self.strafe_backup_tick <= self.strafe_backup_duration and cmd.tick_count - self.strafe_backup_tick >= 0) then
               local movedirection = self.strafe_backup_direction
               local move = Cheat.AngleToForward(QAngle.new(0, cmd.viewangles.yaw - movedirection, 0))
               cmd.forwardmove = move.x * 450.0
               cmd.sidemove = move.y * 450.0
          end
     end,

     setup_backup_strafe = function(self, cmd)
          if(self.closest_nade.backupdirection ~= 0) then
               self.strafe_backup_tick = cmd.tick_count
               self.strafe_backup_duration = self.closest_nade.backupduration
               self.strafe_backup_direction = (self.closest_nade.ang.yaw + self.movedirections[self.closest_nade.backupdirection - 1])
          end
     end,


     on_draw = function(self)
          if lua_elements.killsay:GetBool() == true then
               lua_elements.killtextBox:SetVisible(true)
          else
               lua_elements.killtextBox:SetVisible(false)
          end
      
          if lua_elements.dt_enable:GetBool() == true then
               lua_elements.speed:SetVisible(true)
          else
               lua_elements.speed:SetVisible(false)
          end
          local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
          if(localplayer == nil) then return end

          local map = EngineClient.GetLevelNameShort()
          self.closest_nade_position = nil
          if(self.should_throw == false) then self.closest_nade = nil end

          localplayer = localplayer:GetPlayer()
          local vecOrigin = localplayer:GetProp("DT_BaseEntity", "m_vecOrigin")
          local vecEyePosition = localplayer:GetEyePosition()
          local angViewAngles = EngineClient.GetViewAngles()
          local weapon = localplayer:GetActiveWeapon()
          local screencenter = Vector2.new(lua_elements.screensize.x / 2, lua_elements.screensize.y / 2)
          if(weapon == nil) then return end
          local weapon_id = weapon:GetWeaponID()
          if(weapon_id == 48) then weapon_id = 46 end
          if(weapon_id == 47) then return end

          local map_list = self.maps[map]
          local nade_list = nil
          if(map_list) then nade_list = map_list[tostring(weapon_id)] end

          if(weapon:IsGrenade() == false) then
               if(self.should_throw == true) then
                    menu_elements.autostrafe:SetBool(self.old_autostrafe)
               end
               self.closest_nade = nil
               self.closest_nade_position = nil
               self.should_throw = false
               self.has_strength = false
               self.has_duck = true
               self.run_tick = 0
               self.jump_tick = 0
               if(map_list) then
                    for nade_type, list in pairs(map_list) do
                         for startname, startspot in pairs(list) do
                         if(self.render_stuff[startname]) then
                              self.render_stuff[startname].global_alpha = 0.0 
                              self.render_stuff[startname].text_alpha = 0.0
                              self.render_stuff[startname].icon_alpha = 0.0
                              self.render_stuff[startname].box_length = 16.0
                              self.render_stuff[startname].box_height = 16.0
                              self.render_stuff[startname].box_additions_alpha = 0.0
                         end
                         for endname, endspot in pairs(startspot) do
                              if(type(endspot) == "table") then
                                   if(self.render_stuff[startname] and self.render_stuff[startname][endname]) then
                                        self.render_stuff[startname][endname].global_alpha = 0.0
                                        self.render_stuff[startname][endname].text_alpha = 0.0
                                        self.render_stuff[startname][endname].box_length = 10.0
                                        self.render_stuff[startname][endname].description_box_height = 0.0
                                        self.render_stuff[startname][endname].description_text_alpha = 0.0
                                   end
                              end
                         end
                         end
                    end
               end
          end

          local bestdistance = 100.0
          local temp_nade = nil

          if(nade_list) then
               for startname, startspot in pairs(nade_list) do
                    local distance = vecOrigin:DistTo(startspot.pos)
                    if(distance < 100.0 and distance < bestdistance) then
                         if(self.should_throw == false) then self.closest_nade_position = startspot.pos end
                         bestdistance = distance
                         temp_nade = startspot
                    end
                    ::continue::
               end
          end

          
          if(nade_list) then
               for startname, startspot in pairs(nade_list) do
                    if(self.render_stuff[startname] == nil) then self.render_stuff[startname] = {} end
                    if(self.render_stuff[startname].global_alpha == nil) then self.render_stuff[startname].global_alpha = 0.0 end
                    if(self.render_stuff[startname].box_length == nil) then self.render_stuff[startname].box_length = 30.0 end
                    if(self.render_stuff[startname].box_height == nil) then self.render_stuff[startname].box_height = 30.0 end
                    if(self.render_stuff[startname].text_alpha == nil) then self.render_stuff[startname].text_alpha = 0.0 end
                    if(self.render_stuff[startname].icon_alpha == nil) then self.render_stuff[startname].icon_alpha = 0.0 end
                    if(self.render_stuff[startname].box_additions_alpha == nil) then self.render_stuff[startname].box_additions_alpha = 0.0 end

                    local distance = vecOrigin:DistTo(startspot.pos)
                    if(distance > 1750.0) then
                         self.render_stuff[startname].global_alpha = math_helpers:lerp(self.render_stuff[startname].global_alpha, 0.0, GlobalVars.frametime * 20.0)
                    else
                         local trace = EngineTrace.TraceRay(vecEyePosition, startspot.pos, localplayer, 0x200400B)
                         if(trace.fraction > 0.98) then
                              if(distance > 1250.0) then
                                   self.render_stuff[startname].global_alpha = math_helpers:lerp(self.render_stuff[startname].global_alpha, 0.4, GlobalVars.frametime * 20.0)
                              elseif(distance < 5.0) then
                                   self.render_stuff[startname].global_alpha = math_helpers:lerp(self.render_stuff[startname].global_alpha, 1.0, GlobalVars.frametime * 20.0)
                              else
                                   self.render_stuff[startname].global_alpha = math_helpers:lerp(self.render_stuff[startname].global_alpha, 0.8, GlobalVars.frametime * 20.0)
                              end
                         else
                              self.render_stuff[startname].global_alpha = math_helpers:lerp(self.render_stuff[startname].global_alpha, 0.0, GlobalVars.frametime * 20.0)
                         end
                    end

                    if(self.render_stuff[startname].global_alpha < 0.01) then goto continue end

                    local screenpos = Render.WorldToScreen(Vector.new(startspot.pos.x, startspot.pos.y, startspot.pos.z + 10.0))
                    local nade_type_size = Render.CalcTextSize(self.nade_type[tostring(weapon_id)], 13, font)
                    local bestlength = 0
                    local num_spots = 0
                    local temp_fov_nade = nil
                    local temp_fov_name = nil
                    local bestfov = 180

                    for endname, endspot in pairs(startspot) do
                         if(type(endspot) == "table") then
                         local name_size = Render.CalcTextSize(endname, 13, font)
                         if(name_size.x > bestlength) then bestlength = name_size.x end

                         if(self.render_stuff[startname][endname] == nil) then self.render_stuff[startname][endname] = {} end
                         if(self.render_stuff[startname][endname].global_alpha == nil) then self.render_stuff[startname][endname].global_alpha = 0.0 end
                         if(self.render_stuff[startname][endname].box_length == nil) then self.render_stuff[startname][endname].box_length = 10.0 end
                         if(self.render_stuff[startname][endname].text_alpha == nil) then self.render_stuff[startname][endname].text_alpha = 0.0 end
                         if(self.render_stuff[startname][endname].circle_color == nil) then self.render_stuff[startname][endname].circle_color = Color.new(0.15, 0.15, 0.15, 0.0) end
                         if(self.render_stuff[startname][endname].description_box_height == nil) then self.render_stuff[startname][endname].description_box_height = 0.0 end
                         if(self.render_stuff[startname][endname].description_text_alpha == nil) then self.render_stuff[startname][endname].description_text_alpha = 0.0 end
              
                         if(endspot.endposition == nil) then
                              local vecStart = Vector.new(startspot.pos.x, startspot.pos.y, startspot.pos.z + 64.0)
                              local forward = Cheat.AngleToForward(endspot.ang)
                              local vecEnd = Vector.new(vecStart.x + 800.0 * forward.x, vecStart.y + 800.0 * forward.y, vecStart.z + 800.0 * forward.z)
                              local trace = EngineTrace.TraceRay(vecStart, vecEnd, localplayer, 0x46004003)
                              endspot.endposition = Vector.new(trace.endpos.x, trace.endpos.y, trace.endpos.z)
                         end
                         if(endspot.jumpthresthold == nil) then
                              endspot.jumpthresthold = 0
                         end
                         if(endspot.movedirection == nil) then
                              endspot.movedirection = 0
                         end
                         if(endspot.backupdirection == nil) then
                              endspot.backupdirection = 0
                         end
                         if(endspot.backupduration == nil) then
                              endspot.backupduration = 1
                         end
                         if(endspot.extendforward == nil) then
                              endspot.extendforward = false
                         end
              
                         local angles = math_helpers:normalizeangles(math_helpers:calcangle(vecEyePosition, endspot.endposition))
                         local fov = math.sqrt((angles.pitch - angViewAngles.pitch) ^ 2 + (angles.yaw - angViewAngles.yaw) ^ 2)
                         fov = math_helpers:normalizefloat(fov)
                         fov = math.abs(fov)
              
                         if(fov < bestfov and distance <= 50.0 and startspot == temp_nade) then
                              bestfov = fov
                              temp_fov_nade = endspot
                              temp_fov_name = endname
                              if(self.should_throw == false) then self.closest_nade = endspot end
                         end
                         num_spots = num_spots + 1
                         end
                    end

                    for endname, endspot in pairs(startspot) do
                         if(type(endspot) ~= "table" or endspot == temp_fov_nade) then goto continue end
          
                         local screenpos = Render.WorldToScreen(endspot.endposition)
                         local name_size = Render.CalcTextSize(endname, 12, font_b)
          
                         local r = 255
                         local g = 255
                         local b = 255

                         local desired_box_length = name_size.x + 20

    
                         if(endspot.description and string.len(endspot.description) > 0) then
                              local desc_size = Render.CalcTextSize(endspot.description, 10, font_p)
                              desired_box_height = 16
                              if(self.render_stuff[startname][endname].description_text_alpha > 0.01) then desired_box_length = math.max(desired_box_length, desc_size.x) end
                              end
    
                              self.render_stuff[startname][endname].description_text_alpha = math_helpers:lerp(self.render_stuff[startname][endname].description_text_alpha, 0.0, GlobalVars.frametime * 60.0)
    
                              if(distance > 50.0 or startspot ~= temp_nade) then
                              self.render_stuff[startname][endname].text_alpha = math_helpers:lerp(self.render_stuff[startname][endname].text_alpha, 0.0, GlobalVars.frametime * 60.0)
                              if(self.render_stuff[startname][endname].text_alpha < 0.01) then
                                   self.render_stuff[startname][endname].box_length = math_helpers:lerp(self.render_stuff[startname][endname].box_length, 10.0, GlobalVars.frametime * 30.0)
                                   self.render_stuff[startname][endname].description_box_height = math_helpers:lerp(self.render_stuff[startname][endname].description_box_height, 0.0, GlobalVars.frametime * 30.0)
                                   if(self.render_stuff[startname][endname].box_length - 10.0 < 0.1 and self.render_stuff[startname][endname].description_box_height < 0.1) then
                                        self.render_stuff[startname][endname].global_alpha = math_helpers:lerp(self.render_stuff[startname][endname].global_alpha, 0.0, GlobalVars.frametime * 60.0)
                                   end
                              end
                              else
                              if(screenpos.x + self.render_stuff[startname][endname].box_length + 2 > lua_elements.screensize.x or screenpos.x < 12 or screenpos.y + 10 > lua_elements.screensize.y or screenpos.y < 10) then
                                   self.render_stuff[startname][endname].global_alpha = math_helpers:lerp(self.render_stuff[startname][endname].global_alpha, 1.0, GlobalVars.frametime * 60.0)
                              else
                                   self.render_stuff[startname][endname].global_alpha = math_helpers:lerp(self.render_stuff[startname][endname].global_alpha, 0.6, GlobalVars.frametime * 60.0)
                              end
                              if(self.render_stuff[startname][endname].global_alpha > 0.58) then
                                   self.render_stuff[startname][endname].box_length = math_helpers:lerp(self.render_stuff[startname][endname].box_length, desired_box_length, GlobalVars.frametime * 30.0)
                                   if(desired_box_length - self.render_stuff[startname][endname].box_length < 0.1) then
                                        self.render_stuff[startname][endname].text_alpha = math_helpers:lerp(self.render_stuff[startname][endname].text_alpha, self.render_stuff[startname][endname].global_alpha, GlobalVars.frametime * 60.0)
                                        if(self.render_stuff[startname][endname].description_text_alpha < 0.01) then
                                             self.render_stuff[startname][endname].description_box_height = math_helpers:lerp(self.render_stuff[startname][endname].description_box_height, 0.0, GlobalVars.frametime * 60.0)
                                        end
                                   end
                              end
                              end
                              self.render_stuff[startname][endname].circle_color = Color.new(r, g, b, self.render_stuff[startname][endname].global_alpha)
                              if(self.render_stuff[startname][endname].global_alpha < 0.01) then goto continue end

                         if(screenpos.x + self.render_stuff[startname][endname].box_length + 2 > lua_elements.screensize.x or screenpos.x < 12 or screenpos.y + 10 > lua_elements.screensize.y or screenpos.y < 10) then
                              local vecdelta = Vector2.new(screenpos.x - screencenter.x, screenpos.y - screencenter.y)
                              local length = #vecdelta
                              local cos = vecdelta.x / length
                              local sin = vecdelta.y / length
                              local max_legnth = #screencenter

                              local newpos = Vector2.new(screencenter.x + max_legnth * cos, screencenter.y + max_legnth * sin)
                              if(newpos.x + self.render_stuff[startname][endname].box_length > lua_elements.screensize.x) then newpos.x = lua_elements.screensize.x - self.render_stuff[startname][endname].box_length - 18
                              elseif(newpos.x < 16) then newpos.x = 28 end
                              if(newpos.y + 16 > lua_elements.screensize.y) then newpos.y = lua_elements.screensize.y - 28
                              elseif(newpos.y < 16) then newpos.y = 28 end

                              screenpos = newpos
                         end
                         Render.BoxFilled(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][endname].box_length, screenpos.y + 11), Color.new(self.color_set.target_r, self.color_set.target_g, self.color_set.target_b, self.render_stuff[startname][endname].global_alpha + 50))
                         Render.Box(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][endname].box_length, screenpos.y + 11), Color.new(5/255, 4/255, 0, self.render_stuff[startname][endname].global_alpha + 80))
                         Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][endname].description_box_height + 8), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][endname].description_box_height - 7), Color.new(0, 0, 0, self.render_stuff[startname][endname].text_alpha))
                         Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][endname].description_box_height + 7), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][endname].description_box_height - 7), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][endname].text_alpha))
                        
                         Render.Text(endname, Vector2.new(screenpos.x + 15, screenpos.y - name_size.y / 2), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][endname].text_alpha), 12, font_b, true)
          
                         ::continue::
                    end

                    if(temp_fov_nade) then
                         local screenpos = Render.WorldToScreen(temp_fov_nade.endposition)
                         local name_size = Render.CalcTextSize(temp_fov_name, 12, font_b)
              
                         local r = 255
                         local g = 255
                         local b = 255
                         self.render_stuff[startname][temp_fov_name].global_alpha = math_helpers:lerp(self.render_stuff[startname][temp_fov_name].global_alpha, 0.9, GlobalVars.frametime * 30.0)
                         self.render_stuff[startname][temp_fov_name].circle_color = Color.new(r, g, b, self.render_stuff[startname][temp_fov_name].global_alpha)

                         local desired_box_length = name_size.x + 20
                         local desired_box_height = 0
                        
                         if(temp_fov_nade.description and string.len(temp_fov_nade.description) > 0) then
                              local desc_size = Render.CalcTextSize(temp_fov_nade.description, 10, font_p)
                              desired_box_height = 16
                              if(desc_size.x + 11 > desired_box_length) then desired_box_length = math.max(desired_box_length, desc_size.x + 12) end
                         end

                         if(self.render_stuff[startname][temp_fov_name].global_alpha > 0.88) then
                              self.render_stuff[startname][temp_fov_name].box_length = math_helpers:lerp(self.render_stuff[startname][temp_fov_name].box_length, desired_box_length, GlobalVars.frametime * 30.0)
                              self.render_stuff[startname][temp_fov_name].description_box_height = math_helpers:lerp(self.render_stuff[startname][temp_fov_name].description_box_height, desired_box_height, GlobalVars.frametime * 30.0)
                              if(desired_box_length - self.render_stuff[startname][temp_fov_name].box_length < 0.1 and desired_box_height - self.render_stuff[startname][temp_fov_name].description_box_height < 0.1) then
                                   self.render_stuff[startname][temp_fov_name].text_alpha = math_helpers:lerp(self.render_stuff[startname][temp_fov_name].text_alpha, 1.0, GlobalVars.frametime * 30.0)
                                   self.render_stuff[startname][temp_fov_name].description_text_alpha = math_helpers:lerp(self.render_stuff[startname][temp_fov_name].description_text_alpha, 1.0, GlobalVars.frametime * 30.0)
                              end
                         end

                         if(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 2 > lua_elements.screensize.x or screenpos.x < 12 or screenpos.y + 10 > lua_elements.screensize.y or screenpos.y < 10) then
                              local vecdelta = Vector2.new(screenpos.x - screencenter.x, screenpos.y - screencenter.y)
                              local length = #vecdelta
                              local cos = vecdelta.x / length
                              local sin = vecdelta.y / length
                              local max_legnth = #screencenter

                              local newpos = Vector2.new(screencenter.x + max_legnth * cos, screencenter.y + max_legnth * sin)
                              if(newpos.x + self.render_stuff[startname][temp_fov_name].box_length > lua_elements.screensize.x) then newpos.x = lua_elements.screensize.x - self.render_stuff[startname][temp_fov_name].box_length + 1
                              elseif(newpos.x < 16) then newpos.x = 28 end
                              if(newpos.y + 16 > lua_elements.screensize.y) then newpos.y = lua_elements.screensize.y - 28
                              elseif(newpos.y < 16) then newpos.y = 28 end

                              screenpos = newpos
                         end


                    

                         if(temp_fov_nade.description and string.len(temp_fov_nade.description) > 0) then
                              local desc_size = Render.CalcTextSize(temp_fov_nade.description, 10, font_p)
                              Render.BoxFilled(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 8, screenpos.y), Color.new(self.color_set.target_r, self.color_set.target_g, self.color_set.target_b, self.render_stuff[startname][temp_fov_name].global_alpha))
                              Render.BoxFilled(Vector2.new(screenpos.x - 10, screenpos.y), Vector2.new(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 8, screenpos.y - 4 + self.render_stuff[startname][temp_fov_name].description_box_height), Color.new(self.color_set.target_r, self.color_set.target_g, self.color_set.target_b, self.render_stuff[startname][temp_fov_name].global_alpha))
                              Render.Box(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 8, screenpos.y - 4 + self.render_stuff[startname][temp_fov_name].description_box_height), Color.new(5/255, 4/255, 0, self.render_stuff[startname].global_alpha))

                              Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][temp_fov_name].description_box_height + 9), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][temp_fov_name].description_box_height - 8), Color.new(0, 0, 0, self.render_stuff[startname][temp_fov_name].global_alpha))
                              Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][temp_fov_name].description_box_height + 8), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][temp_fov_name].description_box_height - 8), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].global_alpha))
                              
                              Render.Text(temp_fov_name, Vector2.new(screenpos.x + 23, screenpos.y - name_size.y / 2 - 3), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].text_alpha), 12, font_b, true)
                              Render.Text(temp_fov_nade.description, Vector2.new(screenpos.x + 15, screenpos.y - 3 + self.render_stuff[startname][temp_fov_name].description_box_height / 2 - desc_size.y / 2), Color.new(0, 0, 0, self.render_stuff[startname][temp_fov_name].global_alpha), 10, font_p)
                              Render.Text(temp_fov_nade.description, Vector2.new(screenpos.x + 16, screenpos.y - 3 + self.render_stuff[startname][temp_fov_name].description_box_height / 2 - desc_size.y / 2), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].global_alpha), 10, font_p, true)
                              Render.Text('»', Vector2.new(screenpos.x + 15, screenpos.y - name_size.y / 2 - 3), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].text_alpha), 12, font_b, true)
                         else
                              Render.BoxFilled(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 8, screenpos.y + 11), Color.new(self.color_set.target_r, self.color_set.target_g, self.color_set.target_b, self.render_stuff[startname][temp_fov_name].global_alpha))
                              Render.Box(Vector2.new(screenpos.x - 10, screenpos.y - 11), Vector2.new(screenpos.x + self.render_stuff[startname][temp_fov_name].box_length + 8, screenpos.y + 11), Color.new(5/255, 4/255, 0, self.render_stuff[startname].global_alpha))

                              Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][temp_fov_name].description_box_height + 8), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][temp_fov_name].description_box_height - 7), Color.new(0, 0, 0, self.render_stuff[startname][temp_fov_name].global_alpha))
                              Render.Line(Vector2.new(screenpos.x + 10, screenpos.y - self.render_stuff[startname][temp_fov_name].description_box_height + 7), Vector2.new(screenpos.x + 10, screenpos.y + self.render_stuff[startname][temp_fov_name].description_box_height - 7), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].global_alpha))
                              
                              Render.Text(temp_fov_name, Vector2.new(screenpos.x + 23, screenpos.y - name_size.y / 2), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].text_alpha), 12, font_b, true)
                              Render.Text('»', Vector2.new(screenpos.x + 15, screenpos.y - name_size.y / 2), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname][temp_fov_name].text_alpha), 12, font_b, true)
                         end
                         if lua_elements.nade_helper:GetBool() == true then
                              color_circle = Color.new(0, 150/255, 0, 1)
                         else
                              color_circle = Color.new(150/255, 150/255, 1, 1)
                         end

                         Render.CircleFilled(screenpos, 5, 15, color_circle);
                    end

                    if(bestlength < nade_type_size.x) then bestlength = nade_type_size.x end

                    if(distance < 400.0 and (temp_nade and temp_nade == startspot or temp_nade == nil or lua_elements.nade_helper:GetBool() == false)) then
                         self.render_stuff[startname].box_length = math_helpers:lerp(self.render_stuff[startname].box_length, bestlength, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].box_height = math_helpers:lerp(self.render_stuff[startname].box_height, num_spots * 14, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].icon_alpha = math_helpers:lerp(self.render_stuff[startname].icon_alpha, 0.0, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].box_additions_alpha = math_helpers:lerp(self.render_stuff[startname].box_additions_alpha, self.render_stuff[startname].global_alpha, GlobalVars.frametime * 20.0)
                         if(bestlength - self.render_stuff[startname].box_length < 0.1) then
                         self.render_stuff[startname].box_additions_alpha = math_helpers:lerp(self.render_stuff[startname].box_additions_alpha, self.render_stuff[startname].global_alpha, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].text_alpha = math_helpers:lerp(self.render_stuff[startname].text_alpha, self.render_stuff[startname].global_alpha, GlobalVars.frametime * 20.0)
                         end
                    elseif(distance > 400 or (temp_nade and temp_nade ~= startspot)) then
                         self.render_stuff[startname].text_alpha = math_helpers:lerp(self.render_stuff[startname].text_alpha, 0.0, GlobalVars.frametime * 20.0)
                         if(self.render_stuff[startname].text_alpha < 0.01) then
                         self.render_stuff[startname].box_additions_alpha = math_helpers:lerp(self.render_stuff[startname].box_additions_alpha, 0.0, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].icon_alpha = math_helpers:lerp(self.render_stuff[startname].icon_alpha, self.render_stuff[startname].global_alpha, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].box_length = math_helpers:lerp(self.render_stuff[startname].box_length, 16, GlobalVars.frametime * 20.0)
                         self.render_stuff[startname].box_height = math_helpers:lerp(self.render_stuff[startname].box_height, 1, GlobalVars.frametime * 20.0)
                         end
                    end

                    Render.BoxFilled(Vector2.new(screenpos.x - self.render_stuff[startname].box_length / 2 - 3, screenpos.y + 6), Vector2.new(screenpos.x + self.render_stuff[startname].box_length / 2 + 3, screenpos.y - self.render_stuff[startname].box_height - 15), Color.new(self.color_set.body_r, self.color_set.body_g, self.color_set.body_b, 0.95 * self.render_stuff[startname].global_alpha)) -- тело
                    Render.Box(Vector2.new(screenpos.x - self.render_stuff[startname].box_length / 2 - 3, screenpos.y + 5), Vector2.new(screenpos.x + self.render_stuff[startname].box_length / 2 + 3, screenpos.y - self.render_stuff[startname].box_height - 14), Color.new(5/255, 4/255, 0, self.render_stuff[startname].global_alpha))

                    local icon_size = Render.CalcWeaponIconSize(weapon_id, 15)
                    Render.WeaponIcon(weapon_id, Vector2.new(screenpos.x - icon_size.x / 2 + 1, screenpos.y - icon_size.y + 2), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname].icon_alpha), 15, true)
                    
                    num_spots = 0
                    for endname, endspot in pairs(startspot) do
                         if(type(endspot) == "table") then
                         local icon_size = Render.CalcWeaponIconSize(weapon_id, 15)
                         local name_size = Render.CalcTextSize(endname, 13, font)
                         if weapon_id == 46 then
                              Render.WeaponIcon(weapon_id, Vector2.new(screenpos.x - nade_type_size.x / 2 + 15, screenpos.y - self.render_stuff[startname].box_height - nade_type_size.y), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname].text_alpha), 15, true)
                         elseif weapon_id == 44 then
                              Render.WeaponIcon(weapon_id, Vector2.new(screenpos.x - nade_type_size.x / 2 + 24, screenpos.y - self.render_stuff[startname].box_height - nade_type_size.y), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname].text_alpha), 15, true)
                         end
                         Render.Text(endname, Vector2.new(screenpos.x - name_size.x / 2, screenpos.y - (14 * num_spots / 0.98) - name_size.y + 1), Color.new(self.color_set.text_color_r, self.color_set.text_color_g, self.color_set.text_color_b, self.render_stuff[startname].text_alpha), 13, font, true)
                         num_spots = num_spots + 1
                         end
                    end
                    ::continue::
               end
          end
     end,

     on_pre_prediction = function(self, cmd)
          self:backup_strafe(cmd)
          self:extend_forward(cmd)
          if(self.should_throw == true) then
               if(self.closest_nade.duck == true) then cmd.buttons = bit.bor(cmd.buttons, 4)
               else cmd.buttons = bit.band(cmd.buttons, bit.bnot(4)) end
          end
     end,

     on_prediction = function(self, cmd)
          local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
          if(localplayer == nil) then return end
          localplayer = localplayer:GetPlayer()
          local velocity = Vector.new(localplayer:GetProp("DT_BasePlayer", "m_vecVelocity[0]"), localplayer:GetProp("DT_BasePlayer", "m_vecVelocity[1]"), localplayer:GetProp("DT_BasePlayer", "m_vecVelocity[2]"))
          local weapon = localplayer:GetActiveWeapon()
          if(weapon == nil) then return end
          local throwtime = weapon:GetProp("DT_BaseCSGrenade", "m_fThrowTime")
          local duckamount = localplayer:GetProp("DT_BasePlayer", "m_flDuckAmount")
          local throwstrengh = weapon:GetProp("DT_BaseCSGrenade", "m_flThrowStrength")
          if(self.should_throw == true) then
               cmd.buttons = bit.bor(cmd.buttons, 1)
               if(self.closest_nade.duck == true and duckamount ~= 1.0) then return end
               if(self.closest_nade.duck == false and duckamount ~= 0.0) then return end
               if(self.closest_nade.strength ~= 1.0 and throwstrengh > self.closest_nade.strength) then cmd.buttons = bit.bor(cmd.buttons, 2048); cmd.buttons = bit.band(cmd.buttons, bit.bnot(1)); return end
               if(throwstrengh < self.closest_nade.strength) then cmd.buttons = bit.bor(cmd.buttons, 1) end
               if(self.run_tick == 0) then self.run_tick = cmd.tick_count end
               if(self.closest_nade.runduration > 0 and self.force_forward == false) then
                    local speedfactor = 1.0
                    if(self.closest_nade.duck) then speedfactor = 2.93 end
                    local movedirection = cmd.viewangles.yaw - (self.closest_nade.ang.yaw + self.movedirections[self.closest_nade.movedirection])
                    local move = Cheat.AngleToForward(QAngle.new(0, movedirection, 0))
                    cmd.forwardmove = (move.x) * (self.closest_nade.speed * speedfactor)
                    cmd.sidemove = (move.y) * (self.closest_nade.speed * speedfactor)
               end
               if(cmd.tick_count - self.run_tick >= self.closest_nade.runduration) then
                    if(self.jump_tick == 0) then self.jump_tick = cmd.tick_count end
                    if(self.closest_nade.jump and self.closest_nade.jumpthresthold <= 0) then
                         cmd.buttons = bit.bor(cmd.buttons, 2)
                    end
                    if(cmd.tick_count - self.jump_tick >= self.closest_nade.jumpduration or self.closest_nade.jumpthresthold > 0) then
                         cmd.buttons = bit.band(cmd.buttons, bit.bnot(1))
                         cmd.buttons = bit.band(cmd.buttons, bit.bnot(2048))
                         cmd.viewangles = self.closest_nade.ang
                         self.force_forward = self.closest_nade.extendforward
                    end
                    if(self.closest_nade.jumpthresthold > 0 and cmd.tick_count - self.jump_tick >= self.closest_nade.jumpthresthold) then
                         cmd.buttons = bit.bor(cmd.buttons, 2)
                    end
               end
               if(throwtime > 0.0 and throwtime < GlobalVars.curtime) then
                    self:setup_backup_strafe(cmd)
                    self.closest_nade = nil
                    self.closest_nade_position = nil
                    self.should_throw = false
                    self.run_tick = 0
                    self.jump_tick = 0
                    self.force_forward = false
                    menu_elements.autostrafe:SetBool(self.old_autostrafe)
               end
          elseif(self.closest_nade_position and lua_elements.nade_helper:GetBool() == true) then
               cmd.buttons = bit.band(cmd.buttons, bit.bnot(2048))
               local origin = localplayer:GetProp("DT_BaseEntity", "m_vecOrigin")
               local onground = (bit.band(localplayer:GetProp("DT_BasePlayer", "m_fFlags"), 1) == 1)
               local delta = (self.closest_nade_position - origin)
               local length = #delta
               if(onground == true and length < 100.0) then
                    local viewangles = EngineClient.GetViewAngles()
                    local direction = Cheat.VectorToAngle(delta)
                    direction.yaw = viewangles.yaw - direction.yaw
                    local move = Cheat.AngleToForward(direction)
                    local v1 = bit.band(cmd.buttons, 8) == 8
                    local v2 = bit.band(cmd.buttons, 16) == 16
                    local v3 = bit.band(cmd.buttons, 512) == 512
                    local v4 = bit.band(cmd.buttons, 1024) == 1024
                    local in_duck = bit.band(cmd.buttons, 4) == 4
                    local in_move = (v1 or v2 or v3 or v4)
                    if(in_move == false and length > 0.1) then
                        cmd.forwardmove = move.x * (450.0 * (math.exp(math_helpers:clamp(length, 0.0, 5.0) - 5.0)) + 1.0)
                        cmd.sidemove = move.y * (450.0 * (math.exp(math_helpers:clamp(length, 0.0, 5.0) - 5.0)) + 1.0)
                        if(in_duck == true) then
                              cmd.forwardmove = cmd.forwardmove * 2.93
                              cmd.sidemove = cmd.sidemove * 2.93
                        end
                    elseif(weapon:GetProp("DT_BaseCSGrenade", "m_bPinPulled")  and self.closest_nade and velocity:Length2D() < 10.0) then
                         self.should_throw = true
                         self.old_autostrafe = menu_elements.autostrafe:GetBool()
                         menu_elements.autostrafe:SetBool(false)
                    end
               end
          end
     end,
}

local function on_draw()
     lua_elements.screensize = EngineClient.GetScreenSize()
     grenade_helper:on_draw()
end

Cheat.RegisterCallback("createmove", function()
    if lua_elements.dt_enable:GetBool() then
        Exploits.OverrideDoubleTapSpeed(lua_elements.speed:GetInt())
    else
        Exploits.OverrideDoubleTapSpeed(14)
    end
end)

local function on_pre_prediction(cmd)
     grenade_helper:on_pre_prediction(cmd)
end

local function on_prediction(cmd)
     grenade_helper:on_prediction(cmd)
end
Cheat.RegisterCallback("events", function(e)
     local lp = EngineClient:GetLocalPlayer()
     if lua_elements.killsay:GetBool() == true then
          if e:GetName() == "player_death" then
               local attackerId = EngineClient:GetPlayerForUserId(e:GetInt("attacker"))
               local player = EngineClient:GetPlayerForUserId(e:GetInt("userid"))
               if attackerId == lp and player ~= attackerId then
                    EngineClient:ExecuteClientCmd('say '..lua_elements.killtextBox:GetString())
               end
          end
     end
     if e:GetName() == "player_connect_full"
          or e:GetName() == "switch_team"
          or e:GetName() == "jointeam_failed"
          or e:GetName() == "player_connect"
          or e:GetName() == "player_activate"
          or e:GetName() == "player_spawn"
          or e:GetName() == "player_info" then
          local idx = e:GetInt("index")
          if idx ~= lp then
               if lua_elements.enable_automute:GetInt() == 1 then
                    if not IsPlayerGameVoiceMuted(nil, idx) then
                         MutePlayerGameVoice(nil, idx)
                    end
                    for i = 1, 64 do
                         if i ~= lp then
                         MutePlayerGameVoice(nil, i)
                         end
                    end
               end
                
               if lua_elements.enable_automute:GetInt() == 2 then
                    if IsPlayerGameVoiceMuted(nil, idx) then
                         UnmutePlayerGameVoice(nil, idx)
                    end
                    for i = 1, 64 do
                         UnmutePlayerGameVoice(nil, i)
                    end
               end
          end
     end
end)

function on_destroy()
     exploits.OverrideDoubleTapSpeed(14)
end
Cheat.RegisterCallback("destroy", on_destroy)
Cheat.RegisterCallback("draw", on_draw)
Cheat.RegisterCallback("pre_prediction", on_pre_prediction)
Cheat.RegisterCallback("prediction", on_prediction)

Если у вас есть какие-то вопросы, мой дискорд: august#6530
 
Сверху Снизу