Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Rankup sound on kill
#1
I have asked before but since the addon has been updated and the game obviously, can anyone please do a simple mod that on say 6/7 kills it plays the sound of either "rankup" (dunno what its called) if possible please.

I'm not after stats or kill messages just the sound on kills. Would also be nice if this could be set in sv_config (if possible) so amount of kills can be set and as this is for Infected maybe a different one for them???
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#2
The actual playing of the sound should work like this
CSHARP Code
  1. PlaySoundOnPlayer(Client, "mp_level_up");
[Image: azuw.jpg]
Reply

#3
(09-14-2012, 14:11)zxz0O0 Wrote: The actual playing of the sound should work like this
CSHARP Code
  1. PlaySoundOnPlayer(Client, "mp_level_up");

Thanks, how would i revert this to a plugin on an amount of kills, sorry but this sort of mod i'm at a total loss? else having this on every kill would be err overkill so to speak.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#4
Depends if you really want it on the amount of kills or killstreak. If you want killstreak you need to make a Dictionary and increase/revert to 0 in OnPlayerDamage.
[Image: azuw.jpg]
Reply

#5
killstreaks would be fine
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#6
CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4.  
  5. namespace sound
  6. {
  7. public class Class1:CPlugin
  8. {
  9. public Dictionary<int, int> Kills = new Dictionary<int, int>();
  10. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
  11. {
  12. if (Damage >= Victim.Other.Health)
  13. {
  14. Kills[Attacker.ClientNum]++;
  15. }
  16. if (Kills[Attacker.ClientNum]==int.Parse(GetServerCFG("SOUND","kills","6")))
  17. {
  18. PlaySoundOnPlayer(Attacker, "mp_level_up");
  19. Kills[Attacker.ClientNum] = 0;
  20. }
  21. return base.OnPlayerDamaged(Attacker, Victim, Weapon, Damage, DamageMod, HitLocation);
  22. }
  23. public override void OnPlayerConnect(ServerClient Client)
  24. {
  25. Kills.Add(Client.ClientNum, 0);
  26. base.OnPlayerConnect(Client);
  27. }
  28. public override void OnPlayerDisconnect(ServerClient Client)
  29. {
  30. Kills.Remove(Client.ClientNum);
  31. base.OnPlayerDisconnect(Client);
  32. }
  33. }
  34.  
  35. }

This should work (not tested).Set this in sv_config.ini
Code:
[SOUND]
kills=4
//Sound to be played after number of kills
Reply

#7
Thankyou very much.


Error 5 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Users\test\documents\visual studio 2010\Projects\new sound\new sound\Class1.cs 3 14 new sound
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#8
Awesome. Maybe I can use this to make my first plugin. I am always dying to have the first blood message from infected in other game modes.

Do you know the sound that is used for that?

Would it be easy to modify as such?

Rather than being for so many kills, just a sound for the first blood.

Maybe one day HudElem could add the pop up first blood message?

Bare in mind Ive never done anything with c# lol.
Reply

#9
(09-14-2012, 16:38)hillbilly Wrote: Thankyou very much.


Error 5 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Users\test\documents\visual studio 2010\Projects\new sound\new sound\Class1.cs 3 14 new sound

Try now

(09-14-2012, 16:59)NooB_StalkeR Wrote: Awesome. Maybe I can use this to make my first plugin. I am always dying to have the first blood message from infected in other game modes.

Do you know the sound that is used for that?

Would it be easy to modify as such?

Rather than being for so many kills, just a sound for the first blood.

Maybe one day HudElem could add the pop up first blood message?

Bare in mind Ive never done anything with c# lol.

I am working on something like that and it is almost done
Reply

#10
it works, but also when you commit suicide
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 5,859 11-07-2013, 13:41
Last Post: Nekochan
  !kill Plugin Hallla 1 2,585 09-07-2013, 22:30
Last Post: axel-le-meilleur
  Help About kill cam Howl3r 3 2,713 08-03-2013, 03:57
Last Post: Howl3r
Music [Release] [C#] [LIBRARY] SABSFile library (open sound files) JariZ 31 19,945 07-07-2013, 17:20
Last Post: Red-EyeX32
Music unlimited breath scope+sound when walking aim LE3* 0 2,138 04-21-2013, 08:42
Last Post: LE3*
  Black Ops II Sound Stuffs master131 1 5,451 01-18-2013, 20:30
Last Post: Pepper26
  [Request] exporting sound inside black ops tomglazer 2 3,642 12-10-2012, 23:30
Last Post: tomglazer
  Help Insta kill possible? koro35 10 6,629 11-27-2012, 16:10
Last Post: 99IRock
  Help i have sound file for blac ops pap12322221112 2 2,453 10-22-2012, 08:08
Last Post: d0h!
  [Request] !kill hillbilly 7 4,974 09-30-2012, 17:10
Last Post: OzonE

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.