Advertisement
Guest User

Untitled

a guest
May 7th, 2011
1,184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.38 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define console 1000
  4. #define dialog_kick 1001
  5. #define dialog_ban 1002
  6. #define dialog_say 1003
  7. #define dialog_announce 1004
  8. #define dialog_kill 1005
  9. #define COLOR_RED 0xAA3333AA
  10. #define COLOR_WHITE 0xFFFFFFAA
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     print("\n--------------------------------------");
  15.     print(" RCON Console");
  16.     print("--------------------------------------\n");
  17.     return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22.     return 1;
  23. }
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27.     if (strcmp("/console", cmdtext, true, 10) == 0)
  28.     {
  29.         if(IsPlayerAdmin(playerid))
  30.         {
  31.             ShowPlayerDialog(playerid,console,DIALOG_STYLE_LIST,"{FF0000}RCON Console","Re-Start Server\nKick\nShut Down Server\nBan\nSay\nAnnounce\nKill Player","Select", "Cancel");
  32.         }
  33.         else
  34.         {
  35.             SendClientMessage(playerid, COLOR_WHITE, "This is an RCON Admin Command:{FF0000} ACCESS DENIED");
  36.         }
  37.         return 1;
  38.     }
  39.     return 0;
  40. }
  41.  
  42. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  43. {
  44.     if(!response) return 1;
  45.     if(dialogid == console)
  46.     {
  47.         if(listitem == 0)
  48.         {
  49.             SendRconCommand("gmx");
  50.             SendClientMessageToAll(COLOR_RED, "Server Is Re-Starting, Please Wait.........");
  51.         }
  52.         if(listitem == 1)
  53.         {
  54.             ShowPlayerDialog(playerid, dialog_kick,DIALOG_STYLE_INPUT,"Kick","Enter the ID of the person you want to kick.","Kick","Cancel");
  55.         }
  56.         if(listitem == 2)
  57.         {
  58.             SendRconCommand("exit");
  59.             SendClientMessageToAll(COLOR_RED, "Server Was Shut Down Via The RCON-Console.");
  60.         }
  61.         if(listitem == 3)
  62.         {
  63.             ShowPlayerDialog(playerid, dialog_ban,DIALOG_STYLE_INPUT,"{FF0000}Ban","Enter the ID of the person you want to ban.","Ban","Cancel");
  64.         }
  65.         if(listitem == 4)
  66.         {
  67.             ShowPlayerDialog(playerid, dialog_say,DIALOG_STYLE_INPUT,"{FF0000}Say","Enter the text you want other players\nto see in their chat-box.","Say","Cancel");
  68.         }
  69.         if(listitem == 5)
  70.         {
  71.             ShowPlayerDialog(playerid, dialog_announce,DIALOG_STYLE_INPUT,"{FF0000}Announce","Enter the text you want other players\nto see on their screen.","Announce","Cancel");
  72.         }
  73.         if(listitem == 6)
  74.         {
  75.             ShowPlayerDialog(playerid, dialog_kill,DIALOG_STYLE_INPUT,"{FF0000}Kill Player","Enter the ID of the person you want to kill.","Kill Player","Cancel");
  76.         }
  77.     }
  78.     if(dialogid == dialog_kick)
  79.     {
  80.         new
  81.         iReturn = strval(inputtext);
  82.         if(!response) return 1;
  83.         if(IsPlayerConnected(iReturn))
  84.         {
  85.             SendClientMessage(iReturn, COLOR_RED, "Kicked by admin on RCON Console");
  86.             Kick(iReturn);
  87.         }
  88.     }
  89.     if(dialogid == dialog_ban)
  90.     {
  91.         new
  92.         iReturn1 = strval(inputtext);
  93.         if(!response) return 1;
  94.         if(IsPlayerConnected(iReturn1))
  95.         {
  96.             SendClientMessage(iReturn1, COLOR_RED, "Banned by admin on RCON Console");
  97.             Ban(iReturn1);
  98.         }
  99.     }
  100.     if(dialogid == dialog_say)
  101.     {
  102.         if(!response) return 1;
  103.         else
  104.         {
  105.         SendClientMessageToAll(COLOR_WHITE, inputtext);
  106.         }
  107.     }
  108.     if(dialogid == dialog_announce)
  109.     {
  110.         if(!response) return 1;
  111.         else
  112.         {
  113.         GameTextForAll(inputtext, 5000, 3 );
  114.         }
  115.     }
  116.     if(dialogid == dialog_kill)
  117.     {
  118.         new
  119.         iReturn5 = strval(inputtext);
  120.         if(!response) return 1;
  121.         if(IsPlayerConnected(iReturn5))
  122.         {
  123.             SendClientMessage(iReturn5, COLOR_RED, "Killed by admin on RCON Console");
  124.             SetPlayerHealth(iReturn5, 0.0);
  125.         }
  126.     }
  127.     return 1;
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement