you can do it this way. put this at the top of the main function:
ifdef server;
exec("your.exe","-cl -ip ....");
endif;
ifndef client;
exec("your.exe","-cl -ip ....");
endif;
it will just check if the game is started as a server, if it does it restarts it as a client to your server(ip must ofcourse be changed) and if the game is NOT started as a multiplayer client. it starts it again with and connects to ip...