Raised This Month: $ Target: $400
 0% 

Finding out how long button is pressed & + command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 05-21-2005 , 10:15  
Reply With Quote #8

dont know if this will work, someone better have to take a look....

Code:
#include <amxmodx> #define UNIQUE_TASK_ID 7656 new g_holdtime[33] public plugin_init() {     register_clcmd( "+command","PlusCommand" )     register_clcmd( "-command","MinusCommand" ) } public PlusCommand( id ) {     new args[2]     args[1] = id     set_task(1.0, "LoopFunction", UNIQUE_TASK_ID + id, args, 1, "b" );     return PLUGIN_HANDLED } public MinusCommand( id ) {     if( task_exists( UNIQUE_TASK_ID + id ) )         remove_task( UNIQUE_TASK_ID + id )     client_print( id, print_chat, "You helt the button %s secunds",g_holdtime[id] )     g_holdtime[id] = 0 //reset the timer     return PLUGIN_HANDLED } public LoopFunction( args[] ) {     new id = args[0];     // do stuff with player id here...     client_print( id, print_chat, "Test Message.." )     g_holdtime[id]++     return PLUGIN_HANDLED }
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
 



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 16:38.


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