You can look for freeze_mode in the manual:
function pause()
{
if(freeze_mode == 2) // all frozen??
{
freeze_mode = 0; // go on
}
else
{
freeze_mode = 2; // pause everything
}
}
But you should rather think about how your game runs.
In case you dont want to stop everything.
You could for example set a variable (for example "myPause")
that holds all your function you want to suspent.
you could indert
while(myPause==1){wait(1);}
in any while loop of actions or other functions,
to stop them while the variable is set.
----
wait is an instruction, stat stops a function for x frames.
So if you have a while-loop that is running continiously,
you need a wait in there, else the function
will block the game (as it takes up all the time, not waiting
for others)
Inserting a wait is a bit like opening a different "Thread".
You can let functions run in paralel then.
They process as long as they dont return or pause when
reaching a wait command.