Advertisement
VADemon

Untitled

Aug 25th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.33 KB | None | 0 0
  1. if sample==nil then sample={} end
  2. sample.ut={}
  3.  
  4. -----------------------
  5. -- INITIAL SETUP     --
  6. -----------------------
  7. function initArray(m)
  8.     local array = {}
  9.     for i = 1, m do
  10.         array[i]=0
  11.     end
  12.     return array
  13. end
  14. sample.ut.timer=initArray(32)               -- time of last kill, for each player
  15. sample.ut.level=initArray(32)               -- current kill level (killstreak), for each player
  16. sample.ut.fblood=0                          -- first blood already shed? 0=no/1=yes
  17.  
  18.  
  19. -----------------------
  20. -- PREPARE TO FIGHT! --
  21. -----------------------
  22. addhook("startround","sample.ut.startround")
  23. function sample.ut.startround()
  24.     parse("sv_sound \"fun/prepare.wav\"")
  25.     sample.ut.fblood=0
  26. end
  27.  
  28.  
  29. -----------------------
  30. -- KILL SOUNDS+MSGS  --
  31. -----------------------
  32. addhook("kill","sample.ut.kill")
  33. function sample.ut.kill(killer,victim,weapon)
  34.     -- Was last kill more than 3 secs ago?
  35.  
  36.         -- Reset the timer the dumb victim is dead
  37.         sample.ut.level[victim]=0 --- reset after death
  38.  
  39.     -- Get level of player and increase it
  40.     level=sample.ut.level[killer]
  41.     level=level+1
  42.     sample.ut.level[killer]=level
  43.    
  44.     -- FIRST BLOOD?
  45.     if (sample.ut.fblood==0) then
  46.         sample.ut.fblood=1
  47.         parse("sv_sound \"fun/firstblood.wav\"");
  48.         msg (player(killer,"name").." sheds FIRST BLOOD by killing "..player(victim,"name").."!")
  49.     end
  50.    
  51.     -- HUMILIATION? (KNIFEKILL)
  52.     if (weapon==50) then
  53.         -- HUMILIATION!
  54.         parse("sv_sound \"fun/humiliation.wav\"");
  55.         msg (player(killer,"name").." humiliated "..player(victim,"name").."!")
  56.     else
  57.    
  58.     -- 210180140
  59.         -- REGULAR KILL
  60.         if (level==1) then
  61.             -- 1: Single Kill! Nothing Special!
  62.         elseif (level==2) then
  63.             -- 2: Doublekill
  64.             parse("sv_sound \"fun/doublekill.wav\"");
  65.             msg (player(killer,"name").." made a Doublekill!")
  66.         elseif (level==3) then
  67.             -- 3: Multikill
  68.             parse("sv_sound \"fun/multikill.wav\"")
  69.             msg (player(killer,"name").." made a Multikill!")
  70.         elseif (level==4) then
  71.             -- 4: Ultrakill
  72.             parse("sv_sound \"fun/ultrakill.wav\"")
  73.             msg (player(killer,"name").." made an ULTRAKILL!")
  74.         elseif (level==5) then
  75.             -- 5: Monsterkill
  76.             parse("sv_sound \"fun/monsterkill.wav\"")
  77.             msg (player(killer,"name").." made a MO-O-O-O-ONSTERKILL-ILL-ILL!")
  78.         else
  79.             -- >5: Unstoppable
  80.             parse("sv_sound \"fun/unstoppable.wav\"")
  81.             msg (player(killer,"name").." is UNSTOPPABLE! "..level.." KILLS!")
  82.         end
  83.     end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement