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