PDA

View Full Version : TF2: Tauntkill Reward???


hinehine10
12-22-2011, 12:26
Hey I am looking for a Plugin that grants a player Crits for a few seconds, and plays a Sound to the Player who gets a Kill by Taunting (like Ubersaw or Huntsman or Fists).
I searched for such a plugin for a long time but couldn't find anything interesting.
This function should only be triggered by Tauntkills except the Equalizer Taunt.

if someone wonders, yes, i could donate to the creator of this :)

pheadxdll
12-22-2011, 17:59
Try this, merry christmas!

hinehine10
12-26-2011, 09:46
I will try this now, merry chistmas :)
I hope this works like i think how it works :D

hinehine10
12-27-2011, 09:12
I changed 3 things:
#define SOUND "psm/adrenaline.mp3"

g_hCvarDuration = CreateConVar("tc_duration", "25.0", "Time (seconds) for crit effects after a taunt kill.");

if(strncmp(strLogWeapon, "taunt_", 25) == 0 && strcmp(strLogWeapon, "taunt_soldier") != 0)

If these changes caused the Plugin to fail then Change the things so that the Killer gets Crits for 25 seconds and the sound 'adrenaline.mp3' in this case, plays, it's 25 seconds long.

pheadxdll
12-27-2011, 14:33
Yes, your changes made it non-functional. You should have left:

if(strncmp(strLogWeapon, "taunt_", 6) == 0 && strcmp(strLogWeapon, "taunt_soldier") != 0)

alone. As for the sound, if its a custom sound, you have to have a line like:

AddFileToDownloadsTable("sound/psm/adrenaline.mp3");

in OnMapStart() so clients can download the sound to play.

hinehine10
12-27-2011, 15:30
all clients on my server will download the sound automatically, i've got sv_downloadurl in the config of my server.
so i will re-try this now with the 'if' line left alone

hinehine10
12-27-2011, 18:04
okay it looks like the plugins kinda works.
It shows in chat <Killer Name Here> just taunt killed <Victim Name Here>.
but it neither grants me crits nor plays that sound.

Dr. McKay
12-27-2011, 19:07
okay it looks like the plugins kinda works.
It shows in chat <Killer Name Here> just taunt killed <Victim Name Here>.
but it neither grants me crits nor plays that sound.

You have to add that line that pheadxdll recommended. The client only downloads files that are in the download table. Simply having a file on the fast download isn't enough.

hinehine10
12-28-2011, 08:47
okay, but i got 2 questions then:
-Why is this crit reward not working?
-Where to put that line, pheadxdll recommended?
(of course in the .sp file but where exactly?)

EDIT:
got 2 errors:
/home/groups/sourcemod/upload_tmp/php1QSNOJ.sp(7) : error 010: invalid function or declaration
/home/groups/sourcemod/upload_tmp/php1QSNOJ.sp(7) : error 021: symbol already defined: "AddFileToDownloadsTable"

Powerlord
12-28-2011, 15:41
okay, but i got 2 questions then:
-Why is this crit reward not working?
-Where to put that line, pheadxdll recommended?
(of course in the .sp file but where exactly?)

EDIT:
got 2 errors:
/home/groups/sourcemod/upload_tmp/php1QSNOJ.sp(7) : error 010: invalid function or declaration
/home/groups/sourcemod/upload_tmp/php1QSNOJ.sp(7) : error 021: symbol already defined: "AddFileToDownloadsTable"

The AddFileToDownloadsTable needs to go in the OnMapStart function.

hinehine10
12-28-2011, 18:33
Okay, the plugin shows the kill message in chat and gives me crits for 25 seconds.
I've put that AddFileToDownloadsTable("sound/psm/adrenaline.mp3"); line in and still can't hear that sound.

hinehine10
12-30-2011, 07:21
Plugin works fine now.
The whole thing was just:
EmitSoundToClient(iVictim, SOUND);
changed to:
EmitSoundToClient(iAttacker, SOUND);

Thanks alot guys!