Raised This Month: $182 Target: $400
 45% 

TF2DECAP: Heads will roll! (Decapitation plugin)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
eee
Member
Join Date: Aug 2009
Plugin ID:
1370
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    21 
    Plugin Description:
    Adds decapitations in TF2
    Old 12-29-2009 , 19:24   TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #1

    I don't know about you, but the first thing I wanted to do when I saw the Eyelander was decapitate things. No, I'm not a ghost, but I do have a penchant for removing heads. So I thought, you know what this game needs? Even more decapitations!

    Note:
    Most of this plugin was directly... borrowed... from TF2Gore v2 (the gib part), so MAJOR credit goes to Joe 'Pinkfairie' Maley http://forums.alliedmods.net/showthread.php?p=666087, if not for his work, this plugin would be looking a bit silly.


    Description:

    This plugin causes decapitations on headshots with any weapon able to headshot. It doesn't make a mess of logging, or your pots and pans, as it only creates a ragdoll.

    Convars:


    tf2decap_decap_always (default 0): Every kill is a decapitation. Gets a little wacky. Overrides huntsman setting.

    tf2decap_decapitations (default 1): Allows the plugin to take over and turn headshots into decapitations.

    tf2decap_decap_huntsman (default 1): The huntsman follows normal headshot rules (customkill 1), so the headshots will trigger a decapitation. If you don't like seeing a head rolling away from a neck with an arrow in it, change this to 0. This will decapitate regardless if tf2decap_decap_always is 1.


    Development Notes:

    This plugin prehooks player_death. Not as bad as some plugins, but if you're worried about that sort of thing, there you have it.
    I've also left some room right at the start (DecapTypes, an array of customkill types to allow a decapitation, and a DecapTypeCount that follows it). It looks useless now with one type, but I felt it should be there for easy modifications.




    Other notes:
    If this isn't approved, I wouldn't mind if someone decides to make it better/fix whatever I did wrong because I kind of thought it was a good idea. I'm pretty sure I probably did something wrong (first submission), so as per the rules I'll be reporting my post.
    Attached Files
    File Type: sp Get Plugin or Get Source (decapitation.sp - 1743 views - 3.3 KB)
    __________________

    Last edited by eee; 12-29-2009 at 20:52.
    eee is offline
    voogru
    Inspector Javert
    Join Date: Oct 2004
    Old 12-29-2009 , 19:49   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #2

    Code:
    public Plugin:myinfo =
    {
    
    	name = "Team Headless 2",
    	author = "some fag & Pinkfairie (unknowingly)",
    	description = "Decapitations",
    	version = "1.0",
    	url = "Ants"
    }
    Really? I'm not an approver but this is a little silly.
    voogru is offline
    eee
    Member
    Join Date: Aug 2009
    Old 12-29-2009 , 19:50   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #3

    Well alright, I've changed that, but how did you want me to put his name in there?

    Last edited by eee; 12-29-2009 at 19:54. Reason: and now i've changed it
    eee is offline
    voogru
    Inspector Javert
    Join Date: Oct 2004
    Old 12-29-2009 , 20:16   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #4

    Quote:
    Originally Posted by eee View Post
    Well alright, I've changed that, but how did you want me to put his name in there?
    There are much better ways to put the names in the author tag than "Some fag".

    Also, this is just a pet-peeve and maybe you're still learning, but usually this is also considered a little silly:

    Take note I am just nit-picking here. So don't take offense.

    Code:
     //Loop:
    			for(new X = 0; X < DecapTypeCount; X++)
    			{
    
    				//Compare:
    				if(ck == DecapTypes[X] || (ak == 1))
    				{
    	
    					//Declare:
    					decl Ent;
     
    					...
    				}
    			}
    Most programmers (even a novice) will know what those do, so it's meaningless to add self-explanatory comments. Generally you should comment code when it does something that is not immediately understandable. It's just a suggestion.

    voogru is offline
    eee
    Member
    Join Date: Aug 2009
    Old 12-29-2009 , 20:52   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #5

    Useless comments stripped, thank you.
    __________________
    eee is offline
    noodleboy347
    SourceMod Donor
    Join Date: Mar 2009
    Old 12-29-2009 , 21:06   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #6

    Pretty cool, are you able to make every weapon headshot work, or does Valve only record headshots with the Rifle/Huntsman/Ambassador?
    noodleboy347 is offline
    eee
    Member
    Join Date: Aug 2009
    Old 12-29-2009 , 21:28   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #7

    Quote:
    Originally Posted by noodleboy347 View Post
    Pretty cool, are you able to make every weapon headshot work, or does Valve only record headshots with the Rifle/Huntsman/Ambassador?
    Only those kills are customkill 1. Unfortunately, while player_hurt checks hitboxes, player_death does not. I was trying to not prehook player_hurt because I'm told that slows down servers quite a lot. If anyone can tell me an accurate way to check the hitbox on death, or a smart way to pass it from player_hurt without using too much resources (because i assume marking each player every time they're hurt would cause the server to slow), I'd be happy to make that another condition to decapitate.

    If I'm completely wrong about prehooking player_hurt and whatnot, please tell me, I'll do that.
    __________________
    eee is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 12-29-2009 , 23:15   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #8

    Since you reported and asked the questions I will respond.

    You did everything just fine. I will be leaving this plugin in New Plugins for a bit to have others test it and report on it.
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    Jindo
    SourceMod Donor
    Join Date: May 2009
    Location: England, UK
    Old 12-30-2009 , 07:10   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #9

    Quote:
    Originally Posted by eee View Post
    If I'm completely wrong about prehooking player_hurt and whatnot, please tell me, I'll do that.
    If headshot is customkill 1, why not check that in the damagebits property of the player_death event, and apply the decapitated ragdoll if it matches?
    __________________
    Jindo is offline
    noodleboy347
    SourceMod Donor
    Join Date: Mar 2009
    Old 12-30-2009 , 17:49   Re: TF2DECAP: Heads will roll! (Decapitation plugin)
    Reply With Quote #10

    I can confirm that this works great.
    noodleboy347 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 09:07.


    Powered by vBulletin®
    Copyright ©2000 - 2017, vBulletin Solutions, Inc.
    Theme made by Freecode