Advertisement
Guest User

Easy Rcon Admin V 1.0

a guest
Mar 1st, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.54 KB | None | 0 0
  1.  
  2. //Includes
  3. #include <a_samp>
  4. // Defines
  5. #define MSG DIALOG_STYLE_MSGBOX
  6. #define INPUT DIALOG_STYLE_INPUT
  7. #define LIST DIALOG_STYLE_LIST
  8. // Colors
  9. #define ROT 0xFF0000FF
  10. // Dialogs
  11. #define DIALOG_1 955
  12. #define DIALOG_2 966
  13. #define DIALOG_CP 977
  14.  
  15. // news
  16. new string[126];
  17. new CountdownT;
  18. // Forward
  19. forward Countdown();
  20.  
  21. /* ---DAS SCRIPT BEGINNT------ */
  22. public OnFilterScriptInit()
  23. {
  24.     print("\n--------------------------------------");
  25.     print(" Easy Rcon Admin Include by G-Mac_x3");
  26.     print("--------------------------------------\n");
  27.     return 0;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     return 0;
  33. }
  34. public OnPlayerCommandText(playerid, cmdtext[])
  35. {
  36.     if(strcmp("/rcon menu", cmdtext, true) == 0)
  37.     {
  38.         if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,ROT,"Du bist nicht als Rcon Admin eingeloggt!");
  39.         {
  40.             ShowPlayerDialog(playerid,DIALOG_1,LIST,"Rcon Admin Menu","\n Rcon Kick \n Rcon Ban \n Rcon Filterscript laden \n Rcon Filterscript unladen \n Rcon GMX \n Rcon Say","Schließen","Schließen");
  41.             return 0;
  42.         }
  43.     }
  44.     if(strcmp("/copyright", cmdtext, true) == 0)
  45.     {
  46.         ShowPlayerDialog(playerid,DIALOG_CP,MSG,"Easy Rcon Admin Copyright / Version","Copyright bei G-Mac_x3 \n Version 0.1 \n Lizenz Bestimmungen: \n Du Darfst das Script verwenden, Nutze und verändern. Du darf NICHT das Script als deins Augeben"," "," ");
  47.     }
  48.     return 0;
  49. }
  50.  
  51. public OnRconCommand(cmd[])
  52. {
  53.     return 0;
  54. }
  55. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  56. {
  57.     switch(dialogid)
  58.     {
  59.         case 955:
  60.         {
  61.             switch(listitem)
  62.             {
  63.                 case 1:
  64.                 {
  65.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Kick","Gebe hier die ID des Users ein den du Kicken willst","Schließen","OK");
  66.                     format(string,sizeof(string), "kick %d",inputtext);
  67.                     SendRconCommand(string);
  68.                 }
  69.                 case 2:
  70.                 {
  71.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Ban","Gebe hier die ID des Users ein den du Bannen willst","Schließen","OK");
  72.                     format(string,sizeof(string), "ban %d",inputtext);
  73.                     SendRconCommand(string);
  74.                 }
  75.                 case 3:
  76.                 {
  77.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Load Filterscript","Gebe hier den Name des Filterscripts ein, das du laden willst","Schließen","OK");
  78.                     format(string,sizeof(string), "loadfs %d",inputtext);
  79.                     SendRconCommand(string);
  80.                 }
  81.                 case 4:
  82.                 {
  83.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon UnLoad Filterscript","Gebe hier den Name des Filterscripts ein, das du unloaden willst","Schließen","OK");
  84.                     format(string,sizeof(string), "unloadfs %d",inputtext);
  85.                     SendRconCommand(string);
  86.                 }
  87.                 case 5:
  88.                 {
  89.                     CountdownT = SetTimerEx("Countdown", 1000, 1, "i", 20);
  90.                 }
  91.                 case 6:
  92.                 {
  93.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Say","Schreibe hier rein, was du sagen willst","Schließen","OK");
  94.                     format(string,sizeof(string), "say %s",inputtext);
  95.                     SendRconCommand(string);
  96.                 }
  97.             }
  98.         }
  99.     }
  100.     return 0;
  101. }
  102.            
  103.  
  104.  
  105.  
  106. new CountSek = -1;
  107.  
  108. public Countdown()
  109. {
  110.     if(CountSek == -1)
  111.     {
  112.         return 1;
  113.     }
  114.     if(CountSek == 0)
  115.     {
  116.         GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~~h~GMX NOW", 3000, 3);
  117.         KillTimer(CountdownT);
  118.         CountSek = -1;
  119.         SendRconCommand("GMX");
  120.     }
  121.     else
  122.     {
  123.         new cstr[50];
  124.         format(cstr, sizeof(cstr),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%i", CountSek);
  125.         GameTextForAll(cstr, 2000, 3);
  126.         CountSek--;
  127.     }
  128.     return 0;
  129. }
  130. /* ---DAS SCRIPT ENDET------ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement