Advertisement
Guest User

Easy Rcon Admin V 2.0

a guest
Mar 1st, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.56 KB | None | 0 0
  1. //Includes
  2. #include <a_samp>
  3. // Defines
  4. #define MSG DIALOG_STYLE_MSGBOX
  5. #define INPUT DIALOG_STYLE_INPUT
  6. #define LIST DIALOG_STYLE_LIST
  7. // Colors
  8. #define ROT 0xFF0000FF
  9. // Dialogs
  10. #define DIALOG_1 955
  11. #define DIALOG_2 966
  12. #define DIALOG_CP 977
  13.  
  14. // news
  15. new string[126];
  16. new CountdownT;
  17. // Forward
  18. forward Countdown();
  19.  
  20. /* ---DAS SCRIPT BEGINNT------ */
  21. public OnFilterScriptInit()
  22. {
  23.     print("\n--------------------------------------");
  24.     print(" Easy Rcon Admin Include by G-Mac_x3");
  25.     print("--------------------------------------\n");
  26.     return 0;
  27. }
  28.  
  29. public OnFilterScriptExit()
  30. {
  31.     return 0;
  32. }
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35.     if(strcmp("/rcon menu", cmdtext, true) == 0)
  36.     {
  37.         if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,ROT,"Du bist nicht als Rcon Admin eingeloggt!");
  38.         {
  39.             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 \n Rcon Hostnamechange \n Rcon Gamemodetextchange \n Rcon Mapnamechange \n Rcon weburlchange \n Rcon changemode","Schließen","Schließen");
  40.             return 0;
  41.         }
  42.     }
  43.     if(strcmp("/copyright", cmdtext, true) == 0)
  44.     {
  45.         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"," "," ");
  46.     }
  47.     return 0;
  48. }
  49.  
  50. public OnRconCommand(cmd[])
  51. {
  52.     return 0;
  53. }
  54. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  55. {
  56.     switch(dialogid)
  57.     {
  58.         case 955:
  59.         {
  60.             switch(listitem)
  61.             {
  62.                 case 1:
  63.                 {
  64.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Kick","Gebe hier die ID des Users ein den du Kicken willst","Schließen","OK");
  65.                     format(string,sizeof(string), "kick %d",inputtext);
  66.                     SetPVarInt(playerid,"RconLog",1);
  67.                     log(playerid);
  68.                     SendRconCommand(string);
  69.                 }
  70.                 case 2:
  71.                 {
  72.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Ban","Gebe hier die ID des Users ein den du Bannen willst","Schließen","OK");
  73.                     format(string,sizeof(string), "ban %d",inputtext);
  74.                     SendRconCommand(string);
  75.                     SetPVarInt(playerid,"RconLog",2);
  76.                     log(playerid);
  77.                 }
  78.                 case 3:
  79.                 {
  80.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Load Filterscript","Gebe hier den Name des Filterscripts ein, das du laden willst","Schließen","OK");
  81.                     format(string,sizeof(string), "loadfs %d",inputtext);
  82.                     SendRconCommand(string);
  83.                     SetPVarInt(playerid,"RconLog",3);
  84.                     log(playerid);
  85.                 }
  86.                 case 4:
  87.                 {
  88.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon UnLoad Filterscript","Gebe hier den Name des Filterscripts ein, das du unloaden willst","Schließen","OK");
  89.                     format(string,sizeof(string), "unloadfs %d",inputtext);
  90.                     SendRconCommand(string);
  91.                     SetPVarInt(playerid,"RconLog",4);
  92.                     log(playerid);
  93.                 }
  94.                 case 5:
  95.                 {
  96.                     CountdownT = SetTimerEx("Countdown", 1000, 1, "i", 20);
  97.                     SetPVarInt(playerid,"RconLog",5);
  98.                     log(playerid);
  99.                 }
  100.                 case 6:
  101.                 {
  102.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Say","Schreibe hier rein, was du sagen willst","Schließen","OK");
  103.                     format(string,sizeof(string), "say %s",inputtext);
  104.                     SendRconCommand(string);
  105.                     SetPVarInt(playerid,"RconLog",6);
  106.                     log(playerid);
  107.                 }
  108.                 case 7:
  109.                 {
  110.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Hostname","Schreibe hier rein in welchen Namen du den Hostnamen ändern willst.","Schließen","OK");
  111.                     format(string,sizeof(string), "hostname %s",inputtext);
  112.                     SendRconCommand(string);
  113.                     SetPVarInt(playerid,"RconLog",7);
  114.                     log(playerid);
  115.                 }
  116.                 case 8:
  117.                 {
  118.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Gamemodetext","Schreibe hier rein in welchen Namen du den Gamemodetext ändern willst.","Schließen","OK");
  119.                     format(string,sizeof(string), "gamemodetext %s",inputtext);
  120.                     SendRconCommand(string);
  121.                     SetPVarInt(playerid,"RconLog",8);
  122.                     log(playerid);
  123.                 }
  124.                 case 9:
  125.                 {
  126.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Mapname","Schreibe hier rein in welchen Namen du den Mapnamen ändern willst.","Schließen","OK");
  127.                     format(string,sizeof(string), "mapname %s",inputtext);
  128.                     SendRconCommand(string);
  129.                     SetPVarInt(playerid,"RconLog",9);
  130.                     log(playerid);
  131.                 }
  132.                 case 10:
  133.                 {
  134.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Weburl","Schreibe hier die URL deines Forums/deiner Homepage rein.","Schließen","OK");
  135.                     format(string,sizeof(string), "weburl %s",inputtext);
  136.                     SendRconCommand(string);
  137.                     SetPVarInt(playerid,"RconLog",10);
  138.                     log(playerid);
  139.                 }
  140.                 case 11:
  141.                 {
  142.                     ShowPlayerDialog(playerid,DIALOG_2,INPUT,"Rcon Changegamemode","Schreibe hier den Names des neuen Gamemodes rein.","Schließen","OK");
  143.                     format(string,sizeof(string), "changemode %s",inputtext);
  144.                     SendRconCommand(string);
  145.                     SetPVarInt(playerid,"RconLog",11);
  146.                     log(playerid);
  147.                 }
  148.             }
  149.         }
  150.     }
  151.     return 0;
  152. }
  153.            
  154.  
  155.  
  156.  
  157. new CountSek = -1;
  158.  
  159. public Countdown()
  160. {
  161.     if(CountSek == -1)
  162.     {
  163.         return 1;
  164.     }
  165.     if(CountSek == 0)
  166.     {
  167.         GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~~h~GMX NOW", 3000, 3);
  168.         KillTimer(CountdownT);
  169.         CountSek = -1;
  170.         SendRconCommand("GMX");
  171.     }
  172.     else
  173.     {
  174.         new cstr[50];
  175.         format(cstr, sizeof(cstr),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%i", CountSek);
  176.         GameTextForAll(cstr, 2000, 3);
  177.         CountSek--;
  178.     }
  179.     return 0;
  180. }
  181.  
  182.    
  183. forward log(playerid);
  184. public log(playerid)
  185. {
  186.     new befehl[126];
  187.     switch(GetPVarInt(playerid,"RconLog"))
  188.     {
  189.         case 1:{befehl="Rcon Kick";}
  190.         case 2:{befehl="Rcon Ban";}
  191.         case 3:{befehl="Rcon Load Filterscript";}
  192.         case 4:{befehl="Rcon UnLoad Filterscript";}
  193.         case 5:{befehl="Rcon GMX";}
  194.         case 6:{befehl="Rcon Say";}
  195.         case 7:{befehl="Rcon Hostname";}
  196.         case 8:{befehl="Rcon Gamemodetext";}
  197.         case 9:{befehl="Rcon Mapname";}
  198.         case 10:{befehl="Rcon Weburl";}
  199.         case 11:{befehl="Rcon Changegamemode";}
  200.     }
  201.     new entry[256];
  202.     GetPlayerName(playerid,string,sizeof(string));
  203.     format(entry, sizeof(entry), " Person: %s Befehl: %s \r\n",string,befehl);
  204.     new File:hFile;
  205.     hFile = fopen("rconlog.log", io_append);
  206.     fwrite(hFile, entry);
  207.     fclose(hFile);
  208. }
  209. /* ---DAS SCRIPT ENDET------ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement