Crashing the server - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Crashing the server (
/showthread.php?tid=380593)
Crashing the server -
Roko_foko - 26.09.2012
1)Is there a way you can quit/crash your server trough script. This may look crazy but I want to make some holes inside of the script to make sure none will use it if it got stolen.
I've tried call OnGameModeExit and nothing happens. Everything is same as it was before.
Re: Crashing the server -
$mooth - 26.09.2012
I've seen someone who asked about a similar thing.
And the only way was to kick not /q(uit) the player.
To crash your server, might be able to do. But then, it can make players go away. Alot of a**holes is out there.
I would suggest to make some auto kick/ban insted if a user access the db/files
(Im not sure)
Re: Crashing the server -
Unknownich - 26.09.2012
You can stop the server by sending rcon command exit ( SendRconCommand("exit"); )
Re: Crashing the server -
$mooth - 26.09.2012
Quote:
Originally Posted by Unknownich
You can stop the server by sending rcon command exit ( SendRconCommand("exit"); )
|
you can still steal the files without rcon!
SendRconCommand("exit")
Quote:
#include <a_samp>
main()
{
print("\n---------------------------------------");
print(" Crashing the server.");
print("---------------------------------------\n");
}
public OnGameModeInit()
{
// Crashing the server here
new File:crash;
fclose(crash);
return 1;
}
public OnGameModeExit()
{
return 1;
}
|
or
Quote:
#include <a_samp>
main(){}
public OnGameModeInit()
{
SendRconCommand("exit");
return 1;
}
public OnGameModeExit()
{
return 1;
}
or even make a command (ZCMD):
CMD:crashserver(playerid, params[]){
if(IsPlayerAdmin(playerid)){
SendRconCommand("exit");
}
return 1;
}
|
And i guess he wants it to auto detect if someone trys to enter the files. Not that someone needs to enter a CMD, then you could only colse the server as it is.
Re: Crashing the server -
XtremeR - 26.09.2012
pawn Код:
CMD:closeserver(playerid,params[])
{
SendClientMessageToAll(playerid,-1,"Server Is Closed!");
SendRconCommand("exit");
return 1;
}
this command will close the server ..
Re: Crashing the server -
Roko_foko - 26.09.2012
Thank you guys. Rep for all.
Re: Crashing the server -
Roko_foko - 26.09.2012
Quote:
Originally Posted by ******
Err, you realise that after doing that just once, the other scripters will realise and FIX the bug, rendering this approach useless? Plus you will need to join every server using your script repeatedly.
|
Don't worry. I know what am I doing
.