-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfovchanger.lua
67 lines (58 loc) · 3.16 KB
/
fovchanger.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
local REF = gui.Reference( "Settings" )
local TAB = gui.Tab(REF, "lua_fov_tab", "Fov Changer")
local FOVBOX = gui.Groupbox(TAB, "FOV", 15, 15, 605, 500)
local SLIDER = gui.Slider( FOVBOX, "lua_fov_slider", "Field of View", 90, 0, 180 )
local SLIDER_ONE = gui.Slider( FOVBOX, "lua_fov_slider_one", "Field of View for 1st Zoom", 40, 0, 180 )
local SLIDER_TWO = gui.Slider( FOVBOX, "lua_fov_slider_two", "Field of View for 2nd Zoom", 15, 0, 180 )
local FOVBETWEENCHECK = gui.Checkbox( FOVBOX, "lua_fov_between__shot_checkbox", "Reset FOV between scoped shots" , 0 )
local VIEWBOX = gui.Groupbox(TAB, "Viewmodel", 15, 260, 605, 500)
local SLIDER_VIEW = gui.Slider( VIEWBOX, "lua_fov_slider_view", "Viewmodel Field of View", 60, 0, 180 )
local SLIDER_VIEWX = gui.Slider( VIEWBOX, "lua_fov_slider_viewX", "Viewmodel Offset X", 1, -40, 40 )
local SLIDER_VIEWY = gui.Slider( VIEWBOX, "lua_fov_slider_viewY", "Viewmodel Offset Y", 1, -40, 40 )
local SLIDER_VIEWZ = gui.Slider( VIEWBOX, "lua_fov_slider_viewZ", "Viewmodel Offset Z", -1, -40, 40 )
local SKYBOX = gui.Groupbox(TAB, "Skybox", 15, 475, 605, 500)
local SKYBOXCOMBOBOX = gui.Combobox( SKYBOX, "lua_foc_skybox_combobox", "Skybox", "Off", "Space" , "galaxy", "galaxy 2", "Night")
local skyboxset
local betweenshot
callbacks.Register("FireGameEvent", function(event)
if SKYBOXCOMBOBOX:GetValue() == 1 then
skyboxset = "space_13"
elseif SKYBOXCOMBOBOX:GetValue() == 2 then
skyboxset = "sky_descent"
elseif SKYBOXCOMBOBOX:GetValue() == 3 then
skyboxset = "space_14"
elseif SKYBOXCOMBOBOX:GetValue() == 4 then
skyboxset = "night1"
end
if event:GetName() == "round_start" then
client.SetConVar("sv_skyname", skyboxset, true);
end
end)
callbacks.Register( "Draw", function()
if(entities.GetLocalPlayer() ~= nil and engine.GetServerIP() ~= nil and engine.GetMapName() ~= nil) then
local a = 0
local player_local = entities.GetLocalPlayer();
local scoped = player_local:GetProp("m_bIsScoped")
if scoped ~= 0 and scoped ~= 256 and (FOVBETWEENCHECK:GetValue() and tostring(scoped) == "65536") ~= true then
local gWeapon = player_local:GetPropEntity("m_hActiveWeapon")
local zoomLevel = gWeapon:GetProp("m_zoomLevel")
if zoomLevel == 1 then
if SLIDER_ONE:GetValue() == 90 then
a = -40
end
client.SetConVar( "fov_cs_debug", SLIDER_ONE:GetValue(), true )
elseif zoomLevel == 2 then
if SLIDER_TWO:GetValue() == 90 then
a = -40
end
client.SetConVar( "fov_cs_debug", SLIDER_TWO:GetValue(), true )
end
else
client.SetConVar( "fov_cs_debug", SLIDER:GetValue(), true )
end
client.SetConVar("viewmodel_fov", SLIDER_VIEW:GetValue(), true)
client.SetConVar("viewmodel_offset_x", SLIDER_VIEWX:GetValue(), true);
client.SetConVar("viewmodel_offset_y", SLIDER_VIEWY:GetValue(), true);
client.SetConVar("viewmodel_offset_z", SLIDER_VIEWZ:GetValue() + a, true);
end
end)