Advertisement
Guest User

Rcon Administrator

a guest
Jan 22nd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. //* Evo vam FileScript na Hrvatskom jeziku, komanda da vam dode dialog ovga je /administrator kad se ulogirate kao RCON Admin.HTTP //
  2. #include <a_samp>
  3.  
  4. #define console 1000
  5. #define dialog_kick 1001
  6. #define dialog_ban 1002
  7. #define dialog_say 1003
  8. #define dialog_announce 1004
  9. #define dialog_kill 1005
  10. #define COLOR_RED 0xAA3333AA
  11. #define COLOR_WHITE 0xFFFFFFAA
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" RCON Komande");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. public OnPlayerCommandText(playerid, cmdtext[])
  27. {
  28. if (strcmp("/administrator", cmdtext, true, 10) == 0)
  29. {
  30. if(IsPlayerAdmin(playerid))
  31. {
  32. ShowPlayerDialog(playerid,console,DIALOG_STYLE_LIST,"{FF0000}RCON Komande","Re-Start Server\nKick\nUgasi Server\nBan\nText na Chat-u\nText na ekran-u\nUbi Igraca","Odaberi", "Poništi");
  33. }
  34. else
  35. {
  36. SendClientMessage(playerid, COLOR_WHITE, "Nisi ovlašten.:{FF0000} Nisi ulogiran kao RCON Adminstrator");
  37. }
  38. return 1;
  39. }
  40. return 0;
  41. }
  42.  
  43. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  44. {
  45. if(!response) return 1;
  46. if(dialogid == console)
  47. {
  48. if(listitem == 0)
  49. {
  50. SendRconCommand("gmx");
  51. SendClientMessageToAll(COLOR_RED, "Server se pomovo pokrece, molimo pricekajte..........");
  52. }
  53. if(listitem == 1)
  54. {
  55. ShowPlayerDialog(playerid, dialog_kick,DIALOG_STYLE_INPUT,"Kick","ID Igraca.","Kick","Ponisti");
  56. }
  57. if(listitem == 2)
  58. {
  59. SendRconCommand("exit");
  60. SendClientMessageToAll(COLOR_RED, "Server je ugašen preko RCON Administratora..");
  61. }
  62. if(listitem == 3)
  63. {
  64. ShowPlayerDialog(playerid, dialog_ban,DIALOG_STYLE_INPUT,"{FF0000}Ban","ID Igraca .","Ban","Ponisti");
  65. }
  66. if(listitem == 4)
  67. {
  68. ShowPlayerDialog(playerid, dialog_say,DIALOG_STYLE_INPUT,"{FF0000}Say","Unesi te text koji zelite da ostali igraci vide na svom chat-u","Text na chat-u","Ponisti");
  69. }
  70. if(listitem == 5)
  71. {
  72. ShowPlayerDialog(playerid, dialog_announce,DIALOG_STYLE_INPUT,"{FF0000}Announce","Unesi te text koji zeli te da igraci vide na svom ekranu.","Text na ekranu","Ponisti");
  73. }
  74. if(listitem == 6)
  75. {
  76. ShowPlayerDialog(playerid, dialog_kill,DIALOG_STYLE_INPUT,"{FF0000}Kill Player","ID Igraca kojeg zeli te ubit.","Ubi igraca","Ponisti");
  77. }
  78. }
  79. if(dialogid == dialog_kick)
  80. {
  81. new
  82. iReturn = strval(inputtext);
  83. if(!response) return 1;
  84. if(IsPlayerConnected(iReturn))
  85. {
  86. SendClientMessage(iReturn, COLOR_RED, "Kikan si od strane RCON Administratora");
  87. Kick(iReturn);
  88. }
  89. }
  90. if(dialogid == dialog_ban)
  91. {
  92. new
  93. iReturn1 = strval(inputtext);
  94. if(!response) return 1;
  95. if(IsPlayerConnected(iReturn1))
  96. {
  97. SendClientMessage(iReturn1, COLOR_RED, "Banovan si od strane RCON Administratora");
  98. Ban(iReturn1);
  99. }
  100. }
  101. if(dialogid == dialog_say)
  102. {
  103. if(!response) return 1;
  104. else
  105. {
  106. SendClientMessageToAll(COLOR_WHITE, inputtext);
  107. }
  108. }
  109. if(dialogid == dialog_announce)
  110. {
  111. if(!response) return 1;
  112. else
  113. {
  114. GameTextForAll(inputtext, 5000, 3 );
  115. }
  116. }
  117. if(dialogid == dialog_kill)
  118. {
  119. new
  120. iReturn5 = strval(inputtext);
  121. if(!response) return 1;
  122. if(IsPlayerConnected(iReturn5))
  123. {
  124. SendClientMessage(iReturn5, COLOR_RED, "Ubijen si od strane RCON Administratora");
  125. SetPlayerHealth(iReturn5, 0.0);
  126. }
  127. }
  128. return 1;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement