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

[TF2] Health w/o Decay


Post New Thread Reply   
 
Thread Tools Display Modes
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-13-2011 , 22:19   Re: [TF2] Health w/o Decay
Reply With Quote #11

That extension worked perfectly, wow, thank you so much.
__________________
Max_Damage is offline
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-15-2011 , 18:52   Re: [TF2] Health w/o Decay
Reply With Quote #12

So, Now i'm trying to individually set HP for every player if they have a flag.
I can't seem to make it work this way.
PHP Code:
public Action:Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast){

    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
String:classname[128];
    
    for (new 
1<= 9i++)
    {
        
TF2_GetClassStringData(iClassData_Nameclassnamesizeof(classname));
        
ReplyToCommand(client"Class ID %i name is %s"iclassname); //Debug Print
        
if(GetUserFlagBits(client) & (ADMFLAG_CUSTOM3))  //Supposed to set only that players' HP?
        
{
            
TF2_SetClassIntegerData(iClassData_MaxHealth500); // Sets class HP
        
}
    }

Edit: I guess i'm slightly getting off topic, but i'm trying to learn how all this stuff works.
__________________

Last edited by Max_Damage; 06-15-2011 at 19:10.
Max_Damage is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-15-2011 , 21:17   Re: [TF2] Health w/o Decay
Reply With Quote #13

I don't think it's possible to set it per client with that extension.

It sets the class data for the server(as if you had changed it in the ctx file).

If you want it based per player, the TF2Items method I mentioned earlier would work for that.

Last edited by Tylerst; 06-15-2011 at 21:20.
Tylerst is offline
Max_Damage
Junior Member
Join Date: Jun 2009
Old 06-15-2011 , 23:56   Re: [TF2] Health w/o Decay
Reply With Quote #14

Quote:
Originally Posted by Tylerst View Post
I don't think it's possible to set it per client with that extension.

It sets the class data for the server(as if you had changed it in the ctx file).

If you want it based per player, the TF2Items method I mentioned earlier would work for that.

Alright, Thanks! I was trying to avoid that, but I guess I can't.
__________________
Max_Damage is offline
1695
Senior Member
Join Date: Jan 2006
Old 06-17-2011 , 06:20   Re: [TF2] Health w/o Decay
Reply With Quote #15

I was also looking for a per-player changing max_health plugin without degenerate... So if anyone finds a way of doing it without TF2Items or else, please tell me.
1695 is offline
1695
Senior Member
Join Date: Jan 2006
Old 06-18-2011 , 05:52   Re: [TF2] Health w/o Decay
Reply With Quote #16

Hi, sorry for the bumping but wouldn't that work ? :

You set the amount of life you wanna add (ex : new HPBoost = 50;) then OnGameFrame() you use SetEntityHealth to set client's health to "currentHealth + HPBoost" as long as "currentHealth > 1", then you stop adding the HPBoost...

Should do it no ? How CPU intensive is OnGameFrame ?
1695 is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 06-18-2011 , 06:23   Re: [TF2] Health w/o Decay
Reply With Quote #17

Quote:
Originally Posted by 1695 View Post
Hi, sorry for the bumping but wouldn't that work ? :

You set the amount of life you wanna add (ex : new HPBoost = 50;) then OnGameFrame() you use SetEntityHealth to set client's health to "currentHealth + HPBoost" as long as "currentHealth > 1", then you stop adding the HPBoost...

Should do it no ? How CPU intensive is OnGameFrame ?
That would add 50 to the client's health every frame, essentially giving them infinite health, barring 1-shot kills.

As I said in one of my earlier posts though, you could use SDKHooks OnTakeDamage with that to lower it, however all that would be rather cpu intensive.

TF2Items is much easier, much less cpu intensive, and already has per player and/or adminflag based filters built in.
Not to mention it actually changes the base health(SetEntityHealth just boosts it above normal, like the medigun)

Last edited by Tylerst; 06-18-2011 at 06:34. Reason: typos
Tylerst is offline
1695
Senior Member
Join Date: Jan 2006
Old 06-18-2011 , 06:30   Re: [TF2] Health w/o Decay
Reply With Quote #18

Okay, thx for the infos, totally new to sourcePawn programing ^^.
Will dig into TF2Items then.
1695 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-18-2011 , 07:47   Re: [TF2] Health w/o Decay
Reply With Quote #19

What's wrong with the SDKHooks code that Tylerst posted? It can easily be adapted to be player-specific.
bl4nk is offline
1695
Senior Member
Join Date: Jan 2006
Old 06-18-2011 , 09:15   Re: [TF2] Health w/o Decay
Reply With Quote #20

He just said that it could be CPU intensive. I'd rather avoid that...
1695 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:05.


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