ruddeTR

ruddeTR's Simple Movement Hostname System

Feb 10th, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.94 KB | None | 0 0
  1. /*                                » ruddeTR's simple movement hostname system */
  2.  
  3. #include "  a_samp  "
  4.  
  5. #define DefaultHostname "SA-MP Server"
  6. #define DefaultWeburl "forum.sa-mp.com"
  7. #define Hostname1 "SA-MP Server - 1"
  8. #define Hostname2 "SA-MP Server - 2"
  9. #define Hostname3 "SA-MP Server - 3"
  10. #define Hostname4 "SA-MP Server - 4"
  11. #define Weburl1 "forum.sa-mp.com"
  12. #define Weburl2 "sa-mp.com"
  13. #define Weburl3 "forum.sa-mp.com"
  14. #define Weburl4 "sa-mp.com"
  15. #define SEC 1000 // m/s
  16.  
  17. forward HostnameChanger1();
  18. forward HostnameChanger2();
  19. forward HostnameChanger3();
  20. forward HostnameChanger4();
  21.  
  22. new t_Hostname;
  23.  
  24. public OnPlayerCommandText(playerid, cmdtext[])
  25. {
  26.  
  27.     if(!strcmp(cmdtext,"/hostname-start",true))
  28.     {
  29.             if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You do not have permission!");
  30.             {
  31.             SendClientMessage(playerid, -1, "Movement Hostname System activated.");
  32.             t_Hostname = SetTimer("HostnameChanger1", 5000, false);
  33.         }
  34.         return 1;
  35.     }
  36.  
  37.     if(!strcmp(cmdtext,"/hostname-stop",true))
  38.     {
  39.         if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You do not have permission!");
  40.         {
  41.                 SendClientMessage(playerid, -1, "Movement Hostname System de-activated.");
  42.             KillTimer(t_Hostname);
  43.             SendRconCommand(DefaultHostname);
  44.             SendRconCommand(DefaultWeburl);
  45.         }
  46.         return 1;
  47.     }
  48.  
  49.     return 0;
  50. }
  51.  
  52. public HostnameChanger1()
  53. {
  54.     SendRconCommand(Hostname1);
  55.     SendRconCommand(Weburl1);
  56.     SetTimer("HostnameChanger2", SEC, false);
  57.     return 1;
  58. }
  59.  
  60. public HostnameChanger2()
  61. {
  62.     SendRconCommand(Hostname2);
  63.     SendRconCommand(Weburl2);
  64.     SetTimer("HostnameChanger3", SEC, false);
  65.     return 1;
  66. }
  67.  
  68. public HostnameChanger3()
  69. {
  70.     SendRconCommand(Hostname3);
  71.     SendRconCommand(Weburl3);
  72.     SetTimer("HostnameChanger4", SEC, false);
  73.     return 1;
  74. }
  75.  
  76. public HostnameChanger4()
  77. {
  78.     SendRconCommand(Hostname4);
  79.     SetTimer("HostnameChanger1", SEC, false);
  80.     SendRconCommand(Weburl4);
  81.     return 1;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment