 |
|
Veteran Member
Join Date: Oct 2004
Location: US
|

06-26-2006
, 03:21
Re: Can you detect mouse click time..
|
#5
|
Well if you want to calculate it in seconds I would do something like this:
Code:
Code:
#include <amxmodx>
#include <engine>
new g_iSecs[33];
public client_putinserver(id)
{
g_iSecs[id] = 0;
if(!task_exists(id))
set_task(1.0 , "count" , id , _ , _ , "b");
}
public count(id)
{
if(!is_user_alive(id))
{
g_iSecs[id] = 0;
return;
}
if(get_user_button(id) & IN_ATTACK)
g_iSecs[id]++;
else if(!(get_user_button(id) & IN_ATTACK) && g_iSecs[id])
{
client_print(id , print_chat , "* You held the attack button for %d second%s" , g_iSecs[id] , (g_iSecs[id] == 1) ? "" : "s");
g_iSecs[id] = 0;
}
}
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116
I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
Last edited by v3x; 06-26-2006 at 03:24.
|
|
|
|