new Float:g_fLastGameTimeDoprKeyPressed[MAX_PLAYERS+1]
public plugin_init()
{
register_clcmd("drop", "ClientCommand_Drop")
}
public ClientCommand_Drop( id )
{
if( is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE )
{
// execute your code here
new Float:flGameTime = get_gametime()
if( flGameTime - g_fLastGameTimeDoprKeyPressed[id] < MAX_INTERVAL )
{
g_fLastGameTimeDoprKeyPressed[id] = 0.0
// execute code below
}
else
{
g_fLastGameTimeDoprKeyPressed[id] = flGameTime
}
return PLUGIN_HANDLED // this prevent the message "can't drop this weapon" from showing
}
return PLUGIN_CONTINUE
}