Raised This Month: $51 Target: $400
 12% 

[TF2] UberSteal


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Monkeys
Veteran Member
Join Date: Jan 2010
Plugin ID:
1950
Plugin Version:
1.2
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    When a Medic kills or helps killing another Medic, he steals his uber.
    Old 09-13-2010 , 02:43   [TF2] UberSteal
    Reply With Quote #1

    [TF2] UberSteal
    Description:

    A fairly simple plugin.
    If a Medic kills or assists in killing another Medic, he will steal that Medic's Uber.

    Cvars:


    sm_ubersteal def. "1.0"
    Amount of Uber you steal. This is a percent. 2.0 for double, 0.5 for half, etc...

    sm_uberoverload def. "0"
    Allow Uberstealing past 100% Ubercharge.
    ubersteal_version def. "1.2"
    Current version running. Do not try to alter this. It's merely used for tracking.

    Changelog:

    v1.0:
    -Initial Release
    v1.1:
    -Changed sm_ubersteal to a Float multiplier
    v1.2:
    -
    Added sm_uberoverload to allow stealing Uber past 100%
    v1.2.3
    : (by Thraka)
    -Accounted for Valve removing charge data in player_death by caching it in player_hurt.
    Attached Files
    File Type: sp Get Plugin or Get Source (UberSteal.sp - 1652 views - 3.2 KB)
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.

    Last edited by Monkeys; 10-29-2011 at 21:49.
    Monkeys is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 09-13-2010 , 03:32   Re: [TF2] UberSteal
    Reply With Quote #2

    You have an issue on line 39. Getting the players class twice which would prevent the "stealer" code from ever being run.

    Second. That hook should not have ACTION: in it.

    Other than that, it looks good. Should try to be consistent with your coding, you use if == with brackets up top, then if != return below, but thats just being anal.
    __________________

    Last edited by retsam; 09-13-2010 at 03:39.
    retsam is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 09-13-2010 , 06:47   Re: [TF2] UberSteal
    Reply With Quote #3

    Whoops, didn't notice I forgot to change victim to stealer.
    Thanks for pointing it out.
    It's those idiotic mistakes that always neck me.

    And my brackets vs. no brackets policy is the general one:
    Use them if you need them.
    A single line of code doesn't really warrant brackets for me.

    Edit: No idea how the Action snuck in there. I think I was going to write a command first, but then reaslised I didn't need one.
    Should work no less with it, though.
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.

    Last edited by Monkeys; 09-13-2010 at 06:51.
    Monkeys is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 09-13-2010 , 08:13   Re: [TF2] UberSteal
    Reply With Quote #4

    Quote:
    sm_ubersteal def. "1"
    Enables UberSteal. 0 = Off, 1 = 100% Uber stolen, 2 = 50% Uber stolen.
    Please make it a float with values from 0.0 to 1.0.
    So for 50% you'll have to set your cvar to 0.5.
    For 33% to 0.33
    Disable = 0.0
    and so on.
    __________________
    einmal mit profis arbeiten. einmal.
    Thrawn2 is offline
    Death [GER]
    Senior Member
    Join Date: Mar 2010
    Old 09-13-2010 , 08:44   Re: [TF2] UberSteal
    Reply With Quote #5

    Made it a float. Hope it works. Cant test.
    Attached Files
    File Type: sp Get Plugin or Get Source (UberSteal.sp - 1210 views - 2.2 KB)
    __________________
    Death [GER] is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 09-13-2010 , 09:52   Re: [TF2] UberSteal
    Reply With Quote #6

    The guy requesting it just wanted 100% steal. I added the 50% so there is at least something extra.
    But yeah, it's just changing a tag and a few functioncalls.

    I'll make it like this
    "sm_ubersteal", "1.0","Amount of Uber you steal. This is a percent. 2.0 for double, 0.5 for half, etc..."
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    Death [GER]
    Senior Member
    Join Date: Mar 2010
    Old 09-13-2010 , 10:13   Re: [TF2] UberSteal
    Reply With Quote #7

    Just like mine except i renamed hEnabled to hFactor to match the new use of the Convar (and its Handle)

    Nice Plugin btw
    __________________
    Death [GER] is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 09-13-2010 , 11:05   Re: [TF2] UberSteal
    Reply With Quote #8

    Quote:
    Originally Posted by Death [GER] View Post
    Just like mine except i renamed hEnabled to hFactor to match the new use of the Convar (and its Handle)

    Nice Plugin btw
    Oh sorry, overlooked yours. I rewrote those 2 lines for nothing >:/
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    Death [GER]
    Senior Member
    Join Date: Mar 2010
    Old 09-13-2010 , 11:52   Re: [TF2] UberSteal
    Reply With Quote #9

    For me it was 4 lines ^^
    __________________
    Death [GER] is offline
    Afronanny
    Veteran Member
    Join Date: Aug 2009
    Old 09-14-2010 , 15:21   Re: [TF2] UberSteal
    Reply With Quote #10

    Allowing the stolen charge to make the stealing medic's ubercharge go over 100% could be cvar configurable.
    Afronanny is offline
    Reply



    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 14:10.


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