New Question:
Here I am trying to create a delay between using buttons..
now the trace attack seems to skip right to the client_print
and the ham_use seems to just do nothing... it normal...
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
new Float:fBug[ 33 ];
public plugin_init()
{
RegisterHam( Ham_Use, "func_button", "FwdTraceButtonUse" );
RegisterHam( Ham_TraceAttack, "func_button", "FwdTraceButtonAttack" );
}
public client_putinserver( client )
{
fBug[ client ] = get_gametime();
}
public FwdTraceButtonAttack( ent, attacker )
{
if ( fBug[ attacker ] + 1.5 < get_gametime() )
{
dllfunc( DLLFunc_Use, ent, attacker );
fBug[ attacker ] = get_gametime();
return 1;
}
client_print( attacker, print_center, "You need to wait at least 1.5 Seconds between using buttons." );
return 1;
}
public FwdTraceButtonUse( client )
{
if ( fBug[ client ] + 1.5 < get_gametime() )
{
fBug[ client ] = get_gametime();
client_print( client, print_center, "You need to wait at least 1.5 Seconds between using buttons." );
return 1;
}
return 4;
}
__________________