Need Help By Restarting Server
#1

Hi I Have question ..

is this possible to restart server with command like /restart

if it is please reply
Reply
#2

https://sampwiki.blast.hk/wiki/RCON

/rcon gmx
Reply
#3

You might wana use the following
Код:
if((!strcmp(cmdtext,"/restart",true,8) && IsPlayerAdmin(playerid))
{
GameTextForAll("~g~Server Restarting!", 2000, 5);
SendRconCommand("gmx");
return 1;
}
Reply
#4

Quote:
Originally Posted by DJDhan
You might wana use the following
Код:
if(!strcmp(cmdtext,"/restart",true,8)
{
GameTextForAll("~g~Server Restarting!", 2000, 5);
SendRconCommand("gmx");
return 1;
}
And you should add this command with your adminlevel, or else all can use this command xD
Reply
#5

Код:
if(!strcmp(cmdtext,"/restart",true,8)
{
GameModeExit();
return 1;
}
Reply
#6

... which wouldn't restart the server.
Reply
#7

Quote:
Originally Posted by juice.j
... which wouldn't restart the server.
eH ? it would
Reply
#8

If you use GameModeExit(), you will have to use OnGameModeExit() too.

So, my code is simply better
Reply
#9

GameModeExit as such simply exits the game mode. Using it bare it will not restart your server.
Reply
#10

just /rcon login [password]
/rcon gmx

or using script:
if(!strcmp(cmdtext,"/restart",true,
{
if (!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You are not Administrator.");
return 1;
}
SendRconCommand("gmx");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)