SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/11/2017, 07:46 PM   #1
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 275
Reputation: 24
Default Prevent server CTRL+C closing.

Hi,
Is there a way to block the console from closing when doing CTRL+C.
I know its possible in most language like NodeJS etc..
Thank you,
rt-2
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 23/11/2017, 08:29 PM   #2
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 275
Reputation: 24
Default Re: Prevent server CTRL+C closing.

Quote:
Originally Posted by GangstaSunny. View Post
CTRL+C in linux is used to kill a process buddy...
if you start the server go for CTRL+A & CTRL+D
I'm not sure that's not true, I think CTRL+z 'kills' the process and CTRL+C 'ends' it..
Normally the program can execute stuff before shutting down, or just decide not to shut down.
Plus I am on Windows.
Thank you for your reply,
rt-2
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 23/11/2017, 10:13 PM   #3
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 5,008
Reputation: 378
Default Re: Prevent server CTRL+C closing.

Why are you pressing ctrl-c then?

There's no preventing it.
Sew_Sumi is offline   Reply With Quote
Old 23/11/2017, 10:50 PM   #4
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 275
Reputation: 24
Default Re: Prevent server CTRL+C closing.

Quote:
Originally Posted by Sew_Sumi View Post
Why are you pressing ctrl-c then?

There's no preventing it.
Because when you click X it doesn't execute OnServerExit,
When you do CTRL+C it does,,,
Maybe there is something I can put in OnServerExit to stop the termination.
Thank you,
rt-2
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 24/11/2017, 12:24 AM   #5
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 5,008
Reputation: 378
Default Re: Prevent server CTRL+C closing.

Quote:
Originally Posted by rt-2 View Post
Because when you click X it doesn't execute OnServerExit,
When you do CTRL+C it does,,,
Maybe there is something I can put in OnServerExit to stop the termination.
Thank you,
rt-2
There isn't as Ctrl-C is a stop process key combo. It's nothing to do with the server executable, hence why when you use a command in command prompt, and have the command 'hang', you press ctrl-c, and you are able to stop it.





Now really, why on earth are you even pressing ctrl-c in the first instance...
__________________
** Drops mic **

Quote:
Originally Posted by NoOneInParticular
Thanks, I make a living as a programmer, so I'm fairly certain I know how scripting works. And thanks for the suggestion but it is not going to work, no matter how big a story you post.
Sew_Sumi is offline   Reply With Quote
Old 24/11/2017, 12:47 AM   #6
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 275
Reputation: 24
Default Re: Prevent server CTRL+C closing.

Quote:
Originally Posted by Sew_Sumi View Post
There isn't as Ctrl-C is a stop process key combo. It's nothing to do with the server executable, hence why when you use a command in command prompt, and have the command 'hang', you press ctrl-c, and you are able to stop it.





Now really, why on earth are you even pressing ctrl-c in the first instance...
AGAIN, because pressing CTRL+C is how you CCCClose a console application,,, thats how you do it,, if I use the X button (or CTRL+Z on linux), it just kills the server,, when you do CTRL+C the server actually executes the "serverExit" and "filterscriptExit" events and THEN closes....

rt-2
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 24/11/2017, 04:09 AM   #7
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 5,008
Reputation: 378
Default Re: Prevent server CTRL+C closing.

What are you not getting here?
Sew_Sumi is offline   Reply With Quote
Old 24/11/2017, 07:35 AM   #8
billy1337samp
Banned
 
Join Date: Jun 2016
Posts: 53
Reputation: 9
Default Re: Prevent server CTRL+C closing.

what is this guy on..
billy1337samp is offline   Reply With Quote
Old 24/11/2017, 10:00 AM   #9
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 275
Reputation: 24
Default Re: Prevent server CTRL+C closing.

That's actually basic computer, back in the 80's that's what you'd use,, if you guys can't understand CTRL+C to Close an application than you don't understand BASIC computing (no pun intended xD).
rt-2
__________________
rt-2
My hardcore first person 1994 simulation in development:
SA Advance Roleplay
rt-2 is offline   Reply With Quote
Old 24/11/2017, 12:31 PM   #10
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Posts: 5,008
Reputation: 378
Default Re: Prevent server CTRL+C closing.

Quote:
Originally Posted by rt-2 View Post
That's actually basic computer, back in the 80's that's what you'd use,, if you guys can't understand CTRL+C to Close an application than you don't understand BASIC computing (no pun intended xD).
rt-2
Then there is no preventing it...
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ctrl+A Ctrl+D , ? Johhnyllll Русский/Russian 8 02/07/2016 12:43 PM
Server Closing FaZeRs Scripting Help 3 02/04/2014 04:38 PM
Server closing renerk10 Server Support 1 06/04/2013 03:53 AM
How to prevent server loops? Tomboeg Server Support 7 13/03/2013 10:39 PM
Server.exe closing NiZor Server Support 6 10/10/2010 07:45 AM


All times are GMT. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.