AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] UberSteal (https://forums.alliedmods.net/showthread.php?t=138034)

Monkeys 09-13-2010 02:43

[TF2] UberSteal
 
1 Attachment(s)
[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
http://forums.alliedmods.net/images/...n/post_old.gif: (by Thraka)
-Accounted for Valve removing charge data in player_death by caching it in player_hurt.

retsam 09-13-2010 03:32

Re: [TF2] UberSteal
 
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.

Monkeys 09-13-2010 06:47

Re: [TF2] UberSteal
 
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.

Thrawn2 09-13-2010 08:13

Re: [TF2] UberSteal
 
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.

Death [GER] 09-13-2010 08:44

Re: [TF2] UberSteal
 
1 Attachment(s)
Made it a float. Hope it works. Cant test.

Monkeys 09-13-2010 09:52

Re: [TF2] UberSteal
 
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..."

Death [GER] 09-13-2010 10:13

Re: [TF2] UberSteal
 
Just like mine except i renamed hEnabled to hFactor to match the new use of the Convar (and its Handle) :P

Nice Plugin btw :)

Monkeys 09-13-2010 11:05

Re: [TF2] UberSteal
 
Quote:

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

Nice Plugin btw :)

Oh sorry, overlooked yours. I rewrote those 2 lines for nothing >:/

Death [GER] 09-13-2010 11:52

Re: [TF2] UberSteal
 
:P For me it was 4 lines ^^

Afronanny 09-14-2010 15:21

Re: [TF2] UberSteal
 
Allowing the stolen charge to make the stealing medic's ubercharge go over 100% could be cvar configurable.


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

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