Raised This Month: $ Target: $400
 0% 

[Question] Block E key


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-29-2013 , 17:31   [Question] Block E key
Reply With Quote #1

how can i block [E] Key when RoundEnd?

no one can't hold on E key..

when new Round Start the key back.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2013 , 18:29   Re: [Question] Block E key
Reply With Quote #2

It is not possible to know what key is being pressed. You can detect when people send a command to the server such at the +use command. This is done with hooking FM_CMDStart and checking the buttons for IN_USE.

If you are unwilling or unable to do this on your own, you can wait for someone to do it for you.
__________________

Last edited by fysiks; 12-29-2013 at 18:30.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-30-2013 , 01:42   Re: [Question] Block E key
Reply With Quote #3

Should work with buttons, doors, ...
Can't work with vehicles.

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1

#define PLUGIN "No Use @ Round End"
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

const m_afButtonPressed 246;

new 
HamHook:g_iHhCBasePlayerObjectCaps;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
DisableHamForwardg_iHhCBasePlayerObjectCaps RegisterHam(Ham_ObjectCaps"player""OnCBasePlayer_ObjectCaps"false) );

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
    
register_logevent("Event_Round_End"2"1=Round_End");
}

public 
Event_HLTV_New_Round()
{
    
DisableHamForward(g_iHhCBasePlayerObjectCaps);
}

public 
Event_Round_End()
{
    
EnableHamForward(g_iHhCBasePlayerObjectCaps);
}

public 
OnCBasePlayer_ObjectCapsid )
{
    new 
buttons pev(idpev_button);
    if( 
buttons IN_USE )
    {
        
set_pev(idpev_buttonbuttons & ~IN_USE);
    }
    
buttons get_pdata_int(idm_afButtonPressed);
    if( 
buttons IN_USE )
    {
        
set_pdata_int(idm_afButtonPressedbuttons & ~IN_USE);
    }
    return 
HAM_HANDLED;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-30-2013 , 14:24   Re: [Question] Block E key
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
It is not possible to know what key is being pressed. You can detect when people send a command to the server such at the +use command. This is done with hooking FM_CMDStart and checking the buttons for IN_USE.

If you are unwilling or unable to do this on your own, you can wait for someone to do it for you.
it's possible, i just need to block +use [E] Key that all for endRound.. i will Test the @canno code
Quote:
Originally Posted by ConnorMcLeod View Post
Should work with buttons, doors, ...
Can't work with vehicles.

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1

#define PLUGIN "No Use @ Round End"
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

const m_afButtonPressed 246;

new 
HamHook:g_iHhCBasePlayerObjectCaps;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
DisableHamForwardg_iHhCBasePlayerObjectCaps RegisterHam(Ham_ObjectCaps"player""OnCBasePlayer_ObjectCaps"false) );

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
    
register_logevent("Event_Round_End"2"1=Round_End");
}

public 
Event_HLTV_New_Round()
{
    
DisableHamForward(g_iHhCBasePlayerObjectCaps);
}

public 
Event_Round_End()
{
    
EnableHamForward(g_iHhCBasePlayerObjectCaps);
}

public 
OnCBasePlayer_ObjectCapsid )
{
    new 
buttons pev(idpev_button);
    if( 
buttons IN_USE )
    {
        
set_pev(idpev_buttonbuttons & ~IN_USE);
    }
    
buttons get_pdata_int(idm_afButtonPressed);
    if( 
buttons IN_USE )
    {
        
set_pdata_int(idm_afButtonPressedbuttons & ~IN_USE);
    }
    return 
HAM_HANDLED;

Thank you, I'll check it
E button at the end of Round

what you mean can't work with vehicles.?

Last edited by Fuck For Fun; 06-15-2018 at 13:10.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-30-2013 , 14:34   Re: [Question] Block E key
Reply With Quote #5

Code is short and efficient for what you asked.

I mean, E is +use command, and +use does multiple things, such as drive vehicles (cars, trucks, ..), use trains, open doors.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-30-2013 at 14:34.
ConnorMcLeod is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-30-2013 , 16:03   Re: [Question] Block E key
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Code is short and efficient for what you asked.

I mean, E is +use command, and +use does multiple things, such as drive vehicles (cars, trucks, ..), use trains, open doors.
huh, okay dude thank
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2013 , 16:16   Re: [Question] Block E key
Reply With Quote #7

Quote:
Originally Posted by Fuck For Fun View Post
it's possible
It's not possible to detect keyboard keys. Please don't try to perpetuate that it's possible. You can only detect commands sent to the server. E.g. if I change my +use key to "R" then you would never know.
__________________
fysiks is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-30-2013 , 16:19   Re: [Question] Block E key
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
It's not possible to detect keyboard keys. Please don't try to perpetuate that it's possible. You can only detect commands sent to the server. E.g. if I change my +use key to "R" then you would never know.
Ah you mean it, then replace another [key] button .. I thought you said that you can't block the button + use
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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 20:23.


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