Guest User

Untitled

a guest
Dec 11th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.48 KB | None | 0 0
  1. import es
  2. import playerlib
  3. import gamethread
  4. #import random
  5.  
  6. overlaypath = "overlays/rockssuicide.vtf" #The path and name for your overlay
  7. overlaypath2 = "overlays/rocksmultikill.vtf" # Multikill overlay path
  8. overlaypath3 = "overlays/rockskillstreak.vtf" # Killstreak overlay path
  9. overlaypath4 = "overlays/rocksheadshot.vtf" # Headshot overlay path
  10. overlaypath5 = "overlays/rocksgrenade.vtf" # Grenade overlay path
  11. overlaypath6 = "overlays/rockscrowbar.vtf" # Crowbar/Stunstick overlay path
  12. overlaypath7 = "overlays/rocksslamkiller.vtf" # Slams overlaypath for killer
  13. overlaypath8 = "overlays/rocksslamvictim.vtf" # Slams overlaypath for victim
  14. overlaypath9 = "overlays/rocksbonus.vtf" # Bonus Overlay path
  15. overlaypath10 = "killmessages/mgt_2.vtf" # 11 kills to go
  16. overlaypath11 = "killmessages/mgt_3.vtf" # 10 kills to go
  17. overlaypath12 = "killmessages/mgt_4.vtf" # 9 kills to go
  18. overlaypath13 = "killmessages/mgt_5.vtf" # 8 kills to go
  19. overlaypath14 = "killmessages/mgt_6.vtf" # 6 kills to go
  20. overlaypath15 = "killmessages/mgt_7.vtf" # 5 kills to go
  21. overlaypath16 = "killmessages/mgt_8.vtf" # 4 kills to go
  22. overlaypath17 = "killmessages/mgt_9.vtf" # 3 kills to go
  23. overlaypath18 = "killmessages/mgt_10.vtf" # 2 kills to go
  24. overlaypath19 = "killmessages/mgt_11.vtf" # 1 kill to go
  25.  
  26. overlaypath20 = "overlays/bloodvision-a.vtf" # normal deathoverlay 1
  27. overlaypath21 = "overlays/bloodvision-b.vtf" # normal deathoverlay 2
  28. overlaypath22 = "overlays/bloodvision-c.vtf" # normal deathoverlay 3
  29. overlaypath23 = "overlays/bloodvision-g.vtf" # normal deathoverlay 4
  30. overlaypath24 = "overlays/bloodvision-h.vtf" # normal deathoverlay 5
  31.  
  32. overlaypath25 = "overlays/rockspostaldeath.vtf" # 12+ killstreak deathoverlay
  33.  
  34.  
  35. deathoverlays = ['overlaypath20', 'overlaypath21', 'overlaypath22', 'overlaypath23', 'overlaypath24', 'overlaypath20']
  36.  
  37. Time = 3 #How long the overlay will be displayed
  38.  
  39. killdict = {}
  40.  
  41. def load():
  42.     es.msg('loaded')
  43.     download()
  44.     for userid in es.getUseridList():
  45.         killdict[userid] = {}
  46.         killdict[userid]['kills'] = 0
  47.         killdict[userid]['killstreak'] = 0
  48.         killdict[userid]['slamkills'] = 0
  49.  
  50. def unload():
  51.     for userid in es.getUseridList():
  52.         del killdict[userid]
  53.  
  54. def es_map_start(ev):
  55.     download()
  56.     killdict.clear()
  57.  
  58. def download():
  59.     es.stringtable('downloadables', 'materials/%s' %overlaypath)
  60.     es.stringtable('downloadables', 'materials/%s' %overlaypath.replace('vtf', 'vmt'))
  61.     es.stringtable('downloadables', 'materials/%s' %overlaypath2)
  62.     es.stringtable('downloadables', 'materials/%s' %overlaypath2.replace('vtf', 'vmt'))
  63.     es.stringtable('downloadables', 'materials/%s' %overlaypath3)
  64.     es.stringtable('downloadables', 'materials/%s' %overlaypath3.replace('vtf', 'vmt'))
  65.     es.stringtable('downloadables', 'materials/%s' %overlaypath4)
  66.     es.stringtable('downloadables', 'materials/%s' %overlaypath4.replace('vtf', 'vmt'))
  67.     es.stringtable('downloadables', 'materials/%s' %overlaypath5)
  68.     es.stringtable('downloadables', 'materials/%s' %overlaypath5.replace('vtf', 'vmt'))
  69.     es.stringtable('downloadables', 'materials/%s' %overlaypath6)
  70.     es.stringtable('downloadables', 'materials/%s' %overlaypath6.replace('vtf', 'vmt'))
  71.     es.stringtable('downloadables', 'materials/%s' %overlaypath7)
  72.     es.stringtable('downloadables', 'materials/%s' %overlaypath7.replace('vtf', 'vmt'))
  73.     es.stringtable('downloadables', 'materials/%s' %overlaypath8)
  74.     es.stringtable('downloadables', 'materials/%s' %overlaypath8.replace('vtf', 'vmt'))
  75.     es.stringtable('downloadables', 'materials/%s' %overlaypath9)
  76.     es.stringtable('downloadables', 'materials/%s' %overlaypath9.replace('vtf', 'vmt'))
  77.     es.stringtable('downloadables', 'materials/%s' %overlaypath10)
  78.     es.stringtable('downloadables', 'materials/%s' %overlaypath10.replace('vtf', 'vmt'))
  79.     es.stringtable('downloadables', 'materials/%s' %overlaypath11)
  80.     es.stringtable('downloadables', 'materials/%s' %overlaypath11.replace('vtf', 'vmt'))
  81.     es.stringtable('downloadables', 'materials/%s' %overlaypath12)
  82.     es.stringtable('downloadables', 'materials/%s' %overlaypath12.replace('vtf', 'vmt'))
  83.     es.stringtable('downloadables', 'materials/%s' %overlaypath13)
  84.     es.stringtable('downloadables', 'materials/%s' %overlaypath13.replace('vtf', 'vmt'))
  85.     es.stringtable('downloadables', 'materials/%s' %overlaypath14)
  86.     es.stringtable('downloadables', 'materials/%s' %overlaypath14.replace('vtf', 'vmt'))
  87.     es.stringtable('downloadables', 'materials/%s' %overlaypath15)
  88.     es.stringtable('downloadables', 'materials/%s' %overlaypath15.replace('vtf', 'vmt'))
  89.     es.stringtable('downloadables', 'materials/%s' %overlaypath16)
  90.     es.stringtable('downloadables', 'materials/%s' %overlaypath16.replace('vtf', 'vmt'))
  91.     es.stringtable('downloadables', 'materials/%s' %overlaypath17)
  92.     es.stringtable('downloadables', 'materials/%s' %overlaypath17.replace('vtf', 'vmt'))
  93.     es.stringtable('downloadables', 'materials/%s' %overlaypath18)
  94.     es.stringtable('downloadables', 'materials/%s' %overlaypath18.replace('vtf', 'vmt'))
  95.     es.stringtable('downloadables', 'materials/%s' %overlaypath19)
  96.     es.stringtable('downloadables', 'materials/%s' %overlaypath19.replace('vtf', 'vmt'))
  97.     es.stringtable('downloadables', 'materials/%s' %overlaypath20)
  98.     es.stringtable('downloadables', 'materials/%s' %overlaypath20.replace('vtf', 'vmt'))
  99.     es.stringtable('downloadables', 'materials/%s' %overlaypath21)
  100.     es.stringtable('downloadables', 'materials/%s' %overlaypath21.replace('vtf', 'vmt'))
  101.     es.stringtable('downloadables', 'materials/%s' %overlaypath22)
  102.     es.stringtable('downloadables', 'materials/%s' %overlaypath22.replace('vtf', 'vmt'))
  103.     es.stringtable('downloadables', 'materials/%s' %overlaypath23)
  104.     es.stringtable('downloadables', 'materials/%s' %overlaypath23.replace('vtf', 'vmt'))
  105.     es.stringtable('downloadables', 'materials/%s' %overlaypath24)
  106.     es.stringtable('downloadables', 'materials/%s' %overlaypath24.replace('vtf', 'vmt'))
  107.     es.stringtable('downloadables', 'materials/%s' %overlaypath25)
  108.     es.stringtable('downloadables', 'materials/%s' %overlaypath25.replace('vtf', 'vmt'))
  109.  
  110. def player_activate(ev):
  111.     userid = int(ev['userid'])
  112.     killdict[userid] = {}
  113.     killdict[userid]['kills'] = 0
  114.     killdict[userid]['killstreak'] = 0
  115.     killdict[userid]['slamkills'] = 0
  116.  
  117. def player_disconnect(ev):
  118.     userid = int(ev['userid'])
  119.     if userid in killdict:
  120.         del killdict[userid]
  121.  
  122. def player_death(ev):
  123.     userid = int(ev['userid'])
  124.     attacker = int(ev['attacker'])
  125.     userteam = int(ev['es_userteam'])
  126.     attackerteam = int(ev['es_attackerteam'])
  127.     player = playerlib.getPlayer(attacker)
  128.     weapon = ev['weapon']
  129.     if userid == attacker:
  130.         es.cexec(userid, 'r_screenoverlay %s'%overlaypath)
  131.         gamethread.delayed(Time, v_stopoverlay, (userid))
  132.     else:
  133.         gamethread.delayed(1, resetkills, (attacker))
  134.         killdict[attacker]['kills'] += 1
  135.         if killdict[attacker]['kills'] >= 2:
  136.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath2)
  137.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  138.         killdict[attacker]['killstreak'] += 1
  139.  
  140.         if killdict[attacker]['killstreak'] == 1:
  141.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath10)
  142.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  143.  
  144.         elif killdict[attacker]['killstreak'] == 2:
  145.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath11)
  146.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  147.  
  148.         elif killdict[attacker]['killstreak'] == 3:
  149.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath12)
  150.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  151.  
  152.         elif killdict[attacker]['killstreak'] == 4:
  153.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath13)
  154.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  155.  
  156.         elif killdict[attacker]['killstreak'] == 5:
  157.             player.health += 200
  158.             es.tell(attacker, '#multi', '#lightgreen5 Killstreak: #greenYou got 200 HP for killing 5 enemies in a row.')
  159.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath9)
  160.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  161.  
  162.         elif killdict[attacker]['killstreak'] == 6:
  163.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath14)
  164.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  165.  
  166.         elif killdict[attacker]['killstreak'] == 7:
  167.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath15)
  168.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  169.  
  170.         elif killdict[attacker]['killstreak'] == 8:
  171.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath16)
  172.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  173.  
  174.         elif killdict[attacker]['killstreak'] == 9:
  175.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath17)
  176.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  177.  
  178.         elif killdict[attacker]['killstreak'] == 10:
  179.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath18)
  180.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  181.  
  182.         elif killdict[attacker]['killstreak'] == 11:
  183.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath19)
  184.             gamethread.delayed(Time, a_stopoverlay, (attacker))
  185.  
  186.         elif killdict[attacker]['killstreak'] == 12:
  187.             es.cexec(attacker, 'r_screenoverlay %s'%overlaypath3)
  188.             player.godmode(1)
  189.             gamethread.delayed(60, resetgodmode, (attacker))
  190.             es.tell(attacker, '#multi', '#lightgreen12 Killstreak: #greenGodmode has been activated for 60 seconds!')
  191.             gamethread.delayed(50, godmodetimeleft, (attacker))
  192.             es.msg('#multi', '[#green12 killstreak#default] %s #greenhas now godmode for 60 seconds!' %es.getplayername(attacker))
  193.  
  194.         if killdict[attacker]['killstreak'] < 12:
  195.             if weapon == 'grenade_frag':
  196.                 if not killdict[attacker]['kills'] >= 2:
  197.                     es.cexec(attacker, 'r_screenoverlay %s'%overlaypath5)
  198.  
  199.             elif weapon == 'slam':
  200.                 killdict[attacker]['slamkills'] += 1
  201.                 if killdict[attacker]['slamkills'] >= 3:
  202.                     es.cexec(attacker, 'r_screenoverlay %s'%overlaypath7)
  203.                 es.cexec(userid, 'r_screenoverlay %s'%overlaypath8)
  204.                 gamethread.delayed(Time, v_stopoverlay, (userid))
  205.  
  206.             elif weapon in ('crowbar', 'stunstick'):
  207.                 es.cexec(attacker, 'r_screenoverlay %s'%overlaypath6)
  208.                 gamethread.delayed(Time, a_stopoverlay, (attacker))
  209.  
  210.     #if killdict[userid]['killstreak'] < 12:
  211.         #es.cexec(userid, 'r_screenoverlay %s' %random.choice(deathoverlays))
  212.         #gamethread.delayed(Time, v_stopoverlay, (userid))
  213.  
  214.     if killdict[userid]['killstreak'] >= 12:
  215.         es.cexec(userid, 'r_screenoverlay %s'%overlaypath25)
  216.         gamethread.delayed(Time, v_stopoverlay, (userid))
  217.     killdict[userid]['slamkills'] = 0
  218.     killdict[userid]['killstreak'] = 0
  219.  
  220. def v_stopoverlay(userid):
  221.     es.cexec(userid, 'r_screenoverlay 0')
  222.  
  223. def a_stopoverlay(attacker):
  224.     es.cexec(attacker, 'r_screenoverlay 0')
  225.  
  226. def resetkills(attacker):
  227.     killdict[attacker]['kills'] = 0
  228.  
  229. def resetgodmode(attacker):
  230.     player = playerlib.getPlayer(attacker)
  231.     player.godmode(0)
  232.  
  233. def godmodetimeleft(attacker):
  234.     es.tell(attacker, '#multi', '#lightgreen12 Killstreak: #greenGodmode being active for 10 seconds.')
Add Comment
Please, Sign In to add comment