Raised This Month: $32 Target: $400
 8% 

Set Health


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MrBlip
Junior Member
Join Date: Jul 2008
Plugin ID:
462
Plugin Version:
1.2.2
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    124 
    Plugin Description:
    Sets a player, an entire team, or everyone's health to the specified amount.
    Old 07-10-2008 , 00:38   Set Health
    Reply With Quote #1

    SetHealth by Mr. Blip
    • Sets a player, an entire team, or everyone's health to the specified amount.
    about:
    I looked and looked and couldn't find a plugin that sets a players health to a specified amount in a manner that I wanted it to. The closest thing I could find was one that was buried in the 'Super Admin' plugin, but it seemed messy and didn't work as I wanted it to (for example, @T and @CT actually targeted all). So, with the help of bl4nk, I set forth on a journey on how to create my own plugins and this is what I came up with.

    Cvars:
    • sm_sethealth_version = 1.0
    Usage:
    • sm_sethealth <#userid|name> <amount>
    • EX: sm_sethealth @all 500
    To-Do:
    • Logging (forgot all about it until just now)
    • Checking for negative numbers (not sure what effect this will have on the plugin)
    • Possibly include a 'silent' command? (for those sneaky admins)
    The plugin definitely works for CS:S, so for right now that's the game. If anyone can confirm that it works for DoD:S or TF2 that'd be great.

    Change Log:

    Version 1.2.2
    • Fixed health on engineer not working
    Version 1.2.1
    • Setting health in TF2 should now work as intended
    • Setting health to 0 in TF2 will cause the players to explode, all other mods SHOULD reset health to 1
    Version 1.2
    • Added better support for TF2
    Version 1.1
    • Added logging
    • Only allows numbers greater then 0
    • Removed 's from the phrases file.
    Version 1.0
    • Initial Release
    Again, many thanks to bl4nk for pointing me in the right direction.
    Attached Files
    File Type: txt sethealth.phrases.txt (101 Bytes, 9584 views)
    File Type: sp Get Plugin or Get Source (sm_sethealth.sp - 20387 views - 2.4 KB)

    Last edited by MrBlip; 07-23-2008 at 14:49.
    MrBlip is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-10-2008 , 00:42   Re: Set Health
    Reply With Quote #2

    We really need a sethealth command in the SM core commands
    __________________
    Greyscale is offline
    Liam
    SourceMod Developer
    Join Date: Jan 2008
    Location: Atlanta, GA
    Old 07-10-2008 , 01:14   Re: Set Health
    Reply With Quote #3

    This works, the only thing I see with it though is that SetEntityHealth doesn't change the max value that the health can be, so you should really put a check in to see if they are exceeding that amount, otherwise its going to trickle back down.
    Liam is offline
    MrBlip
    Junior Member
    Join Date: Jul 2008
    Old 07-10-2008 , 08:57   Re: Set Health
    Reply With Quote #4

    Updated to version 1.1:
    • Added logging
    • Health amount must be greater then 0
    • Removed the 's from the phrases file.
    I'll see if I can figure how to do what you said, Liam.

    Last edited by MrBlip; 07-10-2008 at 09:11.
    MrBlip is offline
    CaffeinePowered
    Junior Member
    Join Date: Dec 2007
    Location: Illinois
    Old 07-22-2008 , 12:29   Re: Set Health
    Reply With Quote #5

    Hm, I wonder if this could be modified to roll back the +50 health on pyros from the back burner...
    CaffeinePowered is offline
    Send a message via AIM to CaffeinePowered
    Lebson506th
    Veteran Member
    Join Date: Jul 2008
    Old 07-22-2008 , 13:08   Re: Set Health
    Reply With Quote #6

    This would be cooler if it was like Mani's that could

    1) Target players using regex.

    ie sm_sethealth "Apple" 2

    Would set RedApple, Apple Cider, and Applerleorler's health to 2

    2) When health is set to 0, make the target explode.
    Lebson506th is offline
    Unrealomega
    Member
    Join Date: May 2008
    Old 07-22-2008 , 17:44   Re: Set Health
    Reply With Quote #7

    Works perfect on TF2. Though, it doesn't go past 500 HP and drains your health to 0 if you go over 500; it doesn't kill you, just drains the rest of the way. For instance:

    If I set my health to 1000, it will drain my health to 0. It won't kill me, but restart me at 500 and continue to drain me until I'm back to full health.

    I believe the reason for this isn't because the game can't handle above 500, but that it registers anything about the classes maximum health(Without bonus) as a bonus. So it will drain it the same way. The only thing I can say to remendy this would to either max it out at 500 for TF2.

    It's a minor inconvience. The worst that happens is your health depletes to 0, you have the death animation, but resets to 500 before it registers it as a death.

    Last edited by Unrealomega; 07-22-2008 at 18:26. Reason: Found out something.
    Unrealomega is offline
    MrBlip
    Junior Member
    Join Date: Jul 2008
    Old 07-22-2008 , 18:24   Re: Set Health
    Reply With Quote #8

    Updated to version 1.2:
    • For TF2: sets the players max health to the specified amount (shouldn't decrease), only if the new max health exceeds the class' default max health. Otherwise it just changes their current health to the specified amount
    Not tested on a TF2 server yet, so if I can get a confirmation that this is working correctly that'd be great. The only problem I have with it is it doesn't take a pyro equipped with a backburner into account, but I'll fix that when I have more time.

    Quote:
    Originally Posted by CaffeinePowered View Post
    Hm, I wonder if this could be modified to roll back the +50 health on pyros from the back burner...
    I'll make a cvar in the next version that will do just that.

    Quote:
    Originally Posted by Lebson506th View Post
    This would be cooler if it was like Mani's that could

    1) Target players using regex.

    ie sm_sethealth "Apple" 2

    Would set RedApple, Apple Cider, and Applerleorler's health to 2

    2) When health is set to 0, make the target explode.
    I find that option 1 would be rather annoying, but I'll see if I can make an extra command to do what you're asking (if I can find out how).

    Option 2, on the other hand, sounds incredibly awesome. Expect that in the next release.
    MrBlip is offline
    Unrealomega
    Member
    Join Date: May 2008
    Old 07-22-2008 , 18:33   Re: Set Health
    Reply With Quote #9

    I want to make note that DOD:S works fine. Most likely because it doesn't have a health ceiling like TF2.
    Unrealomega is offline
    Unrealomega
    Member
    Join Date: May 2008
    Old 07-22-2008 , 18:47   Re: Set Health
    Reply With Quote #10

    I'm getting an unknown command. The plugin is loaded properly, but I'm getting this error:

    Code:
    L 07/22/2008 - 15:46:11: [SM] Native "SetEntProp" reported: Property "m_iMaxHealth" not found (entity 1/player)
    L 07/22/2008 - 15:46:11: [SM] Debug mode is not enabled for "sm_sethealth.smx"
    L 07/22/2008 - 15:46:11: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 13 on
    Unrealomega 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 02:32.


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