How to close server?
#1

Hey,
I was searching in the forum but didnt know exactly what to look for. I want an in game command that turns off the server similar to /gmx but that the server doesnt turn back on. Its like crashing it. Maybe you know what I mean.
Reply
#2

GameModeExit is the Function your looking for,


Код:
if(!strmcp(cmdtext,"/nameit",true)) {
GameModeExit();
return 0;
}
Reply
#3

Код:
if(strcmp("/closeserver", cmdtext, true, 10) == 0) {
if(IsPlayerAdmin(playerid)) {
SendRconCommand("exit");
return 1;
}
}
that will make when an rcon admin type /closeserver it close the server

Note : tested and its working
________
Fix Ps3
Reply
#4

Quote:
Originally Posted by [AC
Etch ]
Код:
if(strcmp("/closeserver", cmdtext, true, 10) == 0)
/closeserver has 12 characters, not 10.
Reply
#5

that doesnt matter i tryed the command like that and it worked normally
________
SUZUKI ESTEEM
Reply
#6

Because it reads the first 10 characters.
pawn Код:
if(strcmp("/closeserver", cmdtext, true) == 0) // better
Reply
#7

Quote:
Originally Posted by [AC
Etch ]
that doesnt matter i tryed the command like that and it worked normally
Indeed it does, you should read this.
Reply
#8

Wow. I just made something similar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)