I keep getting these errors: keyword unknown idle_handle
keyword unknown enghandle
I gave var's for both
Code:
var enghandle;
var idle_handle;
idle_handle = ent_playloop(my,idle_sound,20);
enghandle = ent_playloop(my,engsound,50);
sound idle_sound = <Engine_idle_d.wav>; // idlesound file
sound engsound = <Car_Engine.WAV>; // Engine sound file
function tune_esound()
{
while(1) // Repeat forever
{
if ( ( (joy_3) || (key_h) || (mouse_right) ) && (snd_playing(enghandle) == 0) )
{
snd_tune(enghandle,50,10,1);
}
else
{
if((joy_3 == 0) && (key_h == 0) && (mouse_right == 0))
{
snd_stop(enghandle);
snd_tune(idle_handle,20,0,1);
}
}
wait(1);
}
}
I got this example out the manual:
Code:
Example:
var whosh_handle;
whosh_handle = ent_playloop(my,whosh,100);
while (1)
{
ifndef SERVER; // no sound on server
snd_tune(whosh_handle,(10*total_ticks)%100,0,0);
endif;
wait(1);
}
See also: