This code I THOUGHT would play a sound when I hit the "j" key.

Instead, it plays at startup and if i do press the "j" key, the engine aborts with "acknex.exe has encountered a problem..."!

Is this not the right code for it?

Code:

on_j= smb_jump();

...

function smb_jump()
{
snd_play (jump_snd,100,0);
}



I already tried a while() loop, but all that does is play the sound every frame cycle, and that gets really annoying.

So, can anyone help?


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}