here is what I have so far
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
new const gs_PLUGIN[] = "test"
new const gs_VERSION[] = "1.0"
new const gs_AUTHOR[] = "SubStream"
new gi_players[32]
new gi_playercnt
new gi_playernum
new gi_playerID
public plugin_init ()
{
register_plugin ( gs_PLUGIN, gs_VERSION, gs_AUTHOR )
register_forward ( FM_PlayerPreThink, "fn_hookprethink" )
}
public fn_hookprethink ( id )
{
if ( get_user_button ( id ) & IN_ATTACK )
{
entity_set_int ( id, EV_INT_button, get_user_button ( id ) & ~IN_ATTACK )
fn_saymessage ()
return FMRES_SUPERCEDE
}
else
{
return FMRES_IGNORED
}
}
public fn_saymessage ()
{
get_players ( gi_players, gi_playercnt, "ch" )
for ( gi_playernum = 0; gi_playernum < gi_playercnt; gi_playernum++ )
{
gi_playerID = gi_players[gi_playernum]
client_print ( gi_playerID, print_center, "hello its working" )
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
I am testing to see if I can block +attack... I have read other forums threads in here about this but haven't got it working yet ... I have looked up as much as I can and according to other topics posted this is supposed to work but its not. Can someone tell me what I am doing wrong I appreciate any help to actually get this working. My goal is to block +attack.
The message shows up when I press the attack button, but I am still allowed to fire.
I already looked at
Restricting buttons if you need to reference to where I got my information.
Edit:
Ven solved the problem. Thank you Ven I appreciate it.