SA-MP Forums Archive
Server restart - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server restart (/showthread.php?tid=255805)



Server restart- Another question - ColdIce - 17.05.2011

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?


Re: Server restart - Cjgogo - 17.05.2011

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


Re: Server restart - ColdIce - 17.05.2011

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?


Re: Server restart - yanir3 - 17.05.2011

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


Re: Server restart - sim_sima - 17.05.2011

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


Re: Server restart - ColdIce - 17.05.2011

Yes I noticed

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


Re: Server restart - shitbird - 17.05.2011

Call GameTextForAll, or SendClientMessageToAll in OnGameModeExit().


Re: Server restart - Dr.Ghost - 17.05.2011

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;
}


Re: Server restart - ColdIce - 19.05.2011

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?


Re: Server restart - MadeMan - 19.05.2011

Just remove it too