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

Problem with Hacks Extension: Impulse Hook


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-02-2008 , 17:40   Problem with Hacks Extension: Impulse Hook
Reply With Quote #1

Problem with Hacks Extension: Impulse Hook

It's all working fine, except that the Impulse Callback function is getting
called like 100 times/second.

I think it's getting called every gameframe, but I need it to only get called when a client did an impulse.

Is this a bug ? Or am I doing something wrong.

The Code:

Code:
new g_iHooks[MAXPLAYERS + 1] = { -1, ... };

public OnClientPutInServer(client) {
    PrintToChatAll("entered the server");
    
    g_iHooks[client] = Hacks_Hook(client, HACKS_HTYPE_IMPULSECOMMANDS, Command_Impulse);
}

public Command_Impulse(client, num, dummy1, dummy2, dummy3, dummy4) {
    PrintToChatAll("Impulse detected %d", num);
    
    return 0;
}
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0
Impulse detected 0

When I spray a logo:
Impulse detected 201
Impulse detected 201
Impulse detected 201
Impulse detected 201
Impulse detected 201
Impulse detected 201
Impulse detected 201
Impulse detected 201

it never stops :/

Last edited by berni; 02-02-2008 at 17:49.
berni is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-02-2008 , 18:55   Re: Problem with Hacks Extension: Impulse Hook
Reply With Quote #2

Why not just hook the impulse command normally?
bl4nk is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-02-2008 , 20:55   Re: Problem with Hacks Extension: Impulse Hook
Reply With Quote #3

Because it's not a normal command. You can't hook it with RegConsoleCmd.
berni is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 02-02-2008 , 23:26   Re: Problem with Hacks Extension: Impulse Hook
Reply With Quote #4

Just keep track if they are pressing it or not, it won't hurt performance or anything, it's a pretty simple check too
Greyscale is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-02-2008 , 23:36   Re: Problem with Hacks Extension: Impulse Hook
Reply With Quote #5

pressing what ?
I need to able to hook when the impulse command is typed into console.
Like when someone executes impulse 83 to spawn an airboat and such things.
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-05-2008 , 05:38   Re: Problem with Hacks Extension: Impulse Hook
Reply With Quote #6

Can someone help me ? Still haven't got a solution to this.
berni 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 16:36.


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