Guest User

Untitled

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