Page 1 of 1

Question about restarting a game...

Posted: Fri Jan 23, 2004 2:28 am
by DriakTravo
Ok I am making this game. Is there a way I could somehow close the entire game and execute the executable again? (would close the game and start it from the begining)

Posted: Fri Jan 23, 2004 2:44 am
by Bong-Mong

Code: Select all

FileName$ = "C:\Windows\System32\shutdown.exe"
Parameter$ = "-s -t 10"
if RunProgram(FileName$, Parameter$, "", 1)
delay(500)
endif
end
run file first, then close

Posted: Fri Jan 23, 2004 2:51 am
by Proteus

Code: Select all

ProcedureDLL.s GetExeName()
  sApp.s=Space(256)
  GetModuleFileName_(GetModuleHandle_(0), @sApp, 256)
  ProcedureReturn sApp
EndProcedure

RunProgram(GetExeName())
End
This should work.

Posted: Fri Jan 23, 2004 4:13 am
by DriakTravo
Ahh! Ok thanks, Ill try it out...

Thank you very much

Posted: Mon Feb 02, 2004 12:24 am
by DriakTravo
Thank you SOOO much Proteus, it worked like a charm!

Bong-Mong, for some reason, I was not able to get yours to work... But thanks for trying. :)

Proteus, I will add you to the credits of the game I am making. :D

Posted: Mon Feb 02, 2004 2:04 pm
by Proteus
I'm glad I could help. :)