ok ive got the code:

function init_alarm()
{
while (alarm == 0) {wait (1);}
snd_loop(alarm_wav, 100, 0); ]-- turns on
}

function Alarm_off()
{
if (alarm == 1) {wait (1);}
snd_stop(alarm_wav); ]-- should turn off
alarm = 0;
msg_show(level_cht,10);
}

can anyone help thanks.