Raised This Month: $ Target: $400
 0% 

Get xyz coords as for RadiusDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-19-2015 , 07:10   Re: Get xyz coords as for RadiusDamage
Reply With Quote #1

Silly me I didn't noticed that I was calling it pev after the post-calculation.

Yes I have been using Damage event as well as Ham_TakeDamage ham
the problem is that the player isn't attacking. Think of it as if I were to re-create c4.
I thought Ham_TakeDamage doesn't execute on anything else but when damage has been received from someone/to someone.

Last edited by Al3; 09-19-2015 at 07:11.
Al3 is offline
Send a message via Skype™ to Al3
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-19-2015 , 07:16   Re: Get xyz coords as for RadiusDamage
Reply With Quote #2

You see, with HamSandwich you can both hook (using RegisterHam[FromEntity]()) and execute (using ExecuteHam[ B ]()) virtual functions. When you execute Ham_TakeDamage on an entity, it has the same effect as if someone actually hit that entity.
No one has to actually attack a player for you to execute TakeDamage, you can call it whenever you want to.

Last edited by klippy; 09-19-2015 at 07:17.
klippy is offline
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-19-2015 , 07:31   Re: Get xyz coords as for RadiusDamage
Reply With Quote #3

I think I've just learned something very useful then.
Well thank you. I can continue from now on
Al3 is offline
Send a message via Skype™ to Al3
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-19-2015 , 12:34   Re: Get xyz coords as for RadiusDamage
Reply With Quote #4

Quote:
Originally Posted by Al3 View Post
PHP] new Float:fOrigin [3];
test = false;
fOrigin[0] += 5000;
fOrigin[1] += 5000;
fOrigin[2] += 5000;
pev(id, pev_origin, fOrigin);
RadiusDamage(fOrigin, 1, 1);[/PHP]
Addding 5000 to 0 has no affect because you are then overwriting those values with the player's origin.
__________________
fysiks is offline
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-19-2015 , 12:42   Re: Get xyz coords as for RadiusDamage
Reply With Quote #5

I was just testing so evidently it doesn't make sense. Especially that it was even (by mistake) a senseless test. Also what do you mean by "overwrite".
How is that overwriting but addition. Unless fOrigin is a byte there is no way it I can think of that causes overflow, rollback or so.

Last edited by Al3; 09-19-2015 at 12:49.
Al3 is offline
Send a message via Skype™ to Al3
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-19-2015 , 13:16   Re: Get xyz coords as for RadiusDamage
Reply With Quote #6

Yes I already noted that twice.
This is why my test made no sense.
I found out that I am calling pev after the assignment later.
Al3 is offline
Send a message via Skype™ to Al3
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 22:11.


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