Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define console 1000
- #define dialog_kick 1001
- #define dialog_ban 1002
- #define dialog_say 1003
- #define dialog_announce 1004
- #define dialog_kill 1005
- #define COLOR_RED 0xAA3333AA
- #define COLOR_WHITE 0xFFFFFFAA
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" RCON Console");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/console", cmdtext, true, 10) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowPlayerDialog(playerid,console,DIALOG_STYLE_LIST,"{FF0000}RCON Console","Re-Start Server\nKick\nShut Down Server\nBan\nSay\nAnnounce\nKill Player","Select", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "This is an RCON Admin Command:{FF0000} ACCESS DENIED");
- }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(!response) return 1;
- if(dialogid == console)
- {
- if(listitem == 0)
- {
- SendRconCommand("gmx");
- SendClientMessageToAll(COLOR_RED, "Server Is Re-Starting, Please Wait.........");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, dialog_kick,DIALOG_STYLE_INPUT,"Kick","Enter the ID of the person you want to kick.","Kick","Cancel");
- }
- if(listitem == 2)
- {
- SendRconCommand("exit");
- SendClientMessageToAll(COLOR_RED, "Server Was Shut Down Via The RCON-Console.");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, dialog_ban,DIALOG_STYLE_INPUT,"{FF0000}Ban","Enter the ID of the person you want to ban.","Ban","Cancel");
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, dialog_say,DIALOG_STYLE_INPUT,"{FF0000}Say","Enter the text you want other players\nto see in their chat-box.","Say","Cancel");
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid, dialog_announce,DIALOG_STYLE_INPUT,"{FF0000}Announce","Enter the text you want other players\nto see on their screen.","Announce","Cancel");
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid, dialog_kill,DIALOG_STYLE_INPUT,"{FF0000}Kill Player","Enter the ID of the person you want to kill.","Kill Player","Cancel");
- }
- }
- if(dialogid == dialog_kick)
- {
- new
- iReturn = strval(inputtext);
- if(!response) return 1;
- if(IsPlayerConnected(iReturn))
- {
- SendClientMessage(iReturn, COLOR_RED, "Kicked by admin on RCON Console");
- Kick(iReturn);
- }
- }
- if(dialogid == dialog_ban)
- {
- new
- iReturn1 = strval(inputtext);
- if(!response) return 1;
- if(IsPlayerConnected(iReturn1))
- {
- SendClientMessage(iReturn1, COLOR_RED, "Banned by admin on RCON Console");
- Ban(iReturn1);
- }
- }
- if(dialogid == dialog_say)
- {
- if(!response) return 1;
- else
- {
- SendClientMessageToAll(COLOR_WHITE, inputtext);
- }
- }
- if(dialogid == dialog_announce)
- {
- if(!response) return 1;
- else
- {
- GameTextForAll(inputtext, 5000, 3 );
- }
- }
- if(dialogid == dialog_kill)
- {
- new
- iReturn5 = strval(inputtext);
- if(!response) return 1;
- if(IsPlayerConnected(iReturn5))
- {
- SendClientMessage(iReturn5, COLOR_RED, "Killed by admin on RCON Console");
- SetPlayerHealth(iReturn5, 0.0);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement