AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Impulse question (https://forums.alliedmods.net/showthread.php?t=85864)

MPNumB 02-17-2009 06:05

Impulse question
 
What is the right way to block impulse command via fakemeta?

xPaw 02-17-2009 08:53

Re: Impulse question
 
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;



MPNumB 02-17-2009 09:00

Re: Impulse question
 
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?

xPaw 02-17-2009 09:03

Re: Impulse question
 
Yes tested, and it works! ;)

MeRcyLeZZ 02-17-2009 09:09

Re: Impulse question
 
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.

ConnorMcLeod 02-17-2009 12:33

Re: Impulse question
 
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.

anakin_cstrike 02-17-2009 13:52

Re: Impulse question
 
Ham: http://forums.alliedmods.net/showthr...289#post757289


All times are GMT -4. The time now is 16:52.

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