SHARE
TWEET

Untitled

a guest Jan 26th, 2020 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local bit = require "bit"
  2. local type, bit_band = type, bit.band
  3.  
  4. -- weapon data from @sapphyrus
  5. local weapons, weapons_index = {}, {}
  6. 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"}
  7.  
  8. for idx, weapon in pairs(weapons_data) do
  9.     local console_name, weapon_type = ("weapon_" .. weapon[1]):gsub("weapon_item_", "item_"), weapons_data_types[weapon[2]]
  10.     weapons[idx] = {
  11.         console_name = console_name,
  12.         idx = idx,
  13.         type = weapon_type,
  14.         max_speed = weapon[3],
  15.         price = weapon[4],
  16.         name = weapon[5],
  17.         primary_clip_size = weapon[6],
  18.         cycletime = weapon[7]
  19.     }
  20.     weapons_index[console_name] = weapons[idx]
  21. end
  22.  
  23. local function get_weapon(idx)
  24.     if type(idx) == "string" then
  25.         return weapons_index[idx]
  26.     elseif type(idx) == "number" then
  27.         idx = bit_band(idx, 0xFFFF)
  28.         return rawget(weapons, idx)
  29.     end
  30. end
  31.  
  32. -- entindex->heldweapon_name
  33. local cached_weapons = {}
  34.  
  35. local function delayed_say(text)
  36.     local string = string.format("say %s",text)
  37.     client.exec(string)
  38. end
  39.  
  40. local function on_player_death(e)
  41.     local victim_userid, attacker_userid = e.userid, e.attacker
  42.     if victim_userid == nil or attacker_userid == nil then
  43.         return
  44.     end
  45.  
  46.     local victim_entindex   = client.userid_to_entindex(victim_userid)
  47.     local attacker_entindex = client.userid_to_entindex(attacker_userid)
  48.  
  49.     if attacker_entindex == entity.get_local_player() and entity.is_enemy(victim_entindex) then
  50.         local callout = entity.get_prop(victim_entindex,"m_szLastPlaceName")
  51.         client.log(callout)
  52.         if e.headshot then
  53.             if string.match(callout,"PalaceInterior") then
  54.                 client.delay_call(4,delayed_say,"get headshot u little palace saving tranny")
  55.             else
  56.                 client.delay_call(4,delayed_say,"nice antiaim bro")
  57.             end
  58.         else
  59.             if string.match(callout,"PalaceInterior") then
  60.                 client.delay_call(4,delayed_say,"sit u little palace saving tranny")
  61.             else
  62.                 client.delay_call(4,delayed_say,string.format("nice %s config retard",cached_weapons[victim_entindex]))
  63.             end
  64.         end
  65.     end
  66. end
  67.  
  68. local function run_command(e)
  69.     local players = entity.get_players(true)
  70.     for i=1, #players do
  71.         local idx = players[i]
  72.         if entity.is_alive(idx) then
  73.             local active_weapon = entity.get_prop(idx, "m_hActiveWeapon")
  74.             if active_weapon ~= nil then
  75.                 local active_idx = entity.get_prop(active_weapon, "m_iItemDefinitionIndex")
  76.                 if active_idx ~= nil then
  77.                     active_idx = bit.band(active_idx, 0xFFFF)
  78.                     local weapon_name = string.lower(weapons[active_idx].name)
  79.                     if weapon_name == "g3sg1" then weapon_name = "auto" end
  80.                     if weapon_name == "scar20" then weapon_name = "auto" end
  81.                     if weapon_name == "r8 revolver" then weapon_name = "r8" end
  82.                     if weapon_name == "ssg 08" then weapon_name = "scout" end
  83.                     if weapon_name == "dual berettas" then weapon_name = "dualies" end
  84.                     cached_weapons[idx] = weapon_name
  85.                 end
  86.             end
  87.         end
  88.     end    
  89. end
  90.  
  91. client.set_event_callback("run_command", run_command)
  92. client.set_event_callback("player_death", on_player_death)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top