Quote:
Originally Posted by KliPPy
In that case you should post the solution, for the benefit of the community.
|
Sure!
PHP Code:
new buttons = pev(id, pev_button);
new oldbuttons = pev(id, pev_oldbuttons);
if(buttons & IN_ATTACK)
{
// Executed when you start holding IN_ATTACK
set_task(2.0, "function", id); // Here you can set the amount of seconds you need to hold IN_ATTACK
}
if( oldbuttons & IN_ATTACK && !( buttons & IN_ATTACK ) )
{
// Executed when you release IN_ATTACK
remove_task(id);
boolean[id] = false;
}
public function(id) {
boolean[id] = true; // This boolean will only be true while holding IN_ATTACK for 2 seconds
}
// Then you can use that boolean in your code.
Here is what I have done with it:
Negev from CS:GO