You have function main which is a function that is called when the engine starts. In there you need to call level_load(level_name) Actions are defined outside of the function anywhere in the code, they look like this: Code:
action test { // code goes here while (1) { wait(1); } }
You can't make an action inside a function, it must be outside, anywhere you want.