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

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 06-01-2010 , 23:09   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#611

Having a strange problem. In the error log I get this
Game is TF2

Code:
[SM] Native "GetEntProp" reported: Entity 4095 (4095) is invalid
PHP Code:
public Action:TakeDamageHook(client, &attacker, &inflictor, &Float:damage, &damagetype)
{    
        if(
GetClientTeam(client) == GetEntProp(attackerProp_Data"m_iTeamNum")) 
I thought that max entites were 2048 why would OnTakeDamage return an attacker with such a high index?

About the snippet: Just find out if the attacker is on the same team as the client. In my mod sometimes the attacker will be > MAXCLIENTS so that is why I used GetEntProp(attacker, Prop_Data, "m_iTeamNum")
__________________

Last edited by FoxMulder; 06-01-2010 at 23:13.
FoxMulder is offline
Jоnny
Senior Member
Join Date: Jun 2007
Old 06-02-2010 , 04:24   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#612

maybe it was fire or something else
Jоnny is offline
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 06-02-2010 , 10:08   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#613

Well weird thing is I only get invalid entity 4095 and no other entity.
I just did a quick "fix" that checks to see if entity is more than MaxEntities than ignore it. Still I did find it odd.
__________________

Last edited by FoxMulder; 06-02-2010 at 10:11.
FoxMulder is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 06-05-2010 , 18:11   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#614

is it possable to hook event_death with this extraction and have these hooks with it especially "&damagetype" i need this for 2 plugins im creating and one is for my updated zps plugin and the other something secret

PHP Code:
public Action:TakeDamageHook(client, &attacker, &inflictor, &Float:damage, &damagetype
__________________
Master(d)



Master53 is offline
csaba4567
New Member
Join Date: Apr 2009
Old 06-06-2010 , 06:16   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#615

This code is for ducehacks, can anyone remake for SDKHooks?? Thanks.
It's TF2.

Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <dukehacks>
public OnPluginStart() {
	dhAddClientHook(CHK_TakeDamage, TakeDamageHook);
}
public Action:TakeDamageHook(client, attacker, inflictor, Float:damage, &Float:multiplier, damagetype) {
	if(client!=attacker) {
		decl String:wpn[32];
		GetEdictClassname(inflictor, wpn, sizeof(wpn));
		if(StrEqual(wpn, "tf_projectile_pipe_remote"))
			return Plugin_Stop;
	}
	return Plugin_Continue;
}
csaba4567 is offline
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 06-06-2010 , 06:28   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#616

Quote:
Originally Posted by csaba4567 View Post
This code is for ducehacks, can anyone remake for SDKHooks?? Thanks.
It's TF2.

Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <dukehacks>
public OnPluginStart() {
    dhAddClientHook(CHK_TakeDamage, TakeDamageHook);
}
public Action:TakeDamageHook(client, attacker, inflictor, Float:damage, &Float:multiplier, damagetype) {
    if(client!=attacker) {
        decl String:wpn[32];
        GetEdictClassname(inflictor, wpn, sizeof(wpn));
        if(StrEqual(wpn, "tf_projectile_pipe_remote"))
            return Plugin_Stop;
    }
    return Plugin_Continue;
}
should be something like this:

Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public OnPluginStart() {
    for (new i = 1; i <= MaxClients; i++) {
        SDKHook(i, SDKHook_OnTakeDamage, TakeDamageHook);
    }
}

public Action:TakeDamageHook(victim, &attacker, &inflictor, &Float:damage, &damagetype) {
    if(victim != attacker) {
        decl String:wpn[32];
        GetEdictClassname(inflictor, wpn, sizeof(wpn));
       
        if(StrEqual(wpn, "tf_projectile_pipe_remote"))
            return Plugin_Handled;
    }
   
    return Plugin_Continue;
}
Andersso is offline
csaba4567
New Member
Join Date: Apr 2009
Old 06-06-2010 , 06:51   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#617

lol thx ^^
csaba4567 is offline
csaba4567
New Member
Join Date: Apr 2009
Old 06-06-2010 , 07:43   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#618

Umm,and how should i compile it?
csaba4567 is offline
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 06-06-2010 , 08:04   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#619

well you cant do it in the web compiler, use the compiler included in sourcemod and put the attached file into the include directory (its usually included in the sdkhooks zip that you download)
Attached Files
File Type: inc sdkhooks.inc (6.4 KB, 141 views)
Andersso is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 06-06-2010 , 08:52   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#620

Quote:
Originally Posted by FoxMulder View Post
Well weird thing is I only get invalid entity 4095 and no other entity.
I just did a quick "fix" that checks to see if entity is more than MaxEntities than ignore it. Still I did find it odd.

Inflictor 4095 means "Infected attacked Survivor" and nothing else.
AtomicStryker is offline
Closed Thread



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 07:33.


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