Raised This Month: $ Target: $400
 0% 

Check if command is being executed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-31-2010 , 11:13   Check if command is being executed
Reply With Quote #1

How can I check if is user executing a command?
For example i register:
PHP Code:
////globabl
new blabled[33]

////init
register_clcmd("blablabla""omgrotfl"
And then I bind '+blablabla' for 'v' button.

Now I want to check if v is pressed (is blablabla executing) and if it is then switch blabled[id] = 1, or if it is not then turn blabled[id] = 0.
So if user is holding V then 'blabled[id] = 1', if he releases v his 'blabled[id] = 0'.
How can I do that? V is just an example, I want to check is 'blablabla' working in current moment.
Gadzislaw007 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-31-2010 , 11:37   Re: Check if command is being executed
Reply With Quote #2

PHP Code:
register_clcmd"+test" "Press" );
register_clcmd"-test" "Release" );

public 
Pressid )
{
    
client_printid print_chat "pressed" );
    
blabledid ] = 1;
}

public 
Releaseid )
{
    
client_printid print_chat "released" );
    
blabledid ] = 0;

__________________

Last edited by Bugsy; 07-31-2010 at 11:42.
Bugsy is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-31-2010 , 14:59   Re: Check if command is being executed
Reply With Quote #3

Omg... I didn't think about such a simple way.
Thanks Bugsy! You saved my ass again.
Gadzislaw007 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-01-2010 , 13:59   Re: Check if command is being executed
Reply With Quote #4

Quote:
Originally Posted by Gadzislaw007 View Post
Omg... I didn't think about such a simple way.
Thanks Bugsy! You saved my ass again.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
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 00:12.


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