PDA

View Full Version : Block "+use" command


DragosHh
06-18-2010, 04:40
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.


#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
You can't hook original + commands like +use, +attack,... with register_clcmd()

Try to use Ham_Use

hleV
06-18-2010, 06:44
Search.

abdul-rehman
06-18-2010, 10:33
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
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
try putting this plugin in the top of plugins.ini

xPaw
06-18-2010, 16:02
try putting this plugin in the top of plugins.ini
it won't make any difference because you can't hook +use like that