Guest User

Untitled

a guest
Dec 16th, 2019
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. //==============================================================================
  2. /*
  3. #AdminPanel/System
  4. #Author > eksepted
  5. */
  6. //==============================================================================
  7. #include <a_samp>
  8. #include <YSI\y_ini>
  9. #include <zcmd>
  10. #include <streamer>
  11. #include <sscanf2>
  12. //==============================================================================
  13. #define SCM SendClientMessage
  14. #define DSI DIALOG_STYLE_INPUT
  15. #define SPD ShowPlayerDialog
  16. //==============================================================================
  17. main()
  18. {
  19. print("\n----------------------------------");
  20. print(" ADMIN MENU BY EKSEPTED");
  21. print("----------------------------------\n");
  22. }
  23. enum {
  24. DIALOG_SERVER,
  25. DIALOG_SRWIME,
  26. DIALOG_SRWGM,
  27. DIALOG_SRWPW
  28. }
  29. public OnGameModeInit()
  30. {
  31. SetGameModeText("Blank Script");
  32. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  33. return 1;
  34. }
  35. public OnPlayerRequestClass(playerid, classid)
  36. {
  37. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  38. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  39. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  40. return 1;
  41. }
  42. stock GetName(playerid)
  43. {
  44. new name[MAX_PLAYER_NAME];
  45. GetPlayerName(playerid, name, sizeof(name));
  46. return name;
  47. }
  48. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  49. {
  50. if(dialogid == DIALOG_SERVER)
  51. {
  52. if(!response) return 1;
  53. switch(listitem)
  54. {
  55. case 0:
  56. {
  57. SPD(playerid, DIALOG_SRWIME, DSI, "Ime servera", "U prazno polje, unesite novo ime servera.", "Postavi", "Odustani");
  58. }
  59. case 1:
  60. {
  61. SPD(playerid, DIALOG_SRWGM, DSI, "Ime Gamemoda", "U prazno polje, unesite novo ime gamemoda.", "Postavi", "Odustani");
  62. }
  63. case 2:
  64. {
  65. SPD(playerid, DIALOG_SRWPW, DSI, "Zakljucavanje servera", "U prazno polje, unesite zeljenu lozinku za server.", "Postavi", "Odustani");
  66. }
  67. case 3:
  68. {
  69. new string[128];
  70. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Od sada je server {0CFF00}otkljucan.");
  71. SendClientMessageToAll(-1, string);
  72. SCM(playerid, -1, "{1F85DE}INFO >{FFFFFF} Otkljucao si server.");
  73. SendRconCommand("password 0");
  74. }
  75. case 4:
  76. {
  77. new string[128];
  78. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Pokrenut je restart servera, server ce se restartovati za 15 sec.");
  79. SendClientMessageToAll(-1, string);
  80. SCM(playerid, -1, "{1F85DE}INFO >{FFFFFF} Pokrenuo si restartovanje servera.");
  81. SetTimer("Restart", 15000, false);
  82. }
  83. }
  84. }
  85. if(dialogid == DIALOG_SRWIME)
  86. {
  87. if(response)
  88. {
  89. new string[128];
  90. format(string,sizeof(string),"hostname %s",inputtext);
  91. SendRconCommand(string);
  92. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} %s je postavio novo ime servera na > {1F85DE}%s", GetName(playerid), inputtext);
  93. SendClientMessageToAll(-1, string);
  94. }
  95. }
  96. if(dialogid == DIALOG_SRWGM)
  97. {
  98. if(response)
  99. {
  100. new string[128];
  101. format(string,sizeof(string),"%s",inputtext);
  102. SetGameModeText(string);
  103. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} %s je postavio novo ime gamemoda na > {1F85DE}%s", GetName(playerid), inputtext);
  104. SendClientMessageToAll(-1, string);
  105. }
  106. }
  107. if(dialogid == DIALOG_SRWPW)
  108. {
  109. if(response)
  110. {
  111. new string[128];
  112. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Od sada je server {FF0000}zakljucan.");
  113. SendClientMessageToAll(-1, string);
  114. format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Zakljucao si server, nova lozinka servera je: {1F85DE}%s", inputtext);
  115. SCM(playerid, -1, string);
  116. SendRconCommand("password %s");
  117. }
  118. }
  119. return 1;
  120. }
  121. //==============================================================================
  122. CMD:server(playerid, params[]) {
  123. //if(PI[playerid][pAdmin] < 6)
  124. //return SCM(playerid, -1, "Niste ovlasceni");
  125. new srwmog[1024];
  126. format(srwmog,1024,"[1] > Promeni Ime Servera\n[2] > Promeni Ime GameMode-a\n[3] > Zakljucaj Server\n[4] > Otkljucaj Server\n[5] > Restartuj Server");
  127. ShowPlayerDialog(playerid, DIALOG_SERVER, DIALOG_STYLE_LIST, "Server Mogucnosti:", srwmog, "Odaberi", "Odustani");
  128. return (true);
  129. }
Advertisement
Add Comment
Please, Sign In to add comment