Jump to content
  • 0

Problema /serverrestart


AndreiM

Question

Salut ! Cand folosesc comanda /serverrestart imi apare timpul cum scade si cand ajunge la 0 secunde ramane asa .

Am incercat sa bag alta comanda ( dar cand intru pe server si o folosesc mi se inchide server-ul)

Daca ma poate ajuta si pe mine cineva, va rog.

 https://imgur.com/a/pE0316P

 

Comanda

CMD:serverrestart(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login pin.");
    if(IsPlayerConnected(playerid))
     {
        if (PlayerInfo[playerid][pAdmin] >= 6)
        {
              SCM(playerid, COLOR_WHITE, "Ai pornit numaratoarea inversa pentru restartarea serverului");
            OOCOff(COLOR_GENANNOUNCE,"A fost pornita numaratoarea inversa pentru restartarea serverului");
            serverrestart2 = 30;
        }
        else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
    }
    return 1;
}

 

Edited by AndreiM
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
2 hours ago, AndreiM said:

Salut ! Cand folosesc comanda /serverrestart imi apare timpul cum scade si cand ajunge la 0 secunde ramane asa .

Am incercat sa bag alta comanda ( dar cand intru pe server si o folosesc mi se inchide server-ul)

Daca ma poate ajuta si pe mine cineva, va rog.

 https://imgur.com/a/pE0316P

 

Comanda

CMD:serverrestart(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login pin.");
    if(IsPlayerConnected(playerid))
     {
        if (PlayerInfo[playerid][pAdmin] >= 6)
        {
              SCM(playerid, COLOR_WHITE, "Ai pornit numaratoarea inversa pentru restartarea serverului");
            OOCOff(COLOR_GENANNOUNCE,"A fost pornita numaratoarea inversa pentru restartarea serverului");
            serverrestart2 = 30;
        }
        else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
    }
    return 1;
}

 

Foloseste comanda urmatoare pe care ti-o dau eu, e pe dialog si te va ajuta decat comanda aia, la comanda pe care o ai tu da doar un mesaj global care se scurge de la 30 de secunde la 0 iar tu trebuie sa dai restart la server din GPC.

 

Minitutorial

Defineste comanda 

#define DIALOG_RESTARTSERVER

Apoi adauga comanda de mai jos in GM

CMD:serverrestart(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
         if(PlayerInfo[playerid][pAdmin] >= 6)
        {
            ShowPlayerDialog(playerid, DIALOG_RESTARTSERVER, DIALOG_STYLE_MSGBOX, "Server Restart", "Please confirm whether you are positive that you wish to initiate a server restart?", "Yes", "No");
        }
        else
        {
            SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
        }
    }
    return 1;
}

Dupa ce ti-ai adaugat comanda mergi la  public OnDialogResponse

si adaugi asta 

if(dialogid == DIALOG_RESTARTSERVER)
	{
		if(response)
		{
		    SendClientMessageToAll(COLOR_YELLOW, "---- SERVER RESTART ----");
			SendClientMessageToAll(COLOR_RED, "The server will be restarted in 30 seconds.");
		    foreach(Player, x)
			{
				OnPlayerDateUpdateX2(x);
				Update(x, pPayDayx);
				Update(x, pPayCheckx);
				Update(x, pFpunishx);
				Update(x, pConnectTimex);
				Update(x, pLawyerx);
				Update(x, pBank);
				Update(x, pCashx);
				Update(x, pRP);
				Update(x, pJailTimex);
				Update(x, pLevelx);
			}
			iGMXTick = 30;
			iGMXTimer = SetTimer("restartTimer", 3000, true);
		}
		else if(!response)
		{
		    SendClientMessage(playerid, COLOR_GREY, "Restart attempt canned.");
		}
		return 1;
	}

 

Sper ca te-am ajutat in mare parte!

  • Thanks 1

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.gif

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.