Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bit = require "bit"
- local type, bit_band = type, bit.band
- -- weapon data from @sapphyrus
- local weapons, weapons_index = {}, {}
- local weapons_data, weapons_data_types = {[1]={"deagle",1,230,700,"Desert Eagle",7,0.225},[2]={"elite",1,240,400,"Dual Berettas",30,0.12},[3]={"fiveseven",1,240,500,"Five-SeveN",20,0.15},[4]={"glock",1,240,200,"Glock-18",20,0.15},[7]={"ak47",2,215,2700,"AK-47",30,0.1},[8]={"aug",2,220,3300,"AUG",30,0.09},[9]={"awp",2,200,4750,"AWP",10,1.455},[10]={"famas",2,220,2250,"FAMAS",25,0.09},[11]={"g3sg1",2,215,5000,"G3SG1",20,0.25},[13]={"galilar",2,215,2000,"Galil AR",35,0.09},[14]={"m249",3,195,5200,"M249",100,0.08},[16]={"m4a1",2,225,3100,"M4A4",30,0.09},[17]={"mac10",4,240,1050,"MAC-10",30,0.075},[19]={"p90",4,230,2350,"P90",50,0.07},[23]={"mp5sd",4,235,1500,"MP5-SD",30,0.08},[24]={"ump45",4,230,1200,"UMP-45",25,0.09},[25]={"xm1014",3,215,2000,"XM1014",7,0.35},[26]={"bizon",4,240,1400,"PP-Bizon",64,0.08},[27]={"mag7",3,225,1300,"MAG-7",5,0.85},[28]={"negev",3,150,1700,"Negev",150,0.075},[29]={"sawedoff",3,210,1100,"Sawed-Off",7,0.85},[30]={"tec9",1,240,500,"Tec-9",18,0.12},[31]={"taser",5,220,200,"Zeus x27",1,0.15},[32]={"hkp2000",1,240,200,"P2000",13,0.17},[33]={"mp7",4,220,1500,"MP7",30,0.08},[34]={"mp9",4,240,1250,"MP9",30,0.07},[35]={"nova",3,220,1050,"Nova",8,0.88},[36]={"p250",1,240,300,"P250",13,0.15},[38]={"scar20",2,215,5000,"SCAR-20",20,0.25},[39]={"sg556",2,210,2750,"SG 553",30,0.09},[40]={"ssg08",2,230,1700,"SSG 08",10,1.25},[41]={"knifegg",6,250,0,"Knife",-1,0.15},[42]={"knife",6,250,0,"Knife",-1,0.15},[43]={"flashbang",7,245,200,"Flashbang",-1,0.15},[44]={"hegrenade",7,245,300,"High Explosive Grenade",-1,0.15},[45]={"smokegrenade",7,245,300,"Smoke Grenade",-1,0.15},[46]={"molotov",7,245,400,"Molotov",-1,0.15},[47]={"decoy",7,245,50,"Decoy Grenade",-1,0.15},[48]={"incgrenade",7,245,600,"Incendiary Grenade",-1,0.15},[49]={"c4",8,250,0,"C4 Explosive",-1,0.15},[50]={"item_kevlar",5,1,650,"Kevlar Vest",-1,0.15},[51]={"item_assaultsuit",5,1,1000,"Kevlar + Helmet",-1,0.15},[52]={"item_heavyassaultsuit",5,1,6000,"Heavy Assault Suit",-1,0.15},[55]={"item_defuser",5,1,400,"Defuse Kit",-1,0.15},[56]={"item_cutters",5,1,400,"Rescue Kit",-1,0.15},[57]={"healthshot",9,250,0,"Medi-Shot",-1,0.15},[59]={"knife_t",6,250,0,"Knife",-1,0.15},[60]={"m4a1_silencer",2,225,3100,"M4A1-S",25,0.1},[61]={"usp_silencer",1,240,200,"USP-S",12,0.17},[63]={"cz75a",1,240,500,"CZ75-Auto",12,0.1},[64]={"revolver",1,180,600,"R8 Revolver",8,0.5},[68]={"tagrenade",7,245,100,"Tactical Awareness Grenade",-1,0.15},[69]={"fists",6,275,0,"Bare Hands",-1,0.15},[70]={"breachcharge",8,245,300,"Breach Charge",3,0.15},[72]={"tablet",10,220,300,"Tablet",1,0.15},[74]={"melee",6,250,0,"Knife",-1,0.15},[75]={"axe",6,250,0,"Axe",-1,0.15},[76]={"hammer",6,250,0,"Hammer",-1,0.15},[78]={"spanner",6,250,0,"Wrench",-1,0.15},[80]={"knife_ghost",6,250,0,"Spectral Shiv",-1,0.15},[81]={"firebomb",7,245,400,"Fire Bomb",-1,0.15},[82]={"diversion",7,245,50,"Diversion Device",-1,0.15},[83]={"frag_grenade",7,245,300,"Frag Grenade",-1,0.15},[84]={"snowball",7,245,100,"Snowball",-1,0.15},[500]={"bayonet",6,250,0,"Bayonet",-1,0.15},[505]={"knife_flip",6,250,0,"Flip Knife",-1,0.15},[506]={"knife_gut",6,250,0,"Gut Knife",-1,0.15},[507]={"knife_karambit",6,250,0,"Karambit",-1,0.15},[508]={"knife_m9_bayonet",6,250,0,"M9 Bayonet",-1,0.15},[509]={"knife_tactical",6,250,0,"Huntsman Knife",-1,0.15},[512]={"knife_falchion",6,250,0,"Falchion Knife",-1,0.15},[514]={"knife_survival_bowie",6,250,0,"Bowie Knife",-1,0.15},[515]={"knife_butterfly",6,250,0,"Butterfly Knife",-1,0.15},[516]={"knife_push",6,250,0,"Shadow Daggers",-1,0.15},[519]={"knife_ursus",6,250,0,"Ursus Knife",-1,0.15},[520]={"knife_gypsy_jackknife",6,250,0,"Navaja Knife",-1,0.15},[522]={"knife_stiletto",6,250,0,"Stiletto Knife",-1,0.15},[523]={"knife_widowmaker",6,250,0,"Talon Knife",-1,0.15},[1349]={"spraypaint",11,250,0,"Graffiti",0,0}}, {"secondary","rifle","heavy","smg","equipment","melee","grenade","c4","boost","utility","spray"}
- for idx, weapon in pairs(weapons_data) do
- local console_name, weapon_type = ("weapon_" .. weapon[1]):gsub("weapon_item_", "item_"), weapons_data_types[weapon[2]]
- weapons[idx] = {
- console_name = console_name,
- idx = idx,
- type = weapon_type,
- max_speed = weapon[3],
- price = weapon[4],
- name = weapon[5],
- primary_clip_size = weapon[6],
- cycletime = weapon[7]
- }
- weapons_index[console_name] = weapons[idx]
- end
- local function get_weapon(idx)
- if type(idx) == "string" then
- return weapons_index[idx]
- elseif type(idx) == "number" then
- idx = bit_band(idx, 0xFFFF)
- return rawget(weapons, idx)
- end
- end
- -- entindex->heldweapon_name
- local cached_weapons = {}
- local function delayed_say(text)
- local string = string.format("say %s",text)
- client.exec(string)
- end
- local function on_player_death(e)
- local victim_userid, attacker_userid = e.userid, e.attacker
- if victim_userid == nil or attacker_userid == nil then
- return
- end
- local victim_entindex = client.userid_to_entindex(victim_userid)
- local attacker_entindex = client.userid_to_entindex(attacker_userid)
- if attacker_entindex == entity.get_local_player() and entity.is_enemy(victim_entindex) then
- local callout = entity.get_prop(victim_entindex,"m_szLastPlaceName")
- client.log(callout)
- if e.headshot then
- if string.match(callout,"PalaceInterior") then
- client.delay_call(4,delayed_say,"get headshot u little palace saving tranny")
- else
- client.delay_call(4,delayed_say,"nice antiaim bro")
- end
- else
- if string.match(callout,"PalaceInterior") then
- client.delay_call(4,delayed_say,"sit u little palace saving tranny")
- else
- client.delay_call(4,delayed_say,string.format("nice %s config retard",cached_weapons[victim_entindex]))
- end
- end
- end
- end
- local function run_command(e)
- local players = entity.get_players(true)
- for i=1, #players do
- local idx = players[i]
- if entity.is_alive(idx) then
- local active_weapon = entity.get_prop(idx, "m_hActiveWeapon")
- if active_weapon ~= nil then
- local active_idx = entity.get_prop(active_weapon, "m_iItemDefinitionIndex")
- if active_idx ~= nil then
- active_idx = bit.band(active_idx, 0xFFFF)
- local weapon_name = string.lower(weapons[active_idx].name)
- if weapon_name == "g3sg1" then weapon_name = "auto" end
- if weapon_name == "scar20" then weapon_name = "auto" end
- if weapon_name == "r8 revolver" then weapon_name = "r8" end
- if weapon_name == "ssg 08" then weapon_name = "scout" end
- if weapon_name == "dual berettas" then weapon_name = "dualies" end
- cached_weapons[idx] = weapon_name
- end
- end
- end
- end
- end
- client.set_event_callback("run_command", run_command)
- client.set_event_callback("player_death", on_player_death)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement