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

Question about "m_takedamage"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-28-2010 , 23:52   Question about "m_takedamage"
Reply With Quote #1

SetEntProp(client, Prop_Data, "m_takedamage", X, X);
What is the use of the above function?
chu1720 is offline
Send a message via MSN to chu1720
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 07-29-2010 , 00:04   Re: Question about "m_takedamage"
Reply With Quote #2

Setting godmode
__________________
pheadxdll is offline
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-29-2010 , 00:43   Re: Question about "m_takedamage"
Reply With Quote #3

Quote:
Originally Posted by pheadxdll View Post
Setting godmode
Could you tell me how to use this? What is the use of the two number above (labeled as X).
chu1720 is offline
Send a message via MSN to chu1720
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-29-2010 , 01:52   Re: Question about "m_takedamage"
Reply With Quote #4

First one is the value to set m_takedamage to and the second is the number of bytes to write.

I believe the values are 0 and 2, I can't remember which is godmode and which is normal (you can just test)

Just write 1 byte. The max number for 1 byte is 255 (-255 through 255)
__________________
Greyscale is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-29-2010 , 11:50   Re: Question about "m_takedamage"
Reply With Quote #5

Quote:
Originally Posted by shareddefs.h
Code:
// settings for m_takedamage
#define DAMAGE_NO		0
#define DAMAGE_EVENTS_ONLY	1	// Call damage functions, but don't modify health
#define DAMAGE_YES		2
#define DAMAGE_AIM		3
Not that it really matters in this case, but the range of a single byte goes from -128 to 127 (or from 0 to 255 if unsigned)
__________________
plop
p3tsin is offline
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-29-2010 , 14:52   Re: Question about "m_takedamage"
Reply With Quote #6

Quote:
Originally Posted by p3tsin View Post
Not that it really matters in this case, but the range of a single byte goes from -128 to 127 (or from 0 to 255 if unsigned)
When god mode is on, will the hurt event fire when the "god" get hurted?
chu1720 is offline
Send a message via MSN to chu1720
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-29-2010 , 15:22   Re: Question about "m_takedamage"
Reply With Quote #7

Quote:
Originally Posted by chu1720 View Post
When god mode is on, will the hurt event fire when the "god" get hurted?
No, because they don't get hurt.
__________________
plop
p3tsin is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 07-29-2010 , 15:28   Re: Question about "m_takedamage"
Reply With Quote #8

Unless using DAMAGE_EVENT_ONLY, right?
__________________
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
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-29-2010 , 15:35   Re: Question about "m_takedamage"
Reply With Quote #9

Quote:
Originally Posted by Monkeys View Post
Unless using DAMAGE_EVENT_ONLY, right?
Maybe. I recall trying it out once, but still ended up getting damaged.
__________________
plop
p3tsin is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 07-29-2010 , 16:03   Re: Question about "m_takedamage"
Reply With Quote #10

Quote:
Originally Posted by p3tsin View Post
Maybe. I recall trying it out once, but still ended up getting damaged.
Maybe some engines don't support it all that well.

#define DAMAGE_EVENTS_ONLY 1 // Call damage functions, but don't modify health
__________________
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
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:39.


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