Raised This Month: $ Target: $400
 0% 

Completely remove +Use


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-29-2008 , 10:44   Completely remove +Use
Reply With Quote #1

Hi. I want to completely remove +use ability for players.

Of course I've tried to search but it can't find me a word +use due to that word's shortness.

I've tried register_clcmd(), check IN_USE but unsuccessfuly.

I could do that with Ham_Use but I need all func_ list for that.
__________________
hleV is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 07-29-2008 , 11:52   Re: Completely remove +Use
Reply With Quote #2

on client_connect use client_cmd("unbind e")
then on client_diconnect use client_cmd("bind e +use")
?

EDIT: Unless they dont have use binded to "e"...
__________________

Last edited by minimiller; 07-29-2008 at 11:54. Reason: EDIT:
minimiller is offline
Send a message via MSN to minimiller
Dr. Jan Itor
Veteran Member
Join Date: Mar 2008
Location: there.
Old 07-29-2008 , 12:14   Re: Completely remove +Use
Reply With Quote #3

just that won't stop them from rebinding it but i guess stopping that wouldn't be to hard
__________________
Dr. Jan Itor is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 07-29-2008 , 14:15   Re: Completely remove +Use
Reply With Quote #4

Should work.

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" 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; }
Jon is offline
Old 07-29-2008, 14:51
Iwon
This message has been deleted by Iwon. Reason: Sorry for dbl Post.
Iwon
BANNED
Join Date: Jul 2008
Old 07-29-2008 , 14:53   Re: Completely remove +Use
Reply With Quote #5

PHP Code:

#include <amxmodx>

public plugin_init()
{
       
register_plugin("blocked Use","v1","AmXX")
       
register_clcmd("+use","blockuse")
       
register_clcmd("-use","blockuse")
}

public 
blockuse(id) {
        
client_cmd(id,"say Sorry Use is Blocked")
        return 
PLUGIN_HANDLED

Iwon is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-29-2008 , 18:47   Re: Completely remove +Use
Reply With Quote #6

Thanks, Jon, it works.
Quote:
Originally Posted by Iwon View Post
PHP Code:
 
#include <amxmodx>
 
public plugin_init()
{
       
register_plugin("blocked Use","v1","AmXX")
       
register_clcmd("+use","blockuse")
       
register_clcmd("-use","blockuse")
}
 
public 
blockuse(id) {
        
client_cmd(id,"say Sorry Use is Blocked")
        return 
PLUGIN_HANDLED

I've already said that I've tested with register_clcmd(). It DOESN'T WORK!
__________________
hleV is offline
Old 07-29-2008, 21:12
hzqst
This message has been deleted by hzqst.
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-29-2008 , 21:14   Re: Completely remove +Use
Reply With Quote #7

Well, Jon already gave me working code but still thanks for what you do.
__________________
hleV is offline
Old 07-29-2008, 21:16
hzqst
This message has been deleted by hzqst.
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-01-2008 , 19:40   Re: Completely remove +Use
Reply With Quote #8

I've added a message that is printed before the FMRES_SUPERCEDE and when I connect to server it prints the message infinitely (like 10 times in sec), I didn't even press +Use button.

I believe it can cause lag. Any ideas how to solve it?

This is what I use:
PHP Code:
#include <amxmodx>
#include <fakemeta>
 
new amx_use
 
public plugin_init()
{
        
register_plugin("Disable +Use""1.0""Jon")
 
        
amx_use register_cvar("amx_use""0")
 
        
register_forward(FM_CmdStart"fwdCmdStart")
}
 
public 
fwdCmdStart(idhandleseed)
{
        if (!
is_user_alive(id))
                return 
FMRES_IGNORED
 
        
if (!get_pcvar_num(amx_use)) // I mean if amx_use is "0" or less
        
{      
                static 
button
                button 
get_uc(handleUC_Buttons)
 
                if (
button IN_USE)
                        
button = (button & ~IN_USE)
 
                
set_uc(handleUC_Buttonsbutton)
                
console_print(id"You have no access to that command")
 
                return 
FMRES_SUPERCEDE
        
}
 
        return 
FMRES_IGNORED

__________________

Last edited by hleV; 08-01-2008 at 19:43.
hleV is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 08-01-2008 , 20:26   Re: Completely remove +Use
Reply With Quote #9

I'd use this, but I might of messed something up.
Code:
#include <amxmodx> #include <fakemeta> new p_Enable public plugin_init() {     p_Enable = register_cvar("amx_use","0");     register_forward(FM_PlayerPreThink,"forward_PreThink"); } public forward_PreThink(id) {     if(!is_user_alive(id) || !get_pcvar_num(p_Enable))         return         static Button     pev(id,pev_button,Button);         if(Button & IN_USE)          set_pev(id,pev_button,Button & ~IN_USE); }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-02-2008 , 09:26   Re: Completely remove +Use
Reply With Quote #10

Doesn't work. Can anyone help? I'm really out of ideas...
__________________
hleV 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 05:35.


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