Raised This Month: $ Target: $400
 0% 

Impulse question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 02-17-2009 , 06:05   Impulse question
Reply With Quote #1

What is the right way to block impulse command via fakemeta?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-17-2009 , 08:53   Re: Impulse question
Reply With Quote #2

you really should start searching o_O

PHP Code:
register_forwardFM_CmdStart"fwdCmdStart" );

// ...

public fwdCmdStartiduc_handleseed ) {
    if( 
get_ucuc_handleUC_Impulse ) == 201 ) { // change 201 to your impulse.
        
set_ucuc_handleUC_Impulse);
        return 
FMRES_HANDLED;
    }
    
    return 
FMRES_IGNORED;

__________________
xPaw is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 02-17-2009 , 09:00   Re: Impulse question
Reply With Quote #3

I knew that way. I had in mind - is it safe to block this function. Or will modification take effect? Cuz I thought if blocking function - other cmd lines of that client think are blocked. And as I knew - buttons don't take effect. So why should this work? Or it does?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-17-2009 , 09:03   Re: Impulse question
Reply With Quote #4

Yes tested, and it works! ;)
__________________
xPaw is offline
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 02-17-2009 , 09:09   Re: Impulse question
Reply With Quote #5

Also, some impulses may be stored by the engine for a while before they are actually executed in pev_impulse (e.g. when trying to turn the flashlight on while reloading).

This only matters if you're planning to block the impulse after detecting it on CmdStart, or if you also want to block it for bots.
__________________
MeRcyLeZZ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-17-2009 , 12:33   Re: Impulse question
Reply With Quote #6

CmdStart is the only way with Fakemeta.
With Ham, you can hook Ham_Player_ImpulseCommands and check pev_impulse value, this forward is called every frame, may be from Pre or Post Think, without Ham, you could try to hook PostThink and check there pev_impulse value.

-edit-
Seems to work in PreThink and in PostThink.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-17-2009 at 12:39.
ConnorMcLeod is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-17-2009 , 13:52   Re: Impulse question
Reply With Quote #7

Ham: http://forums.alliedmods.net/showthr...289#post757289
__________________

anakin_cstrike 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:52.


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