ItsMods

Full Version: Rankup sound on kill
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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???
The actual playing of the sound should work like this
CSHARP Code
  1. PlaySoundOnPlayer(Client, "mp_level_up");
(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.
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.
killstreaks would be fine
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
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
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.
(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
it works, but also when you commit suicide
Pages: 1 2