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

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
psychonic

BAFFLED
Join Date: May 2008
Old 03-14-2011 , 19:58   Re: [EXTENSION] SDK Hooks 1.3 (Updated 2010-05-12)
#1181

Quote:
Originally Posted by altex View Post
It does not metter how it's named. The function OnLibraryAdded does not been called at all for extension.

Code:
#pragma semicolon 1

#undef AUTOLOAD_EXTENSIONS
#undef REQUIRE_EXTENSIONS
#include <sdkhooks>

public Plugin:myinfo = {
    name = "test",
    author = "test",
    description = "test",
    version = "test",
    url = "test"
};

public OnLibraryAdded(const String:name[]) {
    LogError("DEBUG ADD name = %s", name);
}

public OnLibraryRemoved(const String:name[]) {
    LogError("DEBUG RM name = %s", name);
}

public OnAllPluginsLoaded() {
    LogError("DEBUG LOADED g_SdkHooksEnabled = %i", GetExtensionFileStatus("sdkhooks.ext") == 1);
}

public OnPluginStart() {
    LogError("DEBUG START g_SdkHooksEnabled = %i", GetExtensionFileStatus("sdkhooks.ext") == 1);
}

L 03/15/2011 - 02:20:08: -------- Mapchange to aim_ag_texture_city --------
L 03/15/2011 - 02:20:08: [test.smx] DEBUG START g_SdkHooksEnabled = 0
L 03/15/2011 - 02:20:08: [test.smx] DEBUG LOADED g_SdkHooksEnabled = 0
<skip>
Connection to Steam servers successful.
   VAC secure mode is activated.
sm exts list
[SM] Displaying 4 extensions:
[01] Automatic Updater (1.3.6): Updates SourceMod gamedata files
[02] Webternet (1.3.6): Extension for interacting with URLs
[03] CS:S Tools (1.3.6): CS:S extended functionality
[04] BinTools (1.3.6): Low-level C/C++ Calling API
sm exts load sdkhooks
[SM] Loaded extension sdkhooks.ext.dll successfully.
sm exts list
[SM] Displaying 5 extensions:
[01] Automatic Updater (1.3.6): Updates SourceMod gamedata files
[02] Webternet (1.3.6): Extension for interacting with URLs
[03] CS:S Tools (1.3.6): CS:S extended functionality
[04] BinTools (1.3.6): Low-level C/C++ Calling API
[05] SDK Hooks (1.3.0-REDUCKS): Source SDK Hooks
sm exts unload 5
[SM] Extension sdkhooks.ext.dll is now unloaded.
oh... this would be because it does not register a library. I meant to add that in v2.0, but it looks like I missed it. Good catch! I will post another build soon.
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-14-2011 , 20:53   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1182

My post a couple pages back has been updated with 2.0.0b2
https://forums.alliedmods.net/showth...24#post1427624
psychonic is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 03-15-2011 , 04:47   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1183

"Do not use unless you're willing to actually act as testing it." Oh,

I added 0.1 sec timer after exec command to load extension to check if it loaded.
__________________
altex is offline
KawMAN
SourceMod Donor
Join Date: Sep 2007
Location: Cracov
Old 03-16-2011 , 13:32   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1184

I'm using this to detect sdkhooks

PHP Code:
if(GetExtensionFileStatus("sdkhooks.ext") == 1)    SDKHooksExist true;
    else                                            
SDKHooksExist false
__________________
KawMAN is offline
Send a message via ICQ to KawMAN Send a message via Skype™ to KawMAN
psychonic

BAFFLED
Join Date: May 2008
Old 03-16-2011 , 13:39   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1185

Quote:
Originally Posted by KawMAN View Post
I'm using this to detect sdkhooks

PHP Code:
if(GetExtensionFileStatus("sdkhooks.ext") == 1)    SDKHooksExist true;
    else                                            
SDKHooksExist false
Even with version 1.x, a better way would be to use the GetFeatureStatus native in SM.

Ex.
Code:
if (GetFeatureStatus(FeatureType_Native, "SDKHook") == FeatureStatus_Available) {     // SDKHooks is loaded and available }

With 2.x and onward, you can use the library functions to also have forwards for load and unload in addition to being able to check existence.
psychonic is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 03-19-2011 , 08:01   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1186

It is possible to prevent change m_nSequence?

I set m_nSolidType = 6
PHP Code:
SetEntProp(entProp_Data"m_nSequence"6); 
but m_nSequence changes every frame, I can't stop it

Last edited by Nail; 03-19-2011 at 13:07.
Nail is offline
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 03-19-2011 , 12:15   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1187

I took the secondary attack block example and wanted to block jumping.
The secondary attack example works, but this won't.

Can anyone confirm that?

Code:
public OnPreThink(client){
    
    new iButtons = GetClientButtons(client);
    if(iButtons & IN_JUMP)
    {
        iButtons &= ~IN_JUMP;
        SetEntProp(client, Prop_Data, "m_nButtons", iButtons);
    }
}
__________________
[ SourceModPlugins.org ][ My Plugins ]

Thank you for donations: [ Paypal ]

Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
Chanz is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-19-2011 , 13:00   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1188

You should probably try OnPlayerRunCmd.
bl4nk is offline
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Old 03-19-2011 , 14:47   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1189

Oh forgot to say that, I already use OnPlayerRunCmd, but I want to test if the PreThink hook works better...
__________________
[ SourceModPlugins.org ][ My Plugins ]

Thank you for donations: [ Paypal ]

Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
Chanz is offline
thejellydude
Junior Member
Join Date: Mar 2011
Old 03-19-2011 , 22:57   Re: [EXTENSION] SDK Hooks 1.3 (NEW 2.0 IN BETA)
#1190

This may be in bad taste as a first post, but could someone briefly direct me on how to set the plugin so that players can only use stock weapons, and each classes "update" weapons? I've looked through the thread, but it's all going over my head, so I apologize for asking again. Any help would be greatly appreciated.
thejellydude 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 08:33.


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