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

Set Player's max HP on spawn (TF2)


Post New Thread Reply   
 
Thread Tools Display Modes
rainbronydash
Junior Member
Join Date: Apr 2015
Old 04-16-2015 , 18:29   Re: Set Player's max HP on spawn (TF2)
Reply With Quote #51

I just tried this out and it gives me overheal but not true hp. Can anyone make it to hp instead of overheal.
rainbronydash is offline
Send a message via Skype™ to rainbronydash
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-17-2015 , 10:18   Re: Set Player's max HP on spawn (TF2)
Reply With Quote #52

Does 0.0 in a timer really 'fire next frame'?
__________________
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-17-2015 , 16:02   Re: Set Player's max HP on spawn (TF2)
Reply With Quote #53

Quote:
Originally Posted by Chdata View Post
Does 0.0 in a timer really 'fire next frame'?
No. Timers are only checked however often SM is set to check timers, which in the default compiles of SM is every 0.1 seconds.

Of course, since SM 1.6, setting a RequestFrame callback will set fire on the next frame.

Anyway, going back to the topic at hand, if you want to set health as non-overheal, you can use SDKHooks to add a SDKHook_GetMaxHealth hook when players are put in the server and modify the health in the callback.

Alternately, you can use the TF2Attributes plugin to add a "max health additive bonus" attribute to players (keeping in mind that it adds this much health to them). This is how Huntsman Hell works and it respects health changes done by weaponry (i.e. Sandman decreasing health by 15).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-17-2015 at 16:07.
Powerlord is offline
rainbronydash
Junior Member
Join Date: Apr 2015
Old 04-17-2015 , 19:21   Re: Set Player's max HP on spawn (TF2)
Reply With Quote #54

How would I put that into there?
rainbronydash is offline
Send a message via Skype™ to rainbronydash
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-18-2015 , 09:10   Re: Set Player's max HP on spawn (TF2)
Reply With Quote #55

GetMaxHealth seems to call like everyframe - tf2attribs is probably your best bet.

And yeah, I suppose that clears up that misconception about 0.0 timers.
__________________
Chdata 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 21:55.


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