Raised This Month: $ Target: $400
 0% 

sound help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 04-28-2004 , 08:27   sound help
Reply With Quote #1

i am trying to add some sound to a plugin, but i can't quite get it working the way i want.
my codes looks like this
Code:
public actionKey(id,key){   if ( key == 9 )     show_menu( id , 3, "\yReset or Exit?\w^n^n1. Reset^n2. Exit" )     else  {       g_codeEntered[ id ][ g_codePos[ id ]++  ] = '0' + 1 + key     g_codeEntered[ id ][ g_codePos[ id ] ] = 0           if ( g_codePos[ id ] < 5 )     displayKey( id )     else   {       new sFlags[32], iFlags       if (  (iFlags = authCode( sFlags, 31, g_codeEntered[ id ]  ))  )  {         set_user_flags( id, iFlags )     client_cmd(0, "spk misc/accessgranted")       }     else     client_cmd(0, "spk misc/accessdenied")               }   }   return PLUGIN_HANDLED }
so when i enter a code, if it is right it speaks accessgrated.wav and if it is wrong it speaks accessdenied.wav
what is happending is when i enter a code, it play both wavs.
it plays accessgranted.wav and accessdenied.wav.
hope do i make it only play one if the code is right, and the other if not?
thanks for any help
rex is offline
Send a message via MSN to rex
Isobold
Veteran Member
Join Date: Mar 2004
Old 05-07-2004 , 20:24  
Reply With Quote #2

I've seen in some plugins, that in if then else switches they used ";"

so try out this:

if ( (iFlags = authCode( sFlags, 31, g_codeEntered[ id ] )) ) {
set_user_flags( id, iFlags )
client_cmd(0, "spk misc/accessgranted");
}
else
client_cmd(0, "spk misc/accessdenied");





p.s.: I don't know small at all, I just read some sources of some plugins. But it can't be more false than it is now ;)
Isobold is offline
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 05-07-2004 , 20:36  
Reply With Quote #3

thanks mate, i will try that out.
rex is offline
Send a message via MSN to rex
Reply


Thread Tools
Display Modes

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:34.


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