SA-MP Forums Archive
Little Help - 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)
+--- Thread: Little Help (/showthread.php?tid=285508)



Little Help - SpiderWalk - 24.09.2011

I need help.I made a rcon console.And when i want to server restart.Server wont restart.

This is Code of dialogs
pawn Code:
COMMAND:rconcon(playerid, params[])
{
   if(IsPlayerAdmin(playerid))
   {
      ShowPlayerDialog(playerid,123,DIALOG_STYLE_LIST,"{787878}Rcon {FFB400}Console","{FFB400}Restart Server","Ok","Cancel");
   }
   return 1;
}
This is of Dialog Response
pawn Code:
switch(123)
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                   SendRconCommand("gmx");
                   SendClientMessageToAll(0xFF000000, "Server Is Re-Starting, Please Wait.........");
                }

            }

        }
        // rest of dialogs here!

    }
    return 1;
}



Re: Little Help - [MWR]Blood - 24.09.2011

pawn Code:
switch(dialogid)
    {
        case 123:
        {
            if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
            switch(listitem)
            {
                case 0:
                {
                   SendRconCommand("gmx");
                   SendClientMessageToAll(0xFF000000, "Server Is Re-Starting, Please Wait.........");
                }

            }

        }
        // rest of dialogs here!

    }
    return 1;
}



Re: Little Help - Max_Coldheart - 24.09.2011

pawn Code:
switch(dialogid)
    {
        case 123:
        {
            if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
            switch(listitem)
            {
                case 0:
                {
                   SendRconCommand("gmx");
                   SendClientMessageToAll(0xFF000000, "Server Is Re-Starting, Please Wait.........");
                }

            }

        }
        // rest of dialogs here!

    }
    return 1;
}
EDIT: damn, [MWR]Blood was faster


Re: Little Help - SpiderWalk - 28.09.2011

Thanks all guys