Я гуль...
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Первое это viewmodel,второе линии на прицеле
Код:
-- Sets variable viewmodel_offset_x to the cvar
local viewmodel_offset_x = cvar.find_var("viewmodel_offset_x")
-- Sets variable viewmodel_offset_y to the cvar
local viewmodel_offset_y = cvar.find_var("viewmodel_offset_y")
-- Sets variable viewmodel_offset_z to the cvar
local viewmodel_offset_z = cvar.find_var("viewmodel_offset_z")
-- Adds label for showing where Override Viewmodel FOV is located becasue I cba to make a slider for it
local label1 = ui.add_label("- Viewmodel FOV is located in - \nVisuals -> Other ESP -> \nOverride Viewmodel FOV")
-- Adds X slider to change "viewmodel_offset_x" cvar
local offset_x = ui.add_slider("Offset X", -20, 20)
-- Sets a default value for "viewmodel_offset_x"
offset_x:set(2)
-- Adds Y slider to change "viewmodel_offset_y" cvar
local offset_y = ui.add_slider("Offset Y", -20, 20)
-- Sets a default value for "viewmodel_offset_y"
offset_y:set(2)
-- Adds Z slider to change "viewmodel_offset_z" cvar
local offset_z = ui.add_slider("Offset Z", -20, 20)
-- Sets a default value for "viewmodel_offset_z"
offset_z:set(-2)
-- Adds note label
local label = ui.add_label("Note: When you unload the lua, \nyour viewmodel will not reset!")
-- Starts function
callbacks.register("paint", function()
-- Sets "viewmodel_offset_x" cvar to slider created above
viewmodel_offset_x:set_value_float(offset_x:get())
-- Sets "viewmodel_offset_y" cvar to slider created above
viewmodel_offset_y:set_value_float(offset_y:get())
-- Sets "viewmodel_offset_z" cvar to slider created above
viewmodel_offset_z:set_value_float(offset_z:get())
end)
Код:
local entity_get_client_entity = entity_list.get_client_entity
local alpha = 0
local speed_slider = ui.add_slider("Fade time", 0, 1000)
speed_slider:set(150)
local scope_color_label = ui.add_label("Scope color")
local scope_color = ui.add_colorpicker("dsda")
scope_color:set(color.new(255,255,255,235))
local scope_width = ui.add_slider("Scope width", 0, 500)
local scope_height = ui.add_slider("Scope height", 0, 500)
scope_width:set(100)
scope_height:set(100)
local scope_padding = ui.add_slider("Scope padding", 0, 250)
scope_padding:set(15)
-- maybe do this in a different function, this is just an example though
function on_paint()
-- Get screen size to render in the middle
local screen_size_x, screen_size_y = render.get_screen()
local screen_center = vector2d.new(screen_size_x / 2, screen_size_y / 2)
-- Local player check
local_player = entity_get_client_entity(engine.get_local_player())
-- Checks to see if client is in game, else return
if not engine.in_game() then
return
end
-- Local player check to see if local player is a thing
if local_player == nil then
return
end
-- Health check to see if you are alive
if local_player:get_prop("DT_BasePlayer", "m_iHealth"):get_int() <= 0 then
return
end
-- Reach full alpha in ~100ms
local multiplier = (1.0 / (speed_slider:get()/1000)) * global_vars.frametime
-- Health check to see if you are alive
if local_player:get_prop("DT_CSPlayer", "m_bIsScoped"):get_bool() then
if alpha < 1.0 then
alpha = alpha + multiplier
end
else
if alpha > 0.0 then
alpha = alpha - multiplier
end
end
-- clamp alpha not to go out of bounds
if alpha >= 1.0 then
alpha = 1
end
if alpha <= 0.0 then
alpha = 0
return
end
local r, g, b, a = scope_color:get():r(), scope_color:get():g(), scope_color:get():b(), scope_color:get():a()
-- top
local height = scope_height:get()
pos = vector2d.new(screen_center.x, screen_center.y - height)
size = vector2d.new(1, height * alpha)
pos.y = pos.y - (scope_padding:get() - 1)
render.gradient(pos.x, pos.y, size.x, size.y, color.new(0,0,0,0), color.new(r,g,b,a * alpha), false)
-- bottom
pos = vector2d.new(screen_center.x, screen_center.y + (height * ( 1.0 - alpha ) ))
size = vector2d.new(1, scope_height:get() - ( height * ( 1.0 - alpha ) ))
pos.y = pos.y + scope_padding:get()
render.gradient(pos.x, pos.y, size.x, size.y, color.new(r,g,b,a * alpha), color.new(0,0,0,0), false)
local width = scope_width:get()
-- left
pos = vector2d.new(screen_center.x - width, screen_center.y)
size = vector2d.new(width * alpha, 1)
pos.x = pos.x - (scope_padding:get() - 1)
render.gradient(pos.x, pos.y, size.x, size.y, color.new(0,0,0,0), color.new(r,g,b,a * alpha), true)
-- right
pos = vector2d.new(screen_center.x + (width* ( 1.0 - alpha ) ), screen_center.y)
size = vector2d.new(width - ( width * ( 1.0 - alpha ) ), 1)
pos.x = pos.x + scope_padding:get()
render.gradient(pos.x, pos.y, size.x, size.y, color.new(r,g,b,a * alpha), color.new(0,0,0,0), true)
end
callbacks.register("paint", on_paint)