AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Witch crown announce? (https://forums.alliedmods.net/showthread.php?t=105281)

titan_rw 10-03-2009 02:15

Witch crown announce?
 
Hi.

Just wondering if something like this exists? I looked through the plugins there are, and didn't see anything.

Basically announce to all players when any player truely 'crowns' the witch, as in one shot kill, not just kills the witch without dieing (ie spamming autoshotty).

Too many people kill a witch with 2-3 shells, and claim they crowned her. It would be nice to have a true 1 shell witch kill announced to all players.

I don't know if this is possible with sourcemod.

Anybody?

Thanks.

Kevin_b_er 10-03-2009 03:02

Re: Witch crown announce?
 
1 Attachment(s)
It's actually quite easy. The witch death event includes the 'oneshot' flag which corresponds to a cr0wned witch.

Here's an example plugin that should announce whenever a player gets one of these kills as "PLAYER cr0wned a witch!" in the game chat. Don't know how to do one of those neat on-screen messages l4d can do, else I'd probably have done that for good measure.


Disclaimer: I didn't test it. Exercise is left for the reader.

olj 10-03-2009 03:16

Re: Witch crown announce?
 
1 Attachment(s)
The witch_kill event has "oneshot" key which denotes actual crowning. Try this. It uses chat area for message. Oh, lol, Kevin already done it. You can try my if you need colored message though :P

titan_rw 10-04-2009 13:18

Re: Witch crown announce?
 
Wow, thanks guys. I'll try it (one of them) out.

Thanks again.

triggerman 10-05-2009 01:56

Re: Witch crown announce?
 
olj can you set yours up to make the message look like an achievement message? even just post what the printtochatall line should be.

titan_rw 10-05-2009 10:11

Re: Witch crown announce?
 
I used olj's version, but changed it a little to show a message when oneshot is false. So the person knows for sure they didn't get the crown.

Code:

public Action:EventWitchDeath(Handle:event, const String:name[], bool:dontBroadcast)
 {
  new killer = GetClientOfUserId(GetEventInt(event, "userid"));
  if (!IsValidClient(killer)) return;
  decl String:killername[MAX_NAME_LENGTH];
  GetClientName(killer, killername, MAX_NAME_LENGTH);
  if (GetEventBool(event, "oneshot"))
  {
    PrintToChatAll("\x03%s \x04CROWNED the witch!", killername);
  }
  else
  {
    PrintToChatAll("\x03%s \x04has \x03FAILED \x04to crown the witch!", killername);
  }
 }

Of course you still get the failed message when you weren't trying to crown. Such as when a teammate startles the witch, gets incapped, and you unload into the witch before she shreds the other guy. Not really trying to crown, just kill quickly. Ohh well.

I'm about 95% for a true crown. On advanced and lower, I only use 1 shell anyway. On expert, I may click-spam if I'm not super confident at the time. With this plugin I can still tell if I did crown or not.

Thanks again.


All times are GMT -4. The time now is 11:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.