dont know if this will work, someone better have to take a look....
Code:
#include <amxmodx>
#define UNIQUE_TASK_ID 7656
new g_holdtime[33]
public plugin_init()
{
register_clcmd( "+command","PlusCommand" )
register_clcmd( "-command","MinusCommand" )
}
public PlusCommand( id )
{
new args[2]
args[1] = id
set_task(1.0, "LoopFunction", UNIQUE_TASK_ID + id, args, 1, "b" );
return PLUGIN_HANDLED
}
public MinusCommand( id )
{
if( task_exists( UNIQUE_TASK_ID + id ) )
remove_task( UNIQUE_TASK_ID + id )
client_print( id, print_chat, "You helt the button %s secunds",g_holdtime[id] )
g_holdtime[id] = 0 //reset the timer
return PLUGIN_HANDLED
}
public LoopFunction( args[] )
{
new id = args[0];
// do stuff with player id here...
client_print( id, print_chat, "Test Message.." )
g_holdtime[id]++
return PLUGIN_HANDLED
}