AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage hitplace check. (https://forums.alliedmods.net/showthread.php?t=207945)

P1raten 02-08-2013 14:13

Ham_TakeDamage hitplace check.
 
Been looking around now for a while but I can't find any way to check where a player has gotten shot using hamsandwich.

ConnorMcLeod 02-08-2013 14:24

Re: Ham_TakeDamage hitplace check.
 
May be with m_LastHitGroup, don't remember.
Else you can use the trace pointer from TraceAttack, TraceAttack is called from there.

Torge 02-08-2013 14:48

Re: Ham_TakeDamage hitplace check.
 
What's about:

PHP Code:

public client_damage(..) 

from csx ?

P1raten 02-08-2013 14:49

Re: Ham_TakeDamage hitplace check.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1890276)
May be with m_LastHitGroup, don't remember.
Else you can use the trace pointer from TraceAttack, TraceAttack is called from there.

Both options would require including fakemeta, correct?

Don't feel like including fakemeta just to call 1 function.

Quote:

Originally Posted by Torge (Post 1890304)
What's about:

PHP Code:

public client_damage(..) 

from csx ?

I was thinking about that, but I was unsure if it was only used to fetch data post damage rather than acting as a modifier.

P1raten 02-08-2013 18:48

Re: Ham_TakeDamage hitplace check.
 
Been searching ever since my last reply but can't find any indication that you are able to modify damage in client_damage, which - obviously - is what I want to do.

I haven't found any other functions either which doesn't require fakemeta. And like I mentioned before I don't feel like including fakemeta just for calling 1 or 2 functions.

Arkshine 02-08-2013 18:57

Re: Ham_TakeDamage hitplace check.
 
Quote:

I don't feel like including fakemeta
Very wrong way of thinking. Just use the available tools whatever the modules, it completely doesn't matter, totally irrelevant to say such things.

P1raten 02-08-2013 18:59

Re: Ham_TakeDamage hitplace check.
 
Quote:

Originally Posted by Arkshine (Post 1890478)
Very wrong way of thinking. Just use the available tools whatever the modules, it completely doesn't matter, totally irrelevant to say such things.

Oh, alright.

I thought I read somewhere that using fakemeta should be avoided if possible. Due to the long execution times and CPU usage.

EDIT: Thanks for nullifying any of my previous doubts, btw.

Arkshine 02-08-2013 19:06

Re: Ham_TakeDamage hitplace check.
 
It's wrong. You just have to learn what does each functions, and using the appropriate one considering your needs, whatever the module. What you can keep in mind is to use as few natives as you can. For example, if you have one engine native which does something, and if you have several natives from fakemeta which do the same thing, you are going to use the engine native. A matter to code intelligently, to choose the best function in your situation, though it requires that you take a look at amxx source code to understand better what does really each natives. You see what I mean ?

P1raten 02-08-2013 19:12

Re: Ham_TakeDamage hitplace check.
 
Quote:

Originally Posted by Arkshine (Post 1890482)
It's wrong. You just have to learn what does each functions, and using the appropriate one considering your needs, whatever the module. What you can keep in mind is to use as few natives as you can. For example, if you have one engine native which does something, and if you have several natives from fakemeta which do the same thing, you are going to use the engine native. A matter to code intelligently, to choose the best function in your situation, though it requires that you take a look at amxx source code to understand better what does really each natives.

Best reply I've ever gotten on this forum. +1

Greatly appreciated.

Arkshine 02-08-2013 19:16

Re: Ham_TakeDamage hitplace check.
 
fakemeta_util, that's something you can actually avoid, because it's a bunch of stocks converted from engine/fun module to fakemeta, and it uses more natives most of times for one thing. As result, slower code. It's not a module, but just wanted to give an example of what you should not do/use.


All times are GMT -4. The time now is 11:11.

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