AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block "+use" command (https://forums.alliedmods.net/showthread.php?t=129903)

DragosHh 06-18-2010 04:40

Block "+use" command
 
Hello guys!
I'm trying to make a plugin wich block the "+use" command or detect the use key pressing, and block the command.

Until now i did this, but doesn't block the "+use" command.

Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
    register_plugin("Block use cmd", "1.0", "DragosHh")
    register_clcmd("+use", "block_cmd")
}


public block_cmd(id) {
    client_print(id,print_center,"U cannot use the use key!")
    return PLUGIN_HANDLED
}

--------------
Thanks in advance and sorry for my bad English.

drekes 06-18-2010 05:50

Re: Block "+use" command
 
You can't hook original + commands like +use, +attack,... with register_clcmd()

Try to use Ham_Use

hleV 06-18-2010 06:44

Re: Block "+use" command
 
Search.

abdul-rehman 06-18-2010 10:33

Re: Block "+use" command
 
Hook FM_CmdStart and then check if user has pressed IN_USE key...if so then return FMRES_SUPERCEDE to block it..:)

wrecked_ 06-18-2010 11:08

Re: Block "+use" command
 
Code:
new Buttons = get_uc( uc, UC_Buttons ) if( Buttons & IN_USE ) {     Buttons &= ~IN_USE     set_uc( uc, UC_Buttons, Buttons ) }

kikifrh 06-18-2010 14:38

Re: Block "+use" command
 
try putting this plugin in the top of plugins.ini

xPaw 06-18-2010 16:02

Re: Block "+use" command
 
Quote:

Originally Posted by kikifrh (Post 1212662)
try putting this plugin in the top of plugins.ini

it won't make any difference because you can't hook +use like that


All times are GMT -4. The time now is 14:57.

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