/* Кнопки там, да... */
UI.AddCheckbox("Display indicator")
UI.AddHotkey("Heavy Pistol Override")
UI.AddSliderInt("Heavy Pistol Mindmg", 0, 130)
UI.AddHotkey("Scout Override")
UI.AddSliderInt("Scout Mindmg", 0, 130)
UI.AddHotkey("AWP Override")
UI.AddSliderInt("AWP Mindmg", 0, 130)
UI.AddHotkey("Auto Override")
UI.AddSliderInt("Auto Mindmg", 0, 130)
UI.AddSliderInt(" ", 0, 0)
/* Переменные */
var heavy_cache = UI.GetValue("Rage", "HEAVY PISTOL", "Targeting", "Minimum damage")
var scout_cache = UI.GetValue("Rage", "SCOUT", "Targeting", "Minimum damage")
var awp_cache = UI.GetValue("Rage", "AWP", "Targeting", "Minimum damage")
var auto_cache = UI.GetValue("Rage", "AUTOSNIPER", "Targeting", "Minimum damage")
/* Чек на активный бинд */
function isActive(a)
{
return UI.IsHotkeyActive("Script items", a)
}
/* Походу, сокращение UI.SetValue() */
function setValue(cat, value)
{
UI.SetValue("Rage", cat.toUpperCase(), "Targeting", "Minimum damage", value)
}
/* Проверка на Р8 || Дигл, хз зачем, не разбираюсь */
function isHeavyPistol(name)
{
if (name == "r8 revolver" || name == "desert eagle")
{
return true
}
}
/* Проверка на Скар || Плётку, хз не знаю зачем, снова */
function isAutoSniper(name)
{
if(name == "scar 20" || weapon_name == "g3sg1")
{
return true
}
}
function onCM()
{
/* Кэш дамага */
heavy_value = UI.GetValue("Script items", "Heavy Pistol Mindmg")
scout_value = UI.GetValue("Script items", "Scout Mindmg")
awp_value = UI.GetValue("Script items", "AWP Mindmg")
auto_value = UI.GetValue("Script items", "Auto Mindmg")
weapon_name = Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))
/* Условия */
if (isActive("Heavy Pistol Override") && isHeavyPistol(weapon_name))
{
setValue("HEAVY PISTOL", heavy_value)
}
else{
setValue("HEAVY PISTOL", heavy_cache)
}
if (isActive("Scout Override") && weapon_name == "ssg 08")
{
setValue("SCOUT", scout_value)
}
else{
setValue("SCOUT", scout_cache)
}
if (isActive("AWP Override") && weapon_name == "awp")
{
setValue("AWP", awp_value)
}
else{
setValue("AWP", awp_cache)
}
if (isActive("Auto Override") && isAutoSniper(weapon_name))
{
setValue("AUTOSNIPER", auto_value)
}
else
{
setValue("AUTOSNIPER", auto_cache)
}
}
/* Индикатор */
function indicator()
{
screen = Render.GetScreenSize()
wep = Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))
x = screen[0]/2
y = screen[1]/2
heavy = "DMG: " + UI.GetValue("Rage", "HEAVY PISTOL", "Targeting", "Minimum damage")
scout = "DMG: " + UI.GetValue("Rage", "SCOUT", "Targeting", "Minimum damage")
awp = "DMG: " + UI.GetValue("Rage", "AWP", "Targeting", "Minimum damage")
auto = "DMG: " + UI.GetValue("Rage", "AUTOSNIPER", "Targeting", "Minimum damage")
var str = ""
if (UI.GetValue("Script items", "Display indicator") && Entity.IsValid(Entity.GetLocalPlayer()) && Entity.IsAlive(Entity.GetLocalPlayer()))
{
if (isHeavyPistol(wep))
{
str = heavy
}
else if(wep == "ssg 08")
{
str = scout
}
else if(wep == "awp")
{
str = awp
}
else if (isAutoSniper(wep))
{
str = auto
}
}
Render.String(x, y, 0, str+"", [255,255,255,255])
}
/* CallBack */
Cheat.RegisterCallback("Draw", "indicator")
Cheat.RegisterCallback("CreateMove", "onCM")