Raised This Month: $ Target: $400
 0% 

fake damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 11-25-2011 , 11:08   fake damage
Reply With Quote #1

inflictor, attacker, damage = 50.0, damageType=DMG_ACID, weapon=weapon_ak47
How can i initiate a fake damage?
Nail is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 11-25-2011 , 11:46   Re: fake damage
Reply With Quote #2

Code:
damage == Float:value
eg.
Code:
damage == 150
or

Code:
damage *= 2
(multiply damage)
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
theanders
SourceMod Donor
Join Date: Aug 2010
Old 11-25-2011 , 12:38   Re: fake damage
Reply With Quote #3

Quote:
Originally Posted by Razmo51 View Post
Code:
damage == Float:value
eg.
Code:
damage == 150
or

Code:
damage *= 2
(multiply damage)
It's not

PHP Code:
damage == 50 
but

PHP Code:
damage 50 
theanders is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 11-25-2011 , 13:05   Re: fake damage
Reply With Quote #4

This is just an example. I need a concrete way
Nail is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-25-2011 , 13:44   Re: fake damage
Reply With Quote #5

you can fire the event player_hurt (if your game has that event)... but the information you provided in your first post leads me to believe you want to fire an event similar to what SDKHooks listens for...

I dunno
TnTSCS is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 11-25-2011 , 14:04   Re: fake damage
Reply With Quote #6

Why doesn't anyone ever remember this.
PHP Code:
SDKHooks_TakeDamage(entityinflictorattackerFloat:damagedamageType=DMG_GENERICweapon=-1, const Float:damageForce[3]=NULL_VECTOR, const Float:damagePosition[3]=NULL_VECTOR); 
That'll do what you want.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-25-2011 , 20:01   Re: fake damage
Reply With Quote #7

doh - I even looked at that, but kept on just going to OnTakeDamage

...:: TnT Edit ::...
Well, I was wrong at what I thought I was looking at - I was looking at the OnTakeDamage and OnTakeDamagePost

either way, here's the section for TakeDamage... Thanks McFlurry for showing us the error of our ways - I shall not forget about this again

Code:
/**  * @brief Applies damage to an entity  *  * @note Force application is dependent on game and damage type(s)  *  * @param    entity         Entity index taking damage  * @param    inflictor      Inflictor entity index  * @param    attacker       Attacker entity index  * @param    damage         Amount of damage  * @param    damageType     Bitfield of damage types  * @param    weapon         Weapon index (orangebox and later) or -1 for unspecified  * @param    damageForce    Velocity of damage force  * @param    damagePosition Origin of damage  * @noreturn  */ native SDKHooks_TakeDamage(entity, inflictor, attacker, Float:damage, damageType=DMG_GENERIC, weapon=-1, const Float:damageForce[3]=NULL_VECTOR, const Float:damagePosition[3]=NULL_VECTOR);

There is a lot of nifty stuff at the end of the .inc file and I just realized that I used SDKHook incorrectly on a plugin... I should have used the SDKHookEx because it returns if the hook was successful or not... gotta fix it in my plugin

Last edited by TnTSCS; 11-25-2011 at 20:09.
TnTSCS 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 11:25.


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