Raised This Month: $62 Target: $400
 15% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 01-24-2010 , 15:13   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#331

Jamster. Think hooks only call if they're set. With m_nNextThinkTick. Just set it's value to 1 when you hook think and reset it to 1 at every tick.
Sammy-ROCK! is offline
Jamster
Veteran Member
Join Date: Jun 2008
Old 01-24-2010 , 15:40   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#332

OK, thanks, sorry, I wish I knew more about controlling entities and such and that makes sense, of course, thanks.

edit: though I still can't get it to work, haha, I am sure what you are saying is right though, I'm just gonna have to play with it.

Last edited by Jamster; 01-24-2010 at 15:58.
Jamster is offline
nonick
BANNED
Join Date: Jul 2008
Old 01-24-2010 , 17:30   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#333

Plz anyone remake that code ;D Thx
nonick is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 01-26-2010 , 20:19   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#334

I modded sdkhooks to fit my need (Added PreThinkPost, best place to edit m_flMaxSpeed since movement calculations are done right after). I tried to compile for linux but the following error showed up:
Code:
hl2sdk-ob/public/tier0/platform.h:992: error: no matching function for call to ‘operator new(unsigned int, char**&)’
Here's the file and function in question:
Code:
//----------------------------------------------------------------------------- 
// Methods to invoke the constructor, copy constructor, and destructor 
//----------------------------------------------------------------------------- 
 
template <class T> 
inline void Construct( T* pMemory ) 
{ 
    ::new( pMemory ) T; 
} 
 
template <class T> 
inline void CopyConstruct( T* pMemory, T const& src ) 
{ 
    ::new( pMemory ) T(src);  //Line 992
} 
 
template <class T> 
inline void Destruct( T* pMemory ) 
{ 
    pMemory->~T(); 
 
#ifdef _DEBUG 
    memset( pMemory, 0xDD, sizeof(T) ); 
#endif 
}

Last edited by Sammy-ROCK!; 01-26-2010 at 20:23.
Sammy-ROCK! is offline
KirjiroSenzuki
Junior Member
Join Date: Jan 2010
Old 01-27-2010 , 02:51   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#335

Where do I put this?

Last edited by KirjiroSenzuki; 01-27-2010 at 02:52. Reason: 1 wrong word
KirjiroSenzuki is offline
InstantDeath
Senior Member
Join Date: Mar 2007
Old 01-27-2010 , 05:48   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#336

Um... Wtf?

Code:
L 01/27/2010 - 03:42:59: [SM] Native "SDKHook" reported: Entity 1 is invalid
L 01/27/2010 - 03:42:59: [SM] Displaying call stack trace for plugin "crpg.smx":
L 01/27/2010 - 03:42:59: [SM]   [0]  Line 312, D:\Steam\SteamApps\jasace5\counter-strike source\cstrike\addons\sourcemod\scripting\crpg.sp::OnClientAuthorized()
my code its pointing to:
Code:
public OnClientAuthorized(client, const String:auth[])
{
    SDKHook(client, SDKHook_Touch, Entity_Touch);
Could someone explain to me why its telling me Entity 1 is invalid? I had like 3 bots on at the time. could that be the reason?
__________________
InstantDeath is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 01-27-2010 , 06:33   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#337

When a player is authorized it doesn't mean he spawned yet. The client index is valid, but as a entity index it's not because the player entity haven't been created yet, I think.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
psychonic

BAFFLED
Join Date: May 2008
Old 01-27-2010 , 08:41   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#338

Quote:
Originally Posted by InstantDeath View Post
Um... Wtf?

Code:
L 01/27/2010 - 03:42:59: [SM] Native "SDKHook" reported: Entity 1 is invalid
L 01/27/2010 - 03:42:59: [SM] Displaying call stack trace for plugin "crpg.smx":
L 01/27/2010 - 03:42:59: [SM]   [0]  Line 312, D:\Steam\SteamApps\jasace5\counter-strike source\cstrike\addons\sourcemod\scripting\crpg.sp::OnClientAuthorized()
my code its pointing to:
Code:
public OnClientAuthorized(client, const String:auth[])
{
    SDKHook(client, SDKHook_Touch, Entity_Touch);
Could someone explain to me why its telling me Entity 1 is invalid? I had like 3 bots on at the time. could that be the reason?
Quote:
Originally Posted by rhelgeby View Post
When a player is authorized it doesn't mean he spawned yet. The client index is valid, but as a entity index it's not because the player entity haven't been created yet, I think.
This is correct. The client entity is created with OnClientPutInServer. If you need a forward that's safe for that as well as being authorized, use OnClientPostAdminCheck
psychonic is offline
alinayg
Senior Member
Join Date: Apr 2009
Location: USA, RI
Old 01-28-2010 , 00:37   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#339

Should I use SDKHooks 1.2 Respin (OB, SM 1.3.x) For my TF2 server running SM 1.4.x?
__________________
alinayg is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-28-2010 , 00:44   Re: [EXTENSION] SDK Hooks 1.2 (Updated 01/15/10)
#340

Quote:
Originally Posted by alinayg View Post
Should I use SDKHooks 1.2 Respin (OB, SM 1.3.x) For my TF2 server running SM 1.4.x?
yes
psychonic is offline
Closed Thread


Thread Tools
Display Modes

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 01:05.


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