Raised This Month: $ Target: $400
 0% 

Twice in use and emite sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mati009988
Member
Join Date: Jul 2009
Old 07-29-2010 , 06:43   Twice in use and emite sound
Reply With Quote #1

Hello,
I would like that when you double-press in_use executes function.
I try
PHP Code:
new button get_uc(uc_handleUC_Buttons);
new 
oldbutton get_user_oldbutton(id);

if((
button IN_USE) && (oldbutton IN_USE)){
    
/**** CODE ****/

but it does not work.

------------------------------------------------------------------

PHP Code:
public EmitSound(idiChannelszSound[], Float:fVolFloat:fAttniFlagsiPitch 
{
    if(
equal(szSound"common/wpn_denyselect.wav"))
    {
        
/*** CODE ***/
    
}
    
    return 
FMRES_IGNORED;

What sound is emitted when:
disarms a bomb
planting a bomb
rescue a hostage
mati009988 is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-29-2010 , 06:58   Re: Twice in use and emite sound
Reply With Quote #2

PHP Code:
// global
new clicked[33]
//init
register_clcmd("use""cmd_use"); // when click "use" go to cmd_use

//public
public cmd_use(id)
{
if(
clicked[id]) // if user press use before
{
clicked[id] = // reset double press
////HERE CODE when user presses "use" twice time in with max 1 second delay
}
else
{
clicked[id] = // he pressed! we noticed it!
set_task(1.0"reset_click"id// times up for second press
}
}

public 
reset_click(id)
           
clicked[id] = // 

Last edited by Gadzislaw007; 07-29-2010 at 07:02.
Gadzislaw007 is offline
mati009988
Member
Join Date: Jul 2009
Old 07-29-2010 , 11:42   Re: Twice in use and emite sound
Reply With Quote #3

Thank you. Yet only the second.
mati009988 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:10.


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