Raised This Month: $32 Target: $400
 8% 

Restrict use function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Barlap
Senior Member
Join Date: Apr 2016
Location: Romania
Old 06-16-2021 , 16:11   Restrict use function
Reply With Quote #1

Hello guys, can somebody help me with a code ?
I need to restrict Use function(pressing E button) but also add a cvar for exemple when sv_blockuse 1 dont' let players press E
Barlap is offline
Send a message via ICQ to Barlap Send a message via Skype™ to Barlap
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-16-2021 , 16:34   Re: Restrict use function
Reply With Quote #2

PHP Code:
/* Sublime AMXX Editor v4.2 */

#include <amxmodx>
#include <fakemeta>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

public plugin_init()
{
    
register_forward(FM_CmdStart"fw_CmdStart")
}

public 
fw_CmdStart(iducseed)
{
    static 
buttons
    buttons 
get_uc(ucUC_Buttons)
    
    if (
buttons IN_USE)
    {
        
buttons &= ~IN_USE
        set_uc
(ucUC_Buttonsbuttons)
        return 
FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-16-2021 , 16:37   Re: Restrict use function
Reply With Quote #3

You should hook Ham_Use for every usable entity and return HAM_SUPERCEDE.
__________________








CrazY. is offline
Reply


Thread Tools
Display Modes

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 10:27.


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