Why is my sound playing here?(solved)

Started by Squinky, Fri 19/03/2004 03:40:32

Previous topic - Next topic

Squinky

I've got an lec styled gui, programmed to play a sound (13) when you change user modes, which works good. Then I have the inventory box arrows programmed to play a different sound (14) which works good....but...after I've played the inv sound (14) and I click on the user modes I get it playing both sounds at once...what am I missing here?


if (interface == MAINGUI) {
   if (button == 0){
PlaySound (13);
SetMode("give");
 }
   if (button == 1){
PlaySound (13);  
SetMode("pick up");
}
   if (button == 2) {
PlaySound (13);
SetMode("use");
}
   if (button == 3) {
PlaySound (13);
SetMode("open");
}
   if (button == 4) {
PlaySound (13);
SetMode("talk to");
}
   if (button == 5) {
PlaySound (13);
SetMode("push");
}
   if (button == 6) {
PlaySound (13);
SetMode("close");
}
   if (button == 7) {
PlaySound (13);
SetMode("look at");
}
   if (button == 8) {
PlaySound (13);
SetMode("pull");
}
/**/    if ((button == 10) && (game.top_inv_item < game.num_inv_items - (game.num_inv_displayed-1)))
/**/      game.top_inv_item = game.top_inv_item + (game.num_inv_displayed/2);
/**/    PlaySound (14);
/**/   if ((button == 9) && (game.top_inv_item > 0))
/**/      game.top_inv_item = game.top_inv_item - (game.num_inv_displayed/2);
/**/    PlaySound (14);
/**/       }

Gilbert

Well, my guess:

/**/    if ((button == 10) && (game.top_inv_item < game.num_inv_items - (game.num_inv_displayed-1))) {
/**/      game.top_inv_item = game.top_inv_item + (game.num_inv_displayed/2);
/**/    PlaySound (14);
/**/   if ((button == 9) && (game.top_inv_item > 0))
/**/      game.top_inv_item = game.top_inv_item - (game.num_inv_displayed/2);
/**/    PlaySound (14);
 }
/**/       }

Squinky

That did it, thanks for poiting out the obvious for mr, heh...

SMF spam blocked by CleanTalk