Raised This Month: $ Target: $400
 0% 

Get xyz coords as for RadiusDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-19-2015 , 06:47   Re: Get xyz coords as for RadiusDamage
Reply With Quote #1

Here's the official documentation if you haven't found it by now: http://amxmodx.org/api/engine_stocks/fakedamage
If a function is a stock (has stock in front of the function name), it means it's implemented in PAWN. Just click the File link in the upper right corner of the page and find the function in there.
If it is a native however, like radius_damage() is (RadiusDamage() just calls radius_damage()), its implementation is found within the AMXX (or its modules). You can easily browse through the code at GitHub or Cross Reference.

To answer your question: you could call TakeDamage on victim
Code:
/**
  * Description:        Usually called whenever an entity takes any kind of damage.
  *                    Inflictor is the entity that caused the damage (such as a gun).
  *                    Attacker is the entity that tirggered the damage (such as the gun's owner).
  * Forward params:    function(this, idinflictor, idattacker, Float:damage, damagebits);
  * Return type:        Integer.
  * Execute params:    ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);
  */
  Ham_TakeDamage
Just like so:
PHP Code:
ExecuteHamB(Ham_TakeDamageVictimInflictorAttackerFloatDamageDamageType); 
You could pass attacker ID to both inflictor and attacker, shouldn't matter. For DamageType DMG_GENERIC should do okay, but if you want to go more in-depth about damage types, here.

EDIT:
Sending the explosion to different location works the way you did it, but the thing is, you have overridden fOrigin[]'s value by calling pev() and saving its result into that array. You should take the execution order in account too.

Last edited by klippy; 09-19-2015 at 06:53.
klippy 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 22:11.


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