Server restart
#1

pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp("gmx", cmd))
    {
        for(new i; i < GetMaxPlayers(); i++)
        {
            OnPlayerDisconnect(i, ServerRestart);
        }
        SendRconCommand("gmx");
        return 1;
    }
    return 1;
}
pawn Код:
C:\Users\Aрalsteinn\Desktop\gmx.pwn(144) : error 017: undefined symbol "ServerRestart"
How can I make this work correctly? And maybe let it show a message on center of screen: SERVER RESTART or something?
Reply
#2

very simple go to your server type /rcon login [password] then type /rcon gmx and you're done
Reply
#3

Ahh nice Its already there

But can I make a FS that makes a text appear when i do it in the middle of the screen saying SERVER RESTART?
Reply
#4

Make a /gmx command in your script which is performing it before GMX'ing
Reply
#5

When you type /rcon gmx, a client message is being send to all clients, which says "The server is restarting".
Everything is already there
Reply
#6

Yes I noticed

I just wanted something more fancy ;p But it doesnt matter
Reply
#7

Call GameTextForAll, or SendClientMessageToAll in OnGameModeExit().
Reply
#8

Or public any player can use:
for zcmd command.

CMD:gmx(playerid,params[]) {
SendRconCommand("gmx");
SendClientMessage(playerid,COLOUR,"Server Has Been Restart");
GameTextForAll(playerid,"SERVER RESTART",8000,5);
return 1;
}
Reply
#9

pawn Код:
dcmd_goto(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /goto [PlayerID]") &&
        SendClientMessage(playerid, orange, "Function: Will Go to specified player");
        new player1;
        new string[128];
        if(!IsNumeric(params))
        player1 = ReturnPlayerID(params);
        else player1 = strval(params);
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
         {
            SendCommandToAdmins(playerid,"Goto");
            new Float:x, Float:y, Float:z;  GetPlayerPos(player1,x,y,z);
            SetPlayerInterior(playerid,GetPlayerInterior(player1));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
            if(GetPlayerState(playerid) == 2)
            {
            SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            }
            else SetPlayerPos(playerid,x+2,y,z);
            format(string,sizeof(string),"|- You have Teleported to \"%s\" -|", pName(player1));
            return SendClientMessage(playerid,BlueMsg,string);
        }
        else return ErrorMessages(playerid, 4);
    }
    else return ErrorMessages(playerid, 1);
}
I want everyone to be able to use this command. When I remove isplayeradmin line it shows me error. How to change this to make it work?
Reply
#10

Just remove it too
Reply


Forum Jump:


Users browsing this thread: