-
Автор темы
- #1
Просьба не пиздить за говнокод. Я давно не кодил
ty sleebu for getWeaponGroup function
Credits: Aimware
Credits: Aimware
JavaScript:
const screen = Global.GetScreenSize(); var x_size = screen[0]; var y_size = screen[1]; UI.AddSliderInt("add_x", 0, x_size); UI.AddSliderInt("add_y", 0, y_size); UI.AddColorPicker("Color");
var weapon_icons = {
"desert eagle": "a",
"dual berettas": "b",
"five seven": "c",
"glock 18": "d",
"ak 47": "e",
"aug": "f",
"awp": "g",
"famas": "h",
"m249": "i",
"g3sg1": "j",
"galil ar": "k",
"m4a4": "l",
"m4a1 s": "m",
"mac 10": "n",
"p2000": "o",
"mp5 sd": "p",
"ump 45": "q",
"xm1014": "r",
"pp bizon": "s",
"mag 7": "t",
"negev": "u",
"sawed off": "v",
"tec 9": "w",
"zeus x27": "x",
"p250": "y",
"mp7": "z",
"mp9": "A",
"nova": "B",
"p90": "C",
"scar 20": "D",
"sg 553": "E",
"ssg 08": "F",
"knife": "G",
"flashbang": "H",
"high explosive grenade": "I",
"smoke grenade": "J",
"molotov": "K",
"decoy grenade": "L",
"incendiary grenade": "M",
"c4 explosive": "N",
"usp s": "P",
"cz75 auto": "Q",
"r8 revolver": "R",
"bayonet": "V",
"flip knife": "W",
"gut knife": "X",
"karambit": "Y",
"m9 bayonet": "Z",
"falchion knife": "1",
"bowie knife": "2",
"butterfly knife": "3",
"shadow daggers": "4",
"ursus knife": "5",
"navaja knife": "6",
"stiletto knife": "7",
"skeleton knife": "8",
"huntsman knife": "0",
"talon knife": "8",
"classic knife": "25",
"paracord knife": "Z",
"survival knife": "Z",
"nomad knife": "Z",
}
var csgo_weapons = {
"0": "none",
"1": "Deagle",
"2": "Dualies",
"3": "Five Seven",
"4": "Glock",
"5": "P228",
"6": "USP",
"7": "AK47",
"8": "AUG",
"9": "AWP",
"10": "FAMAS",
"11": "G3SG1",
"12": "GALIL",
"13": "GALIL",
"14": "M249",
"15": "M3",
"16": "M4A4",
"17": "Mac10",
"18": "MP5",
"19": "P90",
"20": "SSG08",
"21": "SG550",
"22": "SG552",
"23": "TMP",
"24": "UMP45",
"25": "XM1014",
"26": "PP-Bizon",
"27": "MAG7",
"28": "Negev",
"29": "Sawed off",
"30": "Tec-9",
"31": "Taser",
"32": "P2000",
"33": "MP7",
"34": "MP9",
"35": "Nova",
"36": "P250",
"37": "SCAR17",
"38": "SCAR20",
"39": "SG556",
"40": "SSG08",
"41": "Knife",
"42": "Knife",
"43": "flashbang",
"44": "hegrenade",
"45": "smokegrenade",
"46": "molotov",
"47": "decoy",
"48": "incgrenade",
"49": "C4",
"59": "Knife",
"60": "M4A1-S",
"63": "CZ-75",
"64": "Revolver",
"500" : "Knife",
"505" : "Knife",
"506" : "Knife",
"507" : "Knife",
"508" : "Knife",
"509" : "Knife",
"512" : "Knife",
"514" : "Knife",
"515" : "Knife",
"516" : "Knife",
"197108": "Knife",
"197113": "Knife",
"197114": "Knife",
"197115": "Knife",
"197116": "Knife",
"197123": "Knife",
"197120": "Knife",
"197128": "Knife",
"197124": "Knife",
"197130": "Knife",
"197122": "Knife",
"197117": "Knife",
"197131": "Knife",
"197127": "Knife",
"197111": "Knife",
"197125": "Knife",
"197126": "Knife",
"197129": "Knife",
"197133": "Knife",
"262205": "USP",
"262208": "Revolver"
};
function getWeaponName(){
var weapon = Entity.GetProp(Entity.GetWeapon(Entity.GetLocalPlayer()), "DT_WeaponBaseItem", "m_iItemDefinitionIndex");
return csgo_weapons[weapon];
}
function getWeaponGroup(){
var group = "GENERAL";
if(!Entity.IsAlive(Entity.GetLocalPlayer())) return group;
var w = getWeaponName();
if(w === "SSG08") group = "SCOUT"
else if(w === "AWP") group = "AWP";
switch(w){
case "G3SG1":
case "SCAR20":
group = "AUTO"; break;
case "Deagle":
case "Revolver":
group = "HEAVY PISTOL"; break;
case "Dualies":
case "Five Seven":
case "Glock":
case "USP":
case "Tec-9":
case "P2000":
case "P250":
case "CZ-75":
group = "PISTOL"; break;
}
if(!UI.GetValue("Rage", group, "Override default")) group = "GENERAL";
return group;
}
function weaponInfo(){
const x = UI.GetValue("add_x"), y = UI.GetValue("add_y"); var color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Color");
const font = Render.AddFont("Verdana", 7, 0);
var group = getWeaponGroup();
Render.FilledRect(x, y, 150, 20, [15, 15, 15, color[3]]);
Render.FilledRect(x, y - 2, 150, 2, color);
Render.StringCustom(x + 5, y + 3, 0, "weapon info", [0, 0, 0, 255], font);
Render.StringCustom(x + 4, y + 2, 0, "weapon info", [255, 255, 255, 255], font);
Render.StringCustom(x + 2, y + 21, 0, group, [0, 0, 0, 255], font);
Render.StringCustom(x + 1, y + 20, 0, group, [255, 255, 255, 255], font);
var mindmg = "Min-damage: " + UI.GetValue("Rage", group, "Targeting", "Minimum damage");
var hitchance = "Hitchance: " + UI.GetValue("Rage", group, "Accuracy", "Hitchance");
var hitboxes_list = [];
var hitboxes_names = ["Head", "Body", "Body", "Body", "Body", "Body", "Legs", "Legs"];
for(i = 0; i < 8; i++) if(UI.GetValue("Rage", group, "Targeting", "Hitboxes") & (1 << i) && !~hitboxes_list.indexOf(hitboxes_names[i])) hitboxes_list.push(hitboxes_names[i]);
var hitboxes = hitboxes_list.join(", ");
var mindmg_size = Render.TextSizeCustom(mindmg, font);
var hitchance_size = Render.TextSizeCustom(hitchance, font);
var hitboxes_size = Render.TextSizeCustom(hitboxes, font);
Render.StringCustom(x + 151 - mindmg_size[0], y + 21, 0, mindmg, [0, 0, 0, 255], font);
Render.StringCustom(x + 151 - hitchance_size[0], y + 31, 0, hitchance, [0, 0, 0, 255], font);
Render.StringCustom(x + 151 - hitboxes_size[0], y + 41, 0, hitboxes, [0, 0, 0, 255], font);
Render.StringCustom(x - 2, y + 31, 0, weapon_icons[Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))], [0, 0, 0, 255], 5);
Render.StringCustom(x + 150 - mindmg_size[0], y + 20, 0, mindmg, [255, 255, 255, 255], font);
Render.StringCustom(x + 150 - hitchance_size[0], y + 30, 0, hitchance, [255, 255, 255, 255], font);
Render.StringCustom(x + 150 - hitboxes_size[0], y + 40, 0, hitboxes, [255, 255, 255, 255], font);
Render.StringCustom(x - 1, y + 30, 0, weapon_icons[Entity.GetName(Entity.GetWeapon(Entity.GetLocalPlayer()))], [255, 255, 255, 255], 5);
}
Cheat.RegisterCallback("Draw", "weaponInfo")
Последнее редактирование: