SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/11/2017, 06:46 PM   #1
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 283
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, 07:29 PM   #2
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 283
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, 09:13 PM   #3
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,186
Reputation: 515
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, 09:50 PM   #4
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 283
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 23/11/2017, 11:24 PM   #5
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,186
Reputation: 515
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...
__________________
Quote:
Originally Posted by Random View Post
this gamemode is so out of date and it isn't even comparable with todays other servers.
just because brain tricks us thinking that old days gamemodes were better then its just wrong, because funcinality was so poor, building new systems was very time consuming, because scripters didn't understand how to make gamemode to parts and simplify their work.
Jesus, that's a load of crap...

Quote:
Originally Posted by Crystallize
quote my big balls then
You must be looking at life through a microscope then, and not a tunnel as I had previously thought...

Quote:
Originally Posted by AnotherRandom
I've seen threads where you make random brainstorms.
Pointing out larger issues with peoples code, and getting information about what is going on that could be causing issues elsewhere, is a sure way of actually getting the right information. Not just fixing the symptom, that will show up later as they try to expand.
Sew_Sumi is offline   Reply With Quote
Old 23/11/2017, 11:47 PM   #6
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 283
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, 03:09 AM   #7
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,186
Reputation: 515
Default Re: Prevent server CTRL+C closing.

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

what is this guy on..
billy1337samp is offline   Reply With Quote
Old 24/11/2017, 09:00 AM   #9
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montral, Qubec, Canada
Posts: 283
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, 11:31 AM   #10
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,186
Reputation: 515
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 11:43 AM
Server Closing FaZeRs Scripting Help 3 02/04/2014 03:38 PM
Server closing renerk10 Server Support 1 06/04/2013 02:53 AM
How to prevent server loops? Tomboeg Server Support 7 13/03/2013 09:39 PM
Server.exe closing NiZor Server Support 6 10/10/2010 06:45 AM


All times are GMT. The time now is 07:18 PM.


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