What is your problem? sys_exit and wait are explained in the manual.

http://manual.3dgamestudio.net/aexit.htm