evilbunnie Posted September 10, 2009 Author Share Posted September 10, 2009 Well this is my first ever tut so be nice :PWell it is all in the server sideFirst open server.vbpnow open frmload and find```Private Sub Form_Load() Me.Show Call InitServerEnd Sub```and add under me.show```Call PutVar(App.Path & "\restart.ini", "restart", "restart", "0")```next open frmServer and add one timer and make the interval 500 so the server doesn't lag next double click the timer and add```If GetVar(App.Path & "\restart.ini", "restart", "restart") = "1" Then Shell ("restart.exe") Call PutVar(App.Path & "\restart.ini", "restart", "restart", "0")Call DestroyServer End If```Now make a new visual basic project called restart and put what ever you like on in and in formload put```Me.ShowShell ("Server.exe")End```now compile restart to restart.exeand compile eclipseNext,open your main.txt and search for "commands"now add anywhere in that sub``` Case "/rs" Call PutVar(App.path & "\restart.ini", "restart", "1") exit sub```Hope that works if it doesn't please tell me! :azn:–-evilbunnie--- Link to comment Share on other sites More sharing options...
Sigait Posted September 10, 2009 Share Posted September 10, 2009 well I haven't tested this or anything but,if the server goes off,the client disconnects too.Sigait. Link to comment Share on other sites More sharing options...
Robin Posted September 10, 2009 Share Posted September 10, 2009 You're not shutting down the server at all, you're just killing it.Just get the command to boot up the rebooter, then shutdown the server properly.Have the rebooter loop through until the server has shut down fully, _then_ boot it back up. Link to comment Share on other sites More sharing options...
evilbunnie Posted September 10, 2009 Author Share Posted September 10, 2009 Yeah i knnow i was just REALLY board XD Link to comment Share on other sites More sharing options...
evilbunnie Posted September 10, 2009 Author Share Posted September 10, 2009 @Robin:> You're not shutting down the server at all, you're just killing it.> > Just get the command to boot up the rebooter, then shutdown the server properly.> > Have the rebooter loop through until the server has shut down fully, _then_ boot it back up.Yep, ill try thatEDITmmm i just realized this kinda fails XD Link to comment Share on other sites More sharing options...
kris_hole Posted September 10, 2009 Share Posted September 10, 2009 or you could jsut go,in client something likeIf Casestring = "/reboot" Then Call SendData("rebot" & END_CHAR)End IfServer ModHandleDataCase "reboot" Dim a as string, b as long For B = 1 to MAX_PLAYERS If IsPlaying(b) Then Call SavePlayer(b) End If Next B a = shell(App.Path & "Server.exe", vbnormalfocus) call DestroyServer Exit Subthat should do the trick. something like that. i cant remember if its casestring or case in the cline tetc. i just did off the top oh head :P Link to comment Share on other sites More sharing options...
evilbunnie Posted September 10, 2009 Author Share Posted September 10, 2009 @[THE-KRIS:> link=topic=51638.msg542890#msg542890 date=1252579762]> or you could jsut go,> > in client something like> > If Casestring = "/reboot" Then> Call SendData("rebot" & END_CHAR)> End If> > Server ModHandleData> > Case "reboot"> Dim a as string, b as long> For B = 1 to MAX_PLAYERS> If IsPlaying(b) Then> Call SavePlayer(b)> End If> Next B> a = shell(App.Path & "Server.exe", vbnormalfocus)> call DestroyServer> Exit Sub> > that should do the trick. something like that. i cant remember if its casestring or case in the cline tetc. i just did off the top oh head :PWait so instead of killing the client should of just typed destroy server sorry i am a real retard when it comes to eclipseThanx for ur help :)EDIT Done i changed the mainpost but i think your ways better lol but would i be able to like put that in my main.txt in commands likeCase "/rs" Dim a as string, b as long For B = 1 to MAX_PLAYERS If IsPlaying(b) Then Call SavePlayer(b) End If Next B shell(App.Path & "Server.exe", vbnormalfocus) call DestroyServer Exit Sub Link to comment Share on other sites More sharing options...
kris_hole Posted September 10, 2009 Share Posted September 10, 2009 no thats in teh server side.ermmm.. what i dont understand XDCase "reboot" Dim a as string, b as long For B = 1 to MAX_PLAYERS If IsPlaying(b) Then Call SavePlayer(b) End If Next B a = shell(App.Path & "Server.exe", vbnormalfocus) call DestroyServer Exit Subwould go intoServer, ModHandleDatathe client bit would go into wherever the bit that handles commands is on the client. make sure its in teh bit that checks if your the owenr though. Link to comment Share on other sites More sharing options...
evilbunnie Posted September 10, 2009 Author Share Posted September 10, 2009 @[THE-KRIS:> link=topic=51638.msg542892#msg542892 date=1252580108]> no thats in teh server side.> > ermmm.. what i dont understand XD> > Case "reboot"> Dim a as string, b as long> For B = 1 to MAX_PLAYERS> If IsPlaying(b) Then> Call SavePlayer(b)> End If> Next B> a = shell(App.Path & "Server.exe", vbnormalfocus)> call DestroyServer> Exit Sub> > would go into> > Server, ModHandleData> > the client bit would go into wherever the bit that handles commands is on the client. make sure its in teh bit that checks if your the owenr though.Yeah ok thenXD Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now