Raised This Month: $ Target: $400
 0% 

Can you detect mouse click time..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-26-2006 , 08:57   Re: Can you detect mouse click time..
Reply With Quote #1

Quote:
Originally Posted by v3x
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;
} }



It are being memory leakish, add client_disconnect and remove_task(id)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode