-
Автор темы
- #1
crosshair/scope lines doubletap indicator (otc & otv4)
JavaScript:
// varden#9999
var def_color = [Convar.GetInt("cl_crosshaircolor_r"), Convar.GetInt("cl_crosshaircolor_g"), Convar.GetInt("cl_crosshaircolor_b"), 255]
UI.AddSubTab(["Visuals", "SUBTAB_MGR"], "DT Crosshair")
UI.AddCheckbox(["Visuals", "DT Crosshair", "DT Crosshair"], "Crosshair")
UI.AddCheckbox(["Visuals", "DT Crosshair", "DT Crosshair"], "Scope")
UI.AddColorPicker(["Visuals", "DT Crosshair", "DT Crosshair"], "Default color")
UI.AddColorPicker(["Visuals", "DT Crosshair", "DT Crosshair"], "Doubletap color")
UI.AddColorPicker(["Visuals", "DT Crosshair", "DT Crosshair"], "Recharge color")
UI.SetColor(["Visuals", "DT Crosshair", "DT Crosshair", "Default color"], def_color)
function Draw()
{
def_color = UI.GetColor(["Visuals", "DT Crosshair", "DT Crosshair", "Default color"])
var dt_color = UI.GetColor(["Visuals", "DT Crosshair", "DT Crosshair", "Doubletap color"])
var charg_color = UI.GetColor(["Visuals", "DT Crosshair", "DT Crosshair", "Recharge color"])
if (!Entity.IsAlive(Entity.GetLocalPlayer())) return
// crosshair module
if (UI.GetValue(["Visuals", "DT Crosshair", "DT Crosshair", "Crosshair"]) && UI.GetValue(["Rage", "Exploits", "Key assignment", "Double tap"]))
{
if (Exploit.GetCharge() == 1)
{
Convar.SetFloat("cl_crosshaircolor_r", dt_color[0])
Convar.SetFloat("cl_crosshaircolor_g", dt_color[1])
Convar.SetFloat("cl_crosshaircolor_b", dt_color[2])
}
else
{
Convar.SetFloat("cl_crosshaircolor_r", charg_color[0])
Convar.SetFloat("cl_crosshaircolor_g", charg_color[1])
Convar.SetFloat("cl_crosshaircolor_b", charg_color[2])
}
}
else
{
Convar.SetFloat("cl_crosshaircolor_r", def_color[0])
Convar.SetFloat("cl_crosshaircolor_g", def_color[1])
Convar.SetFloat("cl_crosshaircolor_b", def_color[2])
}
// scope module
if (UI.GetValue(["Visuals", "DT Crosshair", "DT Crosshair", "Scope"]) && UI.GetValue(["Rage", "Exploits", "Key assignment", "Double tap"]) && Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayer", "m_bIsScoped"))
{
var x = Render.GetScreenSize()[0]
var y = Render.GetScreenSize()[1]
if (Exploit.GetCharge() == 1)
{
Render.Line(0, y / 2, x, y / 2, dt_color)
Render.Line(x / 2, 0, x / 2, y, dt_color)
}
else
{
Render.Line(0, y / 2, x, y / 2, charg_color)
Render.Line(x / 2, 0, x / 2, y, charg_color)
}
}
}
function Unload()
{
Convar.SetFloat("cl_crosshaircolor_r", def_color[0])
Convar.SetFloat("cl_crosshaircolor_g", def_color[1])
Convar.SetFloat("cl_crosshaircolor_b", def_color[2])
}
Cheat.RegisterCallback("Unload", "Unload")
Cheat.RegisterCallback("Draw", "Draw")
JavaScript:
// varden#9999
var def_color = [Convar.GetInt("cl_crosshaircolor_r"), Convar.GetInt("cl_crosshaircolor_g"), Convar.GetInt("cl_crosshaircolor_b"), 255]
UI.AddCheckbox("Crosshair")
UI.AddCheckbox("Scope")
UI.AddColorPicker("Default color")
UI.AddColorPicker("Doubletap color")
UI.AddColorPicker("Recharge color")
UI.SetColor("Script items", "Default color", def_color)
function Draw()
{
def_color = UI.GetColor("Script items", "Default color")
var dt_color = UI.GetColor("Script items", "Doubletap color")
var charg_color = UI.GetColor("Script items", "Recharge color")
if (!Entity.IsAlive(Entity.GetLocalPlayer())) return
// crosshair module
if (UI.GetValue("Script items", "Crosshair") && UI.IsHotkeyActive("Rage", "GENERAL", "Exploits", "Doubletap"))
{
if (Exploit.GetCharge() == 1)
{
Convar.SetFloat("cl_crosshaircolor_r", dt_color[0])
Convar.SetFloat("cl_crosshaircolor_g", dt_color[1])
Convar.SetFloat("cl_crosshaircolor_b", dt_color[2])
}
else
{
Convar.SetFloat("cl_crosshaircolor_r", charg_color[0])
Convar.SetFloat("cl_crosshaircolor_g", charg_color[1])
Convar.SetFloat("cl_crosshaircolor_b", charg_color[2])
}
}
else
{
Convar.SetFloat("cl_crosshaircolor_r", def_color[0])
Convar.SetFloat("cl_crosshaircolor_g", def_color[1])
Convar.SetFloat("cl_crosshaircolor_b", def_color[2])
}
// scope module
if (UI.GetValue("Script items", "Scope") && UI.IsHotkeyActive("Rage", "GENERAL", "Exploits", "Doubletap") && Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayer", "m_bIsScoped"))
{
var x = Render.GetScreenSize()[0]
var y = Render.GetScreenSize()[1]
if (Exploit.GetCharge() == 1)
{
Render.Line(0, y / 2, x, y / 2, dt_color)
Render.Line(x / 2, 0, x / 2, y, dt_color)
}
else
{
Render.Line(0, y / 2, x, y / 2, charg_color)
Render.Line(x / 2, 0, x / 2, y, charg_color)
}
}
}
function Unload()
{
Convar.SetFloat("cl_crosshaircolor_r", def_color[0])
Convar.SetFloat("cl_crosshaircolor_g", def_color[1])
Convar.SetFloat("cl_crosshaircolor_b", def_color[2])
}
Cheat.RegisterCallback("Unload", "Unload")
Cheat.RegisterCallback("Draw", "Draw")