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

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
psychonic

BAFFLED
Join Date: May 2008
Old 07-23-2011 , 15:20   Re: SDK Hooks 2.0 - It's beta time again!
#1511

Quote:
Originally Posted by Aces View Post
Hey, i download this and when i refresh the plugins, i get this:

From what I've seen from people with similar problems, is that they are running the wrong version of SDK Hooks. Am i doing this too? Because i can't seem to find another one

Any help is appreciated.
You are running a plugin that requires the DukeHacks extension which is long outdated.

Many plugins that used dukehacks can be easily converted to use sdkhooks instead, but it's not automatic.
psychonic is offline
Aces
New Member
Join Date: Jul 2011
Old 07-23-2011 , 15:28   Re: SDK Hooks 2.0 - It's beta time again!
#1512

Sorry, i meant i am getting this:


Quote:
Command Executed.
-> sm plugins refresh
L 07/23/2011 - 07:053: [SM] Unable to load plugin "autoload_dukehacks.smx": Required extension "Dukehacks Extension" file("dukehacks.ext") not running
L 07/23/2011 - 07:053: [SM] Unable to load plugin "gamedescoverride.smx": Required extension "sdkhooks" file("sdkhooks.ext") not running
[SM] The plugin list has been refreshed and reloaded.
I meant to delete the dukehacks error, not the SDK hooks error. Sorry I have corrected my original post
Aces is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-28-2011 , 13:56   Re: SDK Hooks 2.0 - It's beta time again!
#1513

ello,

Returning false in shouldcollide for a client seems to be blocking damage.. even from bullets. I know this isn't a bug in SDKHooks, but does this make sense? Does a hook exist that would be able to stop collisions and not block damage?
__________________
Greyscale is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-28-2011 , 22:52   Re: SDK Hooks 2.0 - It's beta time again!
#1514

Can you paste your code? You might need to check to see if the two entities colliding are clients and not > MaxClients.
bl4nk is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 08-01-2011 , 07:33   Re: SDK Hooks 2.0 - It's beta time again!
#1515

hitscan weapons use tracerays to determine if they hit clients, shouldcollide is fired for trace rays aswell. in css if you print debug messages for whenever shouldcollide fires you'll notice it fires when you look at other players aswell, this is the traceray for showing the players name when you have your crosshair over them.
your best bet is to see if the hitscan weapons all use a unique collisiongroup and contentsmask so you can tell if shouldcollide is firing because of damage. if this is for antistick then it would be easier to see if its just 2 players colliding, i think the collisiongroup was always 8 or something.
blodia is offline
unt0uch4bl3
Junior Member
Join Date: Apr 2009
Old 08-01-2011 , 10:24   Re: SDK Hooks 2.0 - It's beta time again!
#1516

Quote:
Originally Posted by Aces View Post
Hey, I'm trying to get Game Description Override, and i have to download SDK Hookes so i download this and when i refresh the plugins, i get this:

From what I've seen from people with similar problems, is that they are running the wrong version of SDK Hooks. Am i doing this too? Because i can't seem to find another one

Any help is appreciated.
Quote:
Originally Posted by ORIGINAPOST
For developers,
...
The new, preferred method to detect the optional existance of SDKHooks is checking for the "sdkhooks" library rather than getting the extension status. This will guarantee that it is 2.0 or higher and is loaded.
This means that something like this which gamedescoverride is using (and other plugins)
Code:
if (GetExtensionFileStatus("sdkhooks.ext") != 1)
Must be replaced with
Code:
if (LibraryExists("sdkhooks.ext"))
I've attached the corrected plugin below.
Attached Files
File Type: sp Get Plugin or Get Source (gamedescoverride.sp - 444 views - 2.1 KB)
File Type: smx gamedescoverride.smx (2.9 KB, 232 views)
unt0uch4bl3 is offline
Fenderic
Junior Member
Join Date: Sep 2009
Old 08-03-2011 , 19:28   Re: SDK Hooks 2.0 - It's beta time again!
#1517

hey sorry, but i'm a bit confused on how i am supposed to compile a plugin that uses SDK Hooks commands. Could someone clear that up for me?
Thank you!
Fenderic is offline
Yeah=}
Member
Join Date: Apr 2010
Location: Ural, Russia
Old 08-05-2011 , 09:07   Re: SDK Hooks 2.0 - It's beta time again!
#1518

Can somebody help me?
What wrong with this code?

Code:
...
SDKHook(client, SDKHook_OnTakeDamage, TakeDamage);
...

public Action:TakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
	if ( IsClient(attacker) 
	&& IsClient(victim)
	&& GetClientFrags(attacker) >= GetMaxFrags() 
	&& GetClientTeam(attacker) != GetClientTeam(victim) )
	{
		PrintToChat(attacker,MSG,"kill");
		ForcePlayerSuicide(attacker);
		
		damage = 0.0;
		
		return Plugin_Changed;
	}
	
	return Plugin_Continue;
}
It spam errors like this:
Code:
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()

Last edited by Yeah=}; 08-05-2011 at 09:12.
Yeah=} is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-05-2011 , 10:00   Re: SDK Hooks 2.0 - It's beta time again!
#1519

Quote:
Originally Posted by Yeah=} View Post
Can somebody help me?
What wrong with this code?

Code:
...
SDKHook(client, SDKHook_OnTakeDamage, TakeDamage);
...

public Action:TakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if ( IsClient(attacker) 
    && IsClient(victim)
    && GetClientFrags(attacker) >= GetMaxFrags() 
    && GetClientTeam(attacker) != GetClientTeam(victim) )
    {
        PrintToChat(attacker,MSG,"kill");
        ForcePlayerSuicide(attacker);
        
        damage = 0.0;
        
        return Plugin_Changed;
    }
    
    return Plugin_Continue;
}
It spam errors like this:
Code:
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
Client index 46? At a thought, perhaps attacker and victim are user IDs and not client indexes. Try using them with GetClientOfUserId.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 08-05-2011 at 10:04.
Powerlord is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-05-2011 , 10:53   Re: SDK Hooks 2.0 - It's beta time again!
#1520

Quote:
Originally Posted by Powerlord View Post
Client index 46? At a thought, perhaps attacker and victim are user IDs and not client indexes. Try using them with GetClientOfUserId.
They're definitely entity (possibly client) indexes, not user ids.

OnTakeDamage is an entity function. Attacker, victim, and inflictor will not necessarily be clients.

Quote:
Originally Posted by Yeah=} View Post
Can somebody help me?
What wrong with this code?

Code:
...
SDKHook(client, SDKHook_OnTakeDamage, TakeDamage);
...

public Action:TakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
	if ( IsClient(attacker) 
	&& IsClient(victim)
	&& GetClientFrags(attacker) >= GetMaxFrags() 
	&& GetClientTeam(attacker) != GetClientTeam(victim) )
	{
		PrintToChat(attacker,MSG,"kill");
		ForcePlayerSuicide(attacker);
		
		damage = 0.0;
		
		return Plugin_Changed;
	}
	
	return Plugin_Continue;
}
It spam errors like this:
Code:
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
L 08/05/2011 - 16:22:48: [SM] Native "GetClientFrags" reported: Client index 46 is invalid
L 08/05/2011 - 16:22:48: [SM] Displaying call stack trace for plugin "bonuses.smx":
L 08/05/2011 - 16:22:48: [SM]   [0]  Line 490, bonuses.sp::TakeDamage()
Your IsClient function is garbage if it's returning true on index 46.
psychonic 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 18:28.


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