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

How to detect damage or a bullet missed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hode10001
Junior Member
Join Date: Jun 2020
Old 08-25-2020 , 06:06   How to detect damage or a bullet missed?
Reply With Quote #1

If the damage done to the opponent is 0, I want to damage the client.

but, However, I am not sure how to detect the damage part.

Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], client)
{
    if(!IsValidEntity(weapon)) return Plugin_Continue;
    new wIndex = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
		
    if(wIndex == 20) 
    {
        if(damage = 0)
	{
                missdamage = 1
		SDKHooks_TakeDamage(client, client, attacker, float(missdamage), DMG_BULLET);
			
	}
}

public Event_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "attacker"));
	new hurt = GetClientOfUserId(GetEventInt(event, "userid"));
	new damage = GetEventInt(event, "damageamount");

}

Last edited by hode10001; 08-25-2020 at 08:34. Reason: There are missing parts
hode10001 is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-25-2020 , 08:28   Re: How to detect damage or a bullet missed
Reply With Quote #2

PHP Code:
if (damage == 0.0
Although I'm not sure how OnTakeDamage would fire if the damage is 0.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
hode10001
Junior Member
Join Date: Jun 2020
Old 08-25-2020 , 10:40   Re: How to detect damage or a bullet missed?
Reply With Quote #3

Is there a way to make sure the client hasn't done any damage?

Last edited by hode10001; 08-25-2020 at 10:42.
hode10001 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-25-2020 , 12:27   Re: How to detect damage or a bullet missed?
Reply With Quote #4

I think this is continue of this topic https://forums.alliedmods.net/showthread.php?t=326902

Does tracerayattack help... or traceray
__________________
Do not Private Message @me

Last edited by Bacardi; 08-25-2020 at 12:29.
Bacardi 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 23:14.


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