Advertisement
Guest User

rA-105192-s maintenance

a guest
Apr 11th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. - script Server_Maintenance -1,{
  2. OnTalk:
  3. /***********************************/
  4. /**/.npc$ = "[Server Maintenance]";
  5. /**/.gm = 99; //Level GM
  6. /**/.user$ = "root"; //root
  7. /**/.password = 12345; //Password
  8. /**********************************/
  9.  
  10. mes .npc$;
  11. if ( getgmlevel() < .gm ) {
  12. mes "Sorry but you don't have a permission";
  13. close;
  14. }
  15. mes "Hello "+ strcharinfo(0) +".";
  16. mes "Please enter the username:";
  17. next;
  18. input .@usr$;
  19. mes .npc$;
  20. mes "Please enter password";
  21. next;
  22. input .@psw;
  23. mes .npc$;
  24. if ( .@usr$ != .user$ || .@psw != .password ) {
  25. mes "There was a problem with your login information!";
  26. close;
  27. }
  28. mes "Current state of the server : "+( ($server_maintenance)? "^00FFFFON": "^FF0000OFF" )+"^000000.";
  29. mes "Do you want to activate the server in maintenance mode?";
  30. next;
  31. if ( select( "Turn On", "Turn Off" ) == 1 ) {
  32. mes .npc$;
  33. if ( $server_maintenance == true ) {
  34. mes "The server is already turn on maintenance mode";
  35. close;
  36. }
  37. mes "Server in maintenance mode ^00ff7fenabled^000000";
  38. donpcevent "#maintenance::OnStartMaintenance";
  39. close;
  40. } else {
  41. mes .npc$;
  42. if ( $server_maintenance == false ) {
  43. mes "The server is already turn off maintenance mode";
  44. close;
  45. }
  46. mes "Server in maintenance mode ^00ff7fdisabled^000000";
  47. $server_maintenance = false;
  48. close;
  49. }
  50. end;
  51. }
  52. prontera,150,185,5 duplicate(Server_Maintenance) Server Maintenance 73
  53.  
  54. - script #maintenance -1,{
  55. OnInit:
  56. bindatcmd "maintenance", "Server_Maintenance::OnTalk";
  57. end;
  58. OnStartMaintenance:
  59. .@one_sec = 1000; // just to debug this script
  60. announce "The server will be temporarily closed for maintenance -- from 5 minutes", bc_all;
  61. sleep 60 * .@one_sec;
  62. announce "The server will be temporarily closed for maintenance -- from 4 minutes", bc_all;
  63. sleep 60 * .@one_sec;
  64. announce "The server will be temporarily closed for maintenance -- from 3 minutes", bc_all;
  65. sleep 60 * .@one_sec;
  66. announce "The server will be temporarily closed for maintenance -- from 2 minutes", bc_all;
  67. sleep 60 * .@one_sec;
  68. announce "The server will be temporarily closed for maintenance -- from 1 minutes", bc_all;
  69. sleep 30 * .@one_sec;
  70. announce "-- Server Shutdown in 30 seconds --", bc_all;
  71. sleep 10 * .@one_sec;
  72. announce "-- Server Shutdown in 20 seconds --", bc_all;
  73. sleep 10 * .@one_sec;
  74. announce "-- Server Shutdown in 10 seconds --", bc_all;
  75. sleep 5 * .@one_sec;
  76. announce "-- We will be back soon. Bye bye --", bc_all;
  77. $server_maintenance = true;
  78. addrid 0;
  79. if ( getgmlevel() >= 99 ) end; // com'on ... wtf you kick another admin ?
  80. if ( checkvending() & 2 ) end; // shouldn't kick @autotraders too ... hercules members complained in my topic
  81. atcommand "@kick "+ strcharinfo(0);
  82. end;
  83. OnPCLoginEvent:
  84. if ( $server_maintenance == false )
  85. end;
  86. if ( getgmlevel() >= 99 ) {
  87. message strcharinfo(0), "The server is currently in maintenance mode";
  88. end;
  89. }
  90. mes "[^55aaffXXXRO Server^000000]";
  91. mes "Sorry but the server is temporarily out of service,";
  92. mes "for maintenance.";
  93. mes "Please try again later!";
  94. sleep2 5000;
  95. atcommand "@kick "+ strcharinfo(0);
  96. end;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement