Advertisement
Guest User

aHost

a guest
Dec 1st, 2010
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. /*
  2. ********************************************************************************
  3. AUTOMATIC HOSTNAME CHANGER
  4. Author: Plugy
  5. Made: ---, 2010.
  6. ********************************************************************************
  7. */
  8. #define COLOR_BLUE 0x1229FAFF
  9. #define FILTERSCRIPT
  10. ////////////////////////////////////////////////////////////////////////////////
  11. #include <a_samp>
  12. ////////////////////////////////////////////////////////////////////////////////
  13. new Timer0;
  14. new Timer1;
  15. new Timer2;
  16. ////////////////////////////////////////////////////////////////////////////////
  17. forward autohostname0();
  18. forward autohostname1();
  19. forward autohostname2();
  20. ////////////////////////////////////////////////////////////////////////////////
  21.  
  22. public OnFilterScriptInit()
  23. {
  24. print("\n-----------------------------------");
  25. print("AUTOMATIC HOSTNAME CHANGER ");
  26. print("************************ ");
  27. print("by Plugy aka Plugsttzzx! ");
  28. print("-----------------------------------\n");
  29. return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34. return 1;
  35. }
  36. ////////////////////////////////////////////////////////////////////////////////
  37. //Automaticly Hostname Changer System
  38. public autohostname0()
  39. {
  40. KillTimer(Timer0);
  41. Timer0 = SetTimer("autohostname1",1400,false);
  42. SendRconCommand("hostname NAME 1");//Change "NAME 1" as example your Custom Hostname Text
  43. return 1;
  44. }
  45. public autohostname1()
  46. {
  47. KillTimer(Timer1);
  48. Timer1 = SetTimer("autohostname2",1400,false);
  49. SendRconCommand("hostname NAME 2");//Change "NAME 2" as example your Custom Hostname Text
  50. return 1;
  51. }
  52. public autohostname2()
  53. {
  54. KillTimer(Timer2);
  55. Timer2 = SetTimer("autohostname0",1400,false);
  56. SendRconCommand("hostname NAME 3");//Change "NAME 3" as example your Custom Hostname Text
  57. return 1;
  58. }
  59. ////////////////////////////////////////////////////////////////////////////////
  60. public OnPlayerCommandText(playerid, cmdtext[])
  61. {
  62. //To activate Automaticly Hostname changer of server
  63. if(strcmp(cmdtext, "/autohostname", true) == 0 && IsPlayerAdmin(playerid))
  64. {
  65. Timer0 = SetTimer("autohostname1",1400,false);
  66. KillTimer(Timer1);
  67. KillTimer(Timer2);
  68. SendClientMessage(playerid, COLOR_BLUE, "You activated Auto-Hostname Changer!");
  69. return true;
  70. }
  71. //To de-activate Automaticly Hostname changer of server
  72. if(strcmp(cmdtext, "/unautohostname", true) == 0 && IsPlayerAdmin(playerid))
  73. {
  74. KillTimer(Timer0);
  75. KillTimer(Timer1);
  76. KillTimer(Timer2);
  77. SendClientMessage(playerid, COLOR_BLUE, "You de-activated Auto-Hostname Changer!");
  78. return true;
  79. }
  80. return 0;
  81. }
  82. ////////////////////////////////////////////////////////////////////////////////
  83. /////////////////////////////// CREDITS TO PLUGY ///////////////////////////////
  84. ////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement