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

IN_USE block


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KillerElite
Junior Member
Join Date: Aug 2019
Old 04-22-2020 , 16:48   IN_USE block
Reply With Quote #1

Hi. How can i make a plugin which blocks IN_USE bind?
I mean just when i press a button in a menu (or something like this) and it unblocks when a new round starts.
KillerElite is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-22-2020 , 21:27   Re: IN_USE block
Reply With Quote #2

You can't block a bind. What exactly are you trying to block? Are you trying to prevent the built-in functionality of the use key (picking up items, opening doors, etc.)?

You'll probably need to use fakemeta hook to do a pre-hook for the player's buttons and override the buttons bitsum so that the engine never sees the IN_USE bit set.
__________________
fysiks is offline
KillerElite
Junior Member
Join Date: Aug 2019
Old 04-23-2020 , 04:20   Re: IN_USE block
Reply With Quote #3

Yes, i want to block players to press buttons / open doors etc. (their default E key)
KillerElite is offline
thEsp
BANNED
Join Date: Aug 2017
Old 04-23-2020 , 04:31   Re: IN_USE block
Reply With Quote #4

But how are then players going to complete their objectives such as bomb defusing or hostage rescuing?
thEsp is offline
KillerElite
Junior Member
Join Date: Aug 2019
Old 04-23-2020 , 06:04   Re: IN_USE block
Reply With Quote #5

This is for another mode..not for classic.
KillerElite is offline
KillerElite
Junior Member
Join Date: Aug 2019
Old 04-24-2020 , 09:35   Re: IN_USE block
Reply With Quote #6

uppppppppp? No one?
KillerElite is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-24-2020 , 09:48   Re: IN_USE block
Reply With Quote #7

I've been searching for this same solution, mainly I want to block the "movement slowdown" that happens when you press +use.

I found this and apparently +use is blocked, but not the actual movement slowdown:
Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "Use Restrict" #define VERSION "1.0" #define AUTHOR "Jon" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_forward(FM_CmdStart, "fwdCmdStart"); } public fwdCmdStart(id, handle) {     if(!is_user_alive(id))         return FMRES_IGNORED;             static button;     button = get_uc(handle, UC_Buttons);                     if((button & IN_USE))         button = (button & ~IN_USE)                     set_uc(handle, UC_Buttons, button);             return FMRES_SUPERCEDE; }
__________________
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-26-2020 , 13:04   Re: IN_USE block
Reply With Quote #8

This thread might help you, especially post #4: https://forums.alliedmods.net/showthread.php?t=304909
I'm not sure whether that's the issue here, but I think the changes you make in fwdCmdStart are not reflected onto the physics code, as you are only altering a copy of the usercmd structure.
__________________
klippy 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 07:24.


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