//gay and overcomplicated way o_O
const weapon_groups = ["PISTOL", "HEAVY PISTOL", "SCOUT", "AWP", "AUTOSNIPER"];
const weapons = [
[32, 61, 4, 36, 3, 30, 2, 63], //pistols
[1, 64], //heavy pistols
[40], //ssg
[9], //awp
[38, 11] //autos
];
const globals = {
weapon_group: ""
};
const get_current_weapon_group = function(item_definition_index)
{
item_definition_index &= 0xFFFF;
for(var i in weapons)
{
if(weapons[i].some(function(idx) { return idx == item_definition_index; }))
{
return weapon_groups[i];
}
}
return "GENERAL";
};
const on_item_equip = function()
{
if(Entity.IsLocalPlayer(Entity.GetEntityFromUserID(Event.GetInt("userid"))))
{
globals.weapon_group = get_current_weapon_group(Event.GetInt("defindex"));
}
};
const on_move = function()
{
Cheat.Print(UI.GetValue("RAGE", globals.weapon_group, "Targeting", "Minimum damage") + "\n"); //не помню как правильно писалось, вроде так?
};
Cheat.RegisterCallback("item_equip", "on_item_equip");
Cheat.RegisterCallback("CreateMove", "on_move");