Well first you need make up your mind what problem you want to tell us, either the dozer wont compile, or it crashes, but hardly both at the same time.

When it wont compile, look at the line where an error is indicated, it probably uses a function that you dont have when your version is older. You should update your version then.

Your first code did not work because you were setting your "epressed" variable in such a strange way that the function was always called twice, and the sound was switched off immediately after it was switched on. Use the debugger, then you can easily see what happens in such cases. Without debugger, its just stumbling in the dark.