Advertisement
Guest User

MJ1284

a guest
Jul 16th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.15 KB | None | 0 0
  1. //Killsounds V0.5
  2. //By 3lionz
  3. //
  4. //Special thanks to:
  5. //Nighthawk043
  6. //RockeyRex
  7.  
  8.  
  9.  
  10.  
  11. //Functions to call when:
  12. addMessageCallback("MsgJoinWelcome", KillSounds_reset);
  13. addMessageCallback("MsgPracticeEnd", KillSounds_reset);
  14. addMessageCallback("MsgPlayerKill", KillSounds_addkd);
  15.  
  16. //Set values
  17. if(!isObject(KillSounds))
  18. {
  19.     new ScriptObject(KillSounds)
  20.     {
  21.         PlayerName = "null";
  22.         Gkills = 0;
  23.         Skills = 0;
  24.     };
  25. }
  26.  
  27. //Reset values
  28. function KillSounds_reset(%a, %b, %c, %d)
  29. {
  30. if(%c !$= "")
  31.     {
  32.         KillSounds.Skills = 0;
  33.         //KillSounds.Gkills = 0;
  34.         KillSounds.PlayerName = KillSounds_strip(%c);
  35.     }
  36. }
  37.  
  38. //Debug
  39. function KillSounds_strip(%name)
  40. {
  41.     echo("KSDebug: ",stripColorCodes(replaceTeamStrings(detag(%name))));
  42.     return stripColorCodes(replaceTeamStrings(detag(%name)));
  43. }
  44.  
  45.  
  46. function KillSounds_addkd(%msgType, %msgString, %c, %d)
  47. {      
  48.     //If you die, reset kill streak
  49.     if(KillSounds_strip(%c) $= KillSounds.PlayerName)
  50.     {
  51.         KillSounds.Skills = 0;
  52.         KillSounds.Skills--;
  53.     }
  54.    
  55.     if(KillSounds_strip(%d) $= KillSounds.PlayerName)
  56.     {  
  57.         //If you kill someone, add to killstreak
  58.         KillSounds.Skills++;
  59.        
  60.         //Groupkills is glitchy, come back later.
  61.         //KillSounds.Gkills++;
  62.         //If there is one kill, play "FirstBlood"
  63.         /* if(KillSounds.Gkills $= 1)
  64.         {
  65.             sfxPlayOnce(FirstBlood);
  66.         } */
  67.         if(KillSounds.Skills $= 3)
  68.         {
  69.             sfxPlayOnce(KillingSpree);
  70.         }
  71.         if(KillSounds.Skills $= 4)
  72.         {
  73.             sfxPlayOnce(Rampage);
  74.         }
  75.         if(KillSounds.Skills $= 5)
  76.         {
  77.             sfxPlayOnce(Dominating);
  78.         }
  79.         if(KillSounds.Skills $= 6)
  80.         {
  81.             sfxPlayOnce(Unstoppable);
  82.         }
  83.         if(KillSounds.Skills $= 7)
  84.         {
  85.             sfxPlayOnce(Godlike);
  86.         }
  87.         if(KillSounds.Skills >= 8 && KillSounds.Skills < 15)
  88.         {
  89.             sfxPlayOnce(Ownage);
  90.         }
  91.         if(KillSounds.Skills >= 15)
  92.         {
  93.             sfxPlayOnce(MJ1284);
  94.         }
  95.         echo("KS: Solo Kills: ", KillSounds.Skills);
  96.         //echo(KillSounds.Gkills);
  97.     }
  98. }
  99.  
  100. //Add the sounds :)
  101. package KillSounds
  102. {
  103.     function Audio::initialize( )
  104.     {
  105.         parent::initialize( );
  106.         new SFXProfile(FirstBlood)
  107.         {
  108.             filename = "mods/autoexec/KillSounds/firstblood.wav";
  109.             description = AudioGui;
  110.             preload = true;
  111.         };
  112.         new SFXProfile(KillingSpree)
  113.         {
  114.             filename = "mods/autoexec/KillSounds/Killing_Spree.wav";
  115.             description = AudioGui;
  116.             preload = true;
  117.         };
  118.         new SFXProfile(Rampage)
  119.         {
  120.             filename = "mods/autoexec/KillSounds/Rampage.wav";
  121.             description = AudioGui;
  122.             preload = true;
  123.         };
  124.         new SFXProfile(Dominating)
  125.         {
  126.             filename = "mods/autoexec/KillSounds/Dominating.wav";
  127.             description = AudioGui;
  128.             preload = true;
  129.         };
  130.         new SFXProfile(Unstoppable)
  131.         {
  132.             filename = "mods/autoexec/KillSounds/Unstoppable.wav";
  133.             description = AudioGui;
  134.             preload = true;
  135.         };
  136.         new SFXProfile(GodLike)
  137.         {
  138.             filename = "mods/autoexec/KillSounds/GodLike.wav";
  139.             description = AudioGui;
  140.             preload = true;
  141.         };
  142.         new SFXProfile(Ownage)
  143.         {
  144.             filename = "mods/autoexec/KillSounds/Ownage.wav";
  145.             description = AudioGui;
  146.             preload = true;
  147.         };
  148.         new SFXProfile(MJ1284)
  149.         {
  150.             filename = "mods/autoexec/KillSounds/MJ1284.wav";
  151.             description = AudioGui;
  152.             preload = true;
  153.         };
  154.     }
  155. };
  156. activatepackage(KillSounds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement