Guest User

PoWerZ

a guest
Jan 9th, 2009
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 130.00 KB | None | 0 0
  1. //============================================================================//Includes
  2. #include <a_samp>
  3. #include <core>
  4. #include <float>
  5. #include <time>
  6. #include <file>
  7. #include <utils>
  8.  
  9. //============================================================================//Defines
  10. #define COLOR_WRONGFORM 0xF3F3F3AA
  11. #define COLOR_W 0xF3F3F3AA
  12. #define COLOR_HELP 0x2F2FBBAA
  13. #define COLOR_H 0x2F2FBBAA
  14. #define COLOR_MESSAGE 0x41BEABAA
  15. #define COLOR_M 0x41BEABAA
  16. #define COLOR_CHATADMIN 0x3D46A0AA
  17. #define COLOR_ADMINCMD 0xDBA424AA
  18. #define COLOR_AFK 0xC85F3FF
  19. #define COLOR_PMIN 0xFF4600AA
  20. #define COLOR_PMOUT 0xFF7946AA
  21. #define COLOR_PM 0x008040AA
  22. #define COLOR_ADMINS 0xA2B83FF
  23. #define COLOR_CHATNAME 0x0000FFAA
  24. #define COLOR_CHAT 0xFFFFFFAA
  25. #define COLOR_ADMINCHAT 0x7ACD7CAA
  26. #define COLOR_CONNECT 0x408080AA
  27. #define COLOR_DISCONNECT 0x408080AA
  28. #define COLOR_CLOCKDATE 0x5550AFAA
  29.  
  30.  
  31.  
  32. //PAM (PoWer Admin Mode) Created by PoWer.
  33. //All Right Reserved.
  34. //For any Help contact me at SA-MP Forums - PoWerZ,
  35. //or in the Release theard.
  36. //Made in Israel.
  37.  
  38. //   _____                    _                             _
  39. //   ||  \\                  \\                           //
  40. //   ||   ||       ========   \\                         //     _______
  41. //   ||   //      /        \   \\          //\\         //     //      ||     || ======
  42. //   ||__//       |         |   \\        //  \\       //      ||      ||     ||/
  43. //   ||           |         |    \\      //    \\     //       || =====/|     ||
  44. //   ||           \        /      \\    //     \\    //        |\_______      ||
  45. //   ||            =========       ======       ======
  46.  
  47. //============================================================================//Publics
  48. forward SendClientMessageNoAFK(playerid, color, string[]);
  49. forward SendClientMessageToAllNoAFK(color, string[]);
  50. forward GameTextForAllNoAFK(string[], time, style);
  51. forward LoadAdministrationLoginInfo();
  52. forward SendAdminMessage(color, string[]);
  53. forward KickLog(string[]);
  54. forward BanLog(string[]);
  55. forward CountTimer();
  56. forward Go();
  57. forward IsAdmin(playerid);
  58. forward AdminConnect(playerid);
  59. forward NextStep(playerid);
  60. forward SetTime(hours);
  61. forward SetCount(Seconds);
  62. forward HideAdministrationLogin(playerid);
  63. forward ShowAdministrationLoginStep(playerid,stepnumber);
  64. forward CheckUsername(const string[],playerid);
  65. forward CheckPassword(const string[],playerid);
  66. forward split(const strsrc[], strdest[][], delimiter);
  67. forward SetClockDate();
  68. forward CheckJail();
  69. //============================================================================//TextDraws
  70. new Text:AFKBox;
  71. new Text:AFKText;
  72. new Text:AFKTextReturn;
  73. new Text:Clock;
  74. new Text:Date;
  75. new Text:AdminLoginBox;
  76. new Text:AdminTextMain;
  77. new Text:AdminText1;
  78. new Text:AdminText2;
  79. new Text:PasswordBox;
  80. new Text:PasswordText;
  81. new Text:UsernameText;
  82. new Text:ThePassword[MAX_PLAYERS];
  83. new Text:ContinueText;
  84. new Text:CancelText;
  85. new Text:CorrectPassword;
  86. new Text:CorrectUsername;
  87. new Text:CorrectUsernameText[MAX_PLAYERS];
  88. new Text:CorrectPasswordText[MAX_PLAYERS];
  89. new Text:WrongPassword;
  90. new Text:WrongUsername;
  91. new Text:TextJail;
  92. new Text:TimeJail[MAX_PLAYERS];
  93. //============================================================================//Statuses
  94. new CountTime = 0;
  95. new CountGo;
  96. new Count;
  97. new CountStatus = 0;
  98. new ChatStatus = 0;
  99. new Second = 1000;
  100. //============================================================================//Date/Clock TextDraws
  101. new YearTextDraw;
  102. new MonthTextDraw;
  103. new DayTextDraw;
  104. new HourTextDraw;
  105. new MinuteTextDraw;
  106. new SecondTextDraw;
  107.  
  108. enum pInfo
  109. {
  110.     PlayerLogin,
  111.     PlayerUsername[128],
  112.     PlayerPassword[128],
  113.     AdminCount,
  114.     NextStepCount,
  115.     Mute,
  116.     AFK,
  117.     Spector,
  118.     PlayerAdmin,
  119.     AdminConnectTimer,
  120.     NextStepTimer,
  121.     UsernameNumber,
  122.     ClockStatus,
  123.     DateStatus,
  124.     Float:LocationX,
  125.     Float:LocationY,
  126.     Float:LocationZ,
  127.     JailStatus,
  128.     JailMinutes,
  129.     JailSeconds
  130. };
  131.  
  132. new AdminModePlayerInfo[MAX_PLAYERS][pInfo]; //AdminMode Player Info
  133.  
  134. enum Info
  135. {
  136.     AdminUsername[128],
  137.     AdminPassword[128],
  138. };
  139. new UPInfo[10][Info];//Username + Password AdministrationLogin Info (Max:10 Admins)
  140.  
  141. public SetTime(hours)//For all players
  142. {
  143.     for(new i = 0; i < MAX_PLAYERS; i++)
  144.     {
  145.         if(IsPlayerConnected(i))
  146.         {
  147.            SetPlayerTime(i,hours,00);
  148.         }
  149.     }
  150.     return 1;
  151. }
  152.  
  153. IsKeyJustDown(key, newkeys, oldkeys)
  154. {
  155.     if((newkeys & key) && !(oldkeys & key)) return 1;
  156.     return 0;
  157. }
  158.  
  159.  
  160. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  161. {
  162.     if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
  163.     {
  164.      if(AdminModePlayerInfo[playerid][PlayerLogin] == 1)
  165.      {
  166.       LoadAdministrationLoginInfo();
  167.       CheckUsername(AdminModePlayerInfo[playerid][PlayerUsername],playerid);
  168.       return 1;
  169.      }
  170.      if(AdminModePlayerInfo[playerid][PlayerLogin] == 2)
  171.      {
  172.       LoadAdministrationLoginInfo();
  173.       CheckPassword(AdminModePlayerInfo[playerid][PlayerPassword],playerid);
  174.       return 1;
  175.      }
  176.      return 1;
  177.     }
  178.     else if(IsKeyJustDown(KEY_ACTION,newkeys,oldkeys))
  179.     {
  180.      if(AdminModePlayerInfo[playerid][PlayerLogin] == 1 || AdminModePlayerInfo[playerid][PlayerLogin] == 2)
  181.      {
  182.       HideAdministrationLogin(playerid);
  183.       AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  184.       AdminModePlayerInfo[playerid][UsernameNumber] = 255;
  185.       return 1;
  186.      }
  187.      return 1;
  188.     }
  189.     return 1;
  190. }
  191.  
  192. public split(const strsrc[], strdest[][], delimiter)
  193. {
  194.     new i, li;
  195.     new aNum;
  196.     new len;
  197.     while(i <= strlen(strsrc)){
  198.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  199.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  200.             strdest[aNum][len] = 0;
  201.             li = i+1;
  202.             aNum++;
  203.         }
  204.         i++;
  205.     }
  206.     return 1;
  207. }
  208.  
  209.  
  210. public SetClockDate()
  211. {
  212.     new ClockString[256];
  213.     new DateString[256];
  214.     gettime(HourTextDraw, MinuteTextDraw, SecondTextDraw);
  215.     getdate(YearTextDraw, MonthTextDraw, DayTextDraw);
  216.     if(HourTextDraw < 10)
  217.     {
  218.        if(MinuteTextDraw < 10)
  219.        {
  220.        format(ClockString,sizeof(ClockString),"0%d:0%d",HourTextDraw,MinuteTextDraw);
  221.        TextDrawSetString(Clock, ClockString);
  222.        }
  223.        else
  224.        {
  225.        format(ClockString,sizeof(ClockString),"0%d:%d",HourTextDraw,MinuteTextDraw);
  226.        TextDrawSetString(Clock, ClockString);
  227.        }
  228.     }
  229.     else
  230.     {
  231.        if(MinuteTextDraw < 10)
  232.        {
  233.        format(ClockString,sizeof(ClockString),"%d:0%d",HourTextDraw,MinuteTextDraw);
  234.        TextDrawSetString(Clock, ClockString);
  235.        }
  236.        else
  237.        {
  238.        format(ClockString,sizeof(ClockString),"%d:%d",HourTextDraw,MinuteTextDraw);
  239.        TextDrawSetString(Clock, ClockString);
  240.        }
  241.     }
  242.     if(MonthTextDraw == 1)
  243.     {
  244.         format(DateString,sizeof(DateString),"%d ~w~January",DayTextDraw);
  245.     }
  246.     else if(MonthTextDraw == 2)
  247.     {
  248.         format(DateString,sizeof(DateString),"%d ~w~February",DayTextDraw);
  249.     }
  250.     else if(MonthTextDraw == 3)
  251.     {
  252.         format(DateString,sizeof(DateString),"%d ~w~March",DayTextDraw);
  253.     }
  254.     else if(MonthTextDraw == 4)
  255.     {
  256.         format(DateString,sizeof(DateString),"%d ~w~April",DayTextDraw);
  257.     }
  258.     else if(MonthTextDraw == 5)
  259.     {
  260.         format(DateString,sizeof(DateString),"%d ~w~May",DayTextDraw);
  261.     }
  262.     else if(MonthTextDraw == 6)
  263.     {
  264.         format(DateString,sizeof(DateString),"%d ~w~June",DayTextDraw);
  265.     }
  266.     else if(MonthTextDraw == 7)
  267.     {
  268.         format(DateString,sizeof(DateString),"%d ~w~July",DayTextDraw);
  269.     }
  270.     else if(MonthTextDraw == 8)
  271.     {
  272.         format(DateString,sizeof(DateString),"%d ~w~August",DayTextDraw);
  273.     }
  274.     else if(MonthTextDraw == 9)
  275.     {
  276.         format(DateString,sizeof(DateString),"%d ~w~September",DayTextDraw);
  277.     }
  278.     else if(MonthTextDraw == 10)
  279.     {
  280.         format(DateString,sizeof(DateString),"%d ~w~October",DayTextDraw);
  281.     }
  282.     else if(MonthTextDraw == 11)
  283.     {
  284.         format(DateString,sizeof(DateString),"%d ~w~November",DayTextDraw);
  285.     }
  286.     else if(MonthTextDraw == 12)
  287.     {
  288.         format(DateString,sizeof(DateString),"%d ~w~December",DayTextDraw);
  289.     }
  290.     TextDrawSetString(Date,DateString);
  291.     return 1;
  292. }
  293.  
  294. public CheckJail()
  295. {
  296.     for(new i = 0; i < MAX_PLAYERS; i++)
  297.     {
  298.      if(IsPlayerConnected(i))
  299.      {
  300.       if(AdminModePlayerInfo[i][JailStatus] == 1)
  301.       {
  302.         new TimeString[256];
  303.         AdminModePlayerInfo[i][JailSeconds] -= 1;
  304.         if(AdminModePlayerInfo[i][JailSeconds] == -1)
  305.         {
  306.              if(AdminModePlayerInfo[i][JailMinutes] == 0)
  307.              {
  308.              AdminModePlayerInfo[i][JailStatus] = 0;
  309.              AdminModePlayerInfo[i][JailMinutes] = 0;
  310.              AdminModePlayerInfo[i][JailSeconds] = 0;
  311.              SendClientMessageNoAFK(i,COLOR_M,"You unJailed Automaticly.");
  312.              TextDrawHideForPlayer(i,TimeJail[i]);
  313.              TextDrawSetString(TimeJail[i],"00:00 ~g~Min");
  314.              TextDrawHideForPlayer(i,TextJail);
  315.              SpawnPlayer(i);
  316.              continue;
  317.              }
  318.              AdminModePlayerInfo[i][JailSeconds] = 59;
  319.              AdminModePlayerInfo[i][JailMinutes] -= 1;
  320.              if(AdminModePlayerInfo[i][JailMinutes] < 10)
  321.              {
  322.                  if(AdminModePlayerInfo[i][JailSeconds] < 10)
  323.                  {
  324.                  format(TimeString,sizeof(TimeString),"0%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  325.                  TextDrawSetString(TimeJail[i], TimeString);
  326.                  continue;
  327.                  }
  328.                  else
  329.                  {
  330.                  format(TimeString,sizeof(TimeString),"0%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  331.                  TextDrawSetString(TimeJail[i], TimeString);
  332.                  continue;
  333.                  }
  334.              }
  335.              else
  336.              {
  337.                  if(AdminModePlayerInfo[i][JailSeconds] < 10)
  338.                  {
  339.                  format(TimeString,sizeof(TimeString),"%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  340.                  TextDrawSetString(TimeJail[i], TimeString);
  341.                  continue;
  342.                  }
  343.                  else
  344.                  {
  345.                  format(TimeString,sizeof(TimeString),"%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  346.                  TextDrawSetString(TimeJail[i], TimeString);
  347.                  continue;
  348.                  }
  349.              }
  350.         }
  351.         else
  352.         {
  353.              if(AdminModePlayerInfo[i][JailMinutes] < 10)
  354.              {
  355.                  if(AdminModePlayerInfo[i][JailSeconds] < 10)
  356.                  {
  357.                  format(TimeString,sizeof(TimeString),"0%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  358.                  TextDrawSetString(TimeJail[i], TimeString);
  359.                  continue;
  360.                  }
  361.                  else
  362.                  {
  363.                  format(TimeString,sizeof(TimeString),"0%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  364.                  TextDrawSetString(TimeJail[i], TimeString);
  365.                  continue;
  366.                  }
  367.              }
  368.              else
  369.              {
  370.                  if(AdminModePlayerInfo[i][JailSeconds] < 10)
  371.                  {
  372.                  format(TimeString,sizeof(TimeString),"%d:0%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  373.                  TextDrawSetString(TimeJail[i], TimeString);
  374.                  continue;
  375.                  }
  376.                  else
  377.                  {
  378.                  format(TimeString,sizeof(TimeString),"%d:%d ~g~Min",AdminModePlayerInfo[i][JailMinutes],AdminModePlayerInfo[i][JailSeconds]);
  379.                  TextDrawSetString(TimeJail[i], TimeString);
  380.                  continue;
  381.                  }
  382.              }
  383.         }
  384.       }
  385.      }
  386.     }
  387.     return 1;
  388. }
  389.  
  390.  
  391. public LoadAdministrationLoginInfo()
  392. {
  393.     new fileCoords[29][64];
  394.     new StringfromFile[256];
  395.     new File: AdminsFile = fopen("AdminMode/Admins.txt", io_read);
  396.     if (AdminsFile)
  397.     {
  398.         new idx;
  399.         while (idx < sizeof(UPInfo))
  400.         {
  401.             fread(AdminsFile, StringfromFile);
  402.             split(StringfromFile, fileCoords, '|');
  403.             strmid(UPInfo[idx][AdminUsername], fileCoords[0], 0, strlen(fileCoords[0]), 255);
  404.             strmid(UPInfo[idx][AdminPassword], fileCoords[1], 0, strlen(fileCoords[1]), 255);
  405.             idx++;
  406.         }
  407.         fclose(AdminsFile);
  408.     }
  409.     return 1;
  410. }
  411.  
  412. public NextStep(playerid)
  413. {
  414.     if(IsPlayerConnected(playerid))
  415.     {
  416.      if(AdminModePlayerInfo[playerid][NextStepCount] == 0)
  417.      {
  418.      TextDrawShowForPlayer(playerid,CorrectUsernameText[playerid]);
  419.      AdminModePlayerInfo[playerid][NextStepCount] += 1;
  420.      return 1;
  421.      }
  422.      else if(AdminModePlayerInfo[playerid][NextStepCount] == 1)
  423.      {
  424.      TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step..");
  425.      AdminModePlayerInfo[playerid][NextStepCount] += 1;
  426.      return 1;
  427.      }
  428.      else if(AdminModePlayerInfo[playerid][NextStepCount] == 2)
  429.      {
  430.      TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step...");
  431.      AdminModePlayerInfo[playerid][NextStepCount] += 1;
  432.      return 1;
  433.      }
  434.      else if(AdminModePlayerInfo[playerid][NextStepCount] == 3)
  435.      {
  436.      KillTimer(AdminModePlayerInfo[playerid][NextStepTimer]);
  437.      AdminModePlayerInfo[playerid][NextStepCount] = 0;
  438.      ShowAdministrationLoginStep(playerid,2);
  439.      return 1;
  440.      }
  441.     }
  442.     return 1;
  443. }
  444.  
  445. public CheckUsername(const string[],playerid)
  446. {
  447.        for(new u = 0; u < sizeof(UPInfo); u++)
  448.        {
  449.         if(strcmp(UPInfo[u][AdminUsername],string, true ) == 0)
  450.         {
  451.           if(strcmp("0",string, true ) == 0 || !strlen(string))
  452.           {
  453.            TextDrawShowForPlayer(playerid,WrongUsername);
  454.            PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
  455.            return 1;
  456.           }
  457.           else
  458.           {
  459.            new thePlayerUsername[256];
  460.            AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  461.            TextDrawHideForPlayer(playerid,WrongUsername);
  462.            TextDrawShowForPlayer(playerid,CorrectUsername);
  463.            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  464.            format(thePlayerUsername, sizeof(thePlayerUsername), "0");
  465.            strmid(AdminModePlayerInfo[playerid][PlayerUsername], thePlayerUsername, 0, strlen(thePlayerUsername), 255);
  466.            AdminModePlayerInfo[playerid][UsernameNumber] = u;
  467.            AdminModePlayerInfo[playerid][NextStepTimer] = SetTimerEx("NextStep",1000,1,"i",playerid);
  468.            return 1;
  469.           }
  470.         }
  471.        }
  472.        TextDrawShowForPlayer(playerid,WrongUsername);
  473.        PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
  474.        return 1;
  475. }
  476.  
  477.  
  478. public CheckPassword(const string[],playerid)
  479. {
  480.         AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  481.         if(strcmp(UPInfo[AdminModePlayerInfo[playerid][UsernameNumber]][AdminPassword],string, true ) == 0)
  482.         {
  483.           if(strcmp("0",string, true ) == 0 || !strlen(string))
  484.           {
  485.            AdminModePlayerInfo[playerid][PlayerLogin] = 2;
  486.            TextDrawShowForPlayer(playerid,WrongPassword);
  487.            PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
  488.            return 1;
  489.           }
  490.           else
  491.           {
  492.            new thePlayerPassword[256];
  493.            AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  494.            TextDrawHideForPlayer(playerid,WrongPassword);
  495.            TextDrawShowForPlayer(playerid,CorrectPassword);
  496.            TextDrawHideForPlayer(playerid,ContinueText);
  497.            TextDrawHideForPlayer(playerid,CancelText);
  498.            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  499.            AdminModePlayerInfo[playerid][UsernameNumber] = 255;
  500.            AdminModePlayerInfo[playerid][AdminCount] = 5;
  501.            format(thePlayerPassword, sizeof(thePlayerPassword), "0");
  502.            strmid(AdminModePlayerInfo[playerid][PlayerPassword], thePlayerPassword, 0, strlen(thePlayerPassword), 255);
  503.            AdminModePlayerInfo[playerid][AdminConnectTimer] = SetTimerEx("AdminConnect",1000,1,"i",playerid);
  504.            return 1;
  505.           }
  506.         }
  507.         AdminModePlayerInfo[playerid][PlayerLogin] = 2;
  508.         TextDrawShowForPlayer(playerid,WrongPassword);
  509.         PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
  510.         return 1;
  511. }
  512.  
  513.  
  514. public ShowAdministrationLoginStep(playerid,stepnumber)
  515. {
  516.   if(stepnumber == 1)
  517.   {
  518.     if(IsPlayerConnected(playerid))
  519.     {
  520.     TextDrawShowForPlayer(playerid,UsernameText);
  521.     TextDrawShowForPlayer(playerid,AdminLoginBox);
  522.     TextDrawShowForPlayer(playerid,AdminTextMain);
  523.     TextDrawShowForPlayer(playerid,AdminText1);
  524.     TextDrawShowForPlayer(playerid,AdminText2);
  525.     TextDrawShowForPlayer(playerid,PasswordBox);
  526.     TextDrawShowForPlayer(playerid,ThePassword[playerid]);
  527.     TextDrawShowForPlayer(playerid,ContinueText);
  528.     TextDrawShowForPlayer(playerid,CancelText);
  529.     return 1;
  530.     }
  531.   }
  532.   else if(stepnumber == 2)
  533.   {
  534.     if(IsPlayerConnected(playerid))
  535.     {
  536.     KillTimer(AdminModePlayerInfo[playerid][NextStepTimer]);
  537.     TextDrawHideForPlayer(playerid,UsernameText);
  538.     TextDrawHideForPlayer(playerid,CorrectUsername);
  539.     TextDrawHideForPlayer(playerid,CorrectUsernameText[playerid]);
  540.     TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step.");
  541.     TextDrawShowForPlayer(playerid,PasswordText);
  542.     TextDrawShowForPlayer(playerid,AdminLoginBox);
  543.     TextDrawShowForPlayer(playerid,AdminTextMain);
  544.     TextDrawShowForPlayer(playerid,AdminText1);
  545.     TextDrawShowForPlayer(playerid,AdminText2);
  546.     TextDrawShowForPlayer(playerid,PasswordBox);
  547.     TextDrawSetString(ThePassword[playerid],"_");
  548.     TextDrawShowForPlayer(playerid,ThePassword[playerid]);
  549.     TextDrawShowForPlayer(playerid,ContinueText);
  550.     TextDrawShowForPlayer(playerid,CancelText);
  551.     AdminModePlayerInfo[playerid][PlayerLogin] = 2;
  552.     return 1;
  553.     }
  554.   }
  555.   return 1;
  556. }
  557.  
  558.  
  559. public HideAdministrationLogin(playerid)
  560. {
  561.     if(IsPlayerConnected(playerid))
  562.     {
  563.     TextDrawHideForPlayer(playerid,AdminLoginBox);
  564.     TextDrawHideForPlayer(playerid,AdminTextMain);
  565.     TextDrawHideForPlayer(playerid,AdminText1);
  566.     TextDrawHideForPlayer(playerid,AdminText2);
  567.     TextDrawHideForPlayer(playerid,PasswordBox);
  568.     TextDrawHideForPlayer(playerid,UsernameText);
  569.     TextDrawHideForPlayer(playerid,PasswordText);
  570.     TextDrawHideForPlayer(playerid,ThePassword[playerid]);
  571.     TextDrawHideForPlayer(playerid,ContinueText);
  572.     TextDrawHideForPlayer(playerid,CancelText);
  573.     TextDrawHideForPlayer(playerid,CorrectPassword);
  574.     TextDrawHideForPlayer(playerid,CorrectUsername);
  575.     TextDrawHideForPlayer(playerid,CorrectUsernameText[playerid]);
  576.     TextDrawSetString(CorrectUsernameText[playerid],"Moving to the next Step.");
  577.     TextDrawSetString(ThePassword[playerid],"_");
  578.     TextDrawHideForPlayer(playerid,CorrectPasswordText[playerid]);
  579.     TextDrawHideForPlayer(playerid,WrongUsername);
  580.     TextDrawHideForPlayer(playerid,WrongPassword);
  581.     return 1;
  582.     }
  583.     return 1;
  584. }
  585.  
  586. public AdminConnect(playerid)
  587. {
  588.     if(IsPlayerConnected(playerid))
  589.     {
  590.      AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  591.      if(AdminModePlayerInfo[playerid][AdminCount] > 1)
  592.      {
  593.      TextDrawShowForPlayer(playerid,CorrectPasswordText[playerid]);
  594.      new string[256];
  595.      format(string,sizeof(string),"You'll log in more %d Seconds.",AdminModePlayerInfo[playerid][AdminCount]);
  596.      TextDrawSetString(CorrectPasswordText[playerid],string);
  597.      AdminModePlayerInfo[playerid][AdminCount] -= 1;
  598.      return 1;
  599.      }
  600.      else if(AdminModePlayerInfo[playerid][AdminCount] == 1)
  601.      {
  602.      TextDrawShowForPlayer(playerid,CorrectPasswordText[playerid]);
  603.      TextDrawSetString(CorrectPasswordText[playerid],"You'll log in more 1 Second.");
  604.      AdminModePlayerInfo[playerid][AdminCount] -= 1;
  605.      return 1;
  606.      }
  607.      else if(AdminModePlayerInfo[playerid][AdminCount] < 1)
  608.      {
  609.      HideAdministrationLogin(playerid);
  610.      KillTimer(AdminModePlayerInfo[playerid][AdminConnectTimer]);
  611.      AdminModePlayerInfo[playerid][AdminCount] = 5;
  612.      AdminModePlayerInfo[playerid][PlayerAdmin] = 1;
  613.      AdminModePlayerInfo[playerid][UsernameNumber] = 255;
  614.      SendClientMessageNoAFK(playerid,COLOR_M,"Wellcome,Admin.");
  615.      SendClientMessageNoAFK(playerid,COLOR_M,"To see the Admin Commands type /adminhelp Or /ah.");
  616.      return 1;
  617.      }
  618.     }
  619.     return 1;
  620. }
  621.  
  622. strtok(const string[], &index)
  623. {
  624.     new length = strlen(string);
  625.     while ((index < length) && (string[index] <= ' '))
  626.     {
  627.         index++;
  628.     }
  629.  
  630.     new offset = index;
  631.     new result[20];
  632.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  633.     {
  634.         result[index - offset] = string[index];
  635.         index++;
  636.     }
  637.     result[index - offset] = EOS;
  638.     return result;
  639. }
  640.  
  641.  
  642. public SendAdminMessage(color, string[])
  643. {
  644.     for(new i = 0; i < MAX_PLAYERS; i++)
  645.     {
  646.         if(IsPlayerConnected(i))
  647.         {
  648.             if(IsAdmin(i))
  649.             {
  650.               if(AdminModePlayerInfo[i][AFK] == 0)
  651.               {
  652.                 SendClientMessage(i, color, string);
  653.               }
  654.             }
  655.         }
  656.     }
  657.     return 1;
  658. }
  659.  
  660. public SendClientMessageNoAFK(playerid, color, string[])
  661. {
  662.      if(AdminModePlayerInfo[playerid][AFK] == 0)
  663.      {
  664.         SendClientMessage(playerid, color, string);
  665.         return 1;
  666.      }
  667.      return 1;
  668. }
  669.  
  670. public SendClientMessageToAllNoAFK(color, string[])
  671. {
  672.     for(new i = 0; i < MAX_PLAYERS; i++)
  673.     {
  674.         if(IsPlayerConnected(i))
  675.         {
  676.               if(AdminModePlayerInfo[i][AFK] == 0)
  677.               {
  678.                 SendClientMessage(i, color, string);
  679.               }
  680.         }
  681.     }
  682.     return 1;
  683. }
  684.  
  685. public GameTextForAllNoAFK(string[], time, style)
  686. {
  687.     for(new i = 0; i < MAX_PLAYERS; i++)
  688.     {
  689.         if(IsPlayerConnected(i))
  690.         {
  691.               if(AdminModePlayerInfo[i][AFK] == 0)
  692.               {
  693.                 GameTextForPlayer(i, string, time, style);
  694.               }
  695.         }
  696.     }
  697.     return 1;
  698. }
  699.  
  700.  
  701.  
  702. public SetCount(Seconds)
  703. {
  704.   CountTime = Seconds;
  705.   return 1;
  706. }
  707.  
  708. public CountTimer()
  709. {
  710.  if(CountTime != 0)
  711.  {
  712.   new stringTime[256];
  713.   format(stringTime,sizeof(stringTime),"~b~%d",CountTime);
  714.   GameTextForAllNoAFK(stringTime, 1500, 3);
  715.   for(new i = 0; i < MAX_PLAYERS; i++)
  716.   {
  717.     if(IsPlayerConnected(i))
  718.     {
  719.        if(AdminModePlayerInfo[i][AFK] == 0)
  720.        {
  721.           PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
  722.        }
  723.     }
  724.   }
  725.   CountTime -= 1;
  726.   return 1;
  727.  }
  728.  else
  729.  {
  730.   KillTimer(Count);
  731.   CountGo = SetTimer("Go",0,0);
  732.   CountTime = 0;
  733.   return 1;
  734.  }
  735. }
  736.  
  737. public Go()
  738. {
  739.   new stringTime[256];
  740.   format(stringTime,sizeof(stringTime),"~g~GO!");
  741.   GameTextForAllNoAFK(stringTime, 1500, 3);
  742.   for(new i = 0; i < MAX_PLAYERS; i++)
  743.   {
  744.     if(IsPlayerConnected(i))
  745.     {
  746.        if(AdminModePlayerInfo[i][AFK] == 0)
  747.        {
  748.           PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  749.        }
  750.     }
  751.   }
  752.   CountStatus = 0;
  753.   return 1;
  754. }
  755.  
  756. public IsAdmin(playerid)
  757. {
  758.   if(AdminModePlayerInfo[playerid][PlayerAdmin] == 1)
  759.   {
  760.     return 1;
  761.   }
  762.   return 0;
  763. }
  764.  
  765. public KickLog(string[])
  766. {
  767.     new KickText[256];
  768.     new File:KickFile;
  769.     format(KickText, sizeof(KickText), "%s\n",string);
  770.     KickFile = fopen("AdminMode/Kick.txt", io_append);
  771.     fwrite(KickFile, KickText);
  772.     fclose(KickFile);
  773.     return 1;
  774. }
  775.  
  776. public BanLog(string[])
  777. {
  778.     new BanText[256];
  779.     new File:BanFile;
  780.     format(BanText, sizeof(BanText), "%s\n",string);
  781.     BanFile = fopen("AdminMode/Ban.txt", io_append);
  782.     fwrite(BanFile, BanText);
  783.     fclose(BanFile);
  784.     return 1;
  785. }
  786.  
  787. public OnFilterScriptInit()
  788. {
  789.     AdminLoginBox = TextDrawCreate(528.000000,108.000000,"_");
  790.     AdminTextMain = TextDrawCreate(214.000000,111.000000,"Administration Login");
  791.     AdminText1 = TextDrawCreate(190.000000,155.000000,"Please type your Administor Username");
  792.     AdminText2 = TextDrawCreate(189.000000,175.000000,"and Password to connect as Admin.");
  793.     PasswordBox = TextDrawCreate(497.000000,212.000000,"_");
  794.     PasswordText = TextDrawCreate(159.000000,207.000000,"Password :");
  795.     UsernameText = TextDrawCreate(159.000000,207.000000,"Username :");
  796.     ContinueText = TextDrawCreate(174.000000,292.000000,"Press ~b~~k~~PED_SPRINT~~w~ to Continue");
  797.     CancelText = TextDrawCreate(174.000000,318.000000,"Press ~b~~k~~PED_ANSWER_PHONE~~w~ to Cancel");
  798.     CorrectPassword = TextDrawCreate(219.000000,235.000000,"Correct Password");
  799.     CorrectUsername = TextDrawCreate(219.000000,235.000000,"Correct Username");
  800.     WrongPassword = TextDrawCreate(219.000000,235.000000,"Wrong Password");
  801.     WrongUsername = TextDrawCreate(219.000000,235.000000,"Wrong Username");
  802.     AFKBox = TextDrawCreate(645.000000,1.000000,"-");
  803.     AFKText = TextDrawCreate(270.000000,164.000000,"AFK");
  804.     AFKTextReturn = TextDrawCreate(106.000000,237.000000,"to return to Game type /AFK");
  805.     Clock = TextDrawCreate(258.000000,295.000000,"Clock");
  806.     Date = TextDrawCreate(238.000000,322.000000,"Date");
  807.     TextJail = TextDrawCreate(244.000000,108.000000,"Jail Time");
  808.     TextDrawAlignment(Clock,0);
  809.     TextDrawAlignment(Date,0);
  810.     TextDrawBackgroundColor(Clock,0x000000ff);
  811.     TextDrawBackgroundColor(Date,0x000000ff);
  812.     TextDrawFont(Clock,3);
  813.     TextDrawLetterSize(Clock,0.799999,2.200000);
  814.     TextDrawFont(Date,3);
  815.     TextDrawLetterSize(Date,0.899999,2.200000);
  816.     TextDrawColor(Clock,COLOR_CLOCKDATE);
  817.     TextDrawColor(Date,COLOR_CLOCKDATE);
  818.     TextDrawSetOutline(Clock,1);
  819.     TextDrawSetOutline(Date,1);
  820.     TextDrawSetProportional(Clock,1);
  821.     TextDrawSetProportional(Date,1);
  822.     TextDrawSetShadow(Clock,1);
  823.     TextDrawSetShadow(Date,1);
  824.     TextDrawAlignment(TextJail,0);
  825.     TextDrawBackgroundColor(TextJail,0x000000ff);
  826.     TextDrawFont(TextJail,3);
  827.     TextDrawLetterSize(TextJail,0.799999,2.900000);
  828.     TextDrawColor(TextJail,0x008000AA);
  829.     TextDrawSetOutline(TextJail,1);
  830.     TextDrawSetProportional(TextJail,1);
  831.     TextDrawSetShadow(TextJail,1);
  832.     TextDrawLetterSize(AFKBox,0,50);
  833.     TextDrawUseBox(AFKBox,1);
  834.     TextDrawColor(AFKBox,0x000000ff);
  835.     TextDrawTextSize(AFKBox,-3.000000,17.000000);
  836.     TextDrawBoxColor(AFKBox,0x000000ff);
  837.     TextDrawLetterSize(AFKText,1.000000,3.699999);
  838.     TextDrawBackgroundColor(AFKBox,0x000000ff);
  839.     TextDrawFont(AFKBox,3);
  840.     TextDrawLetterSize(AFKBox,-34.600002,49.399997);
  841.     TextDrawFont(AFKText,1);
  842.     TextDrawFont(AFKTextReturn,1);
  843.     TextDrawLetterSize(AFKTextReturn,0.800000,4.399999);
  844.     TextDrawColor(AFKText,0xff0000ff);
  845.     TextDrawColor(AFKTextReturn,0xff0000ff);
  846.     TextDrawUseBox(AdminLoginBox,1);
  847.     TextDrawBoxColor(AdminLoginBox,0x00000099);
  848.     TextDrawTextSize(AdminLoginBox,129.000000,-24.000000);
  849.     TextDrawUseBox(PasswordBox,1);
  850.     TextDrawBoxColor(PasswordBox,0xffffffcc);
  851.     TextDrawTextSize(PasswordBox,260.000000,-47.000000);
  852.     TextDrawAlignment(AdminLoginBox,0);
  853.     TextDrawAlignment(AdminTextMain,0);
  854.     TextDrawAlignment(AdminText1,0);
  855.     TextDrawAlignment(AdminText2,0);
  856.     TextDrawAlignment(PasswordBox,0);
  857.     TextDrawAlignment(PasswordText,0);
  858.     TextDrawAlignment(UsernameText,0);
  859.     TextDrawAlignment(ContinueText,0);
  860.     TextDrawAlignment(CancelText,0);
  861.     TextDrawBackgroundColor(AdminLoginBox,0x000000ff);
  862.     TextDrawBackgroundColor(AdminTextMain,0x000000ff);
  863.     TextDrawBackgroundColor(AdminText1,0xffffffff);
  864.     TextDrawBackgroundColor(AdminText2,0xffffffff);
  865.     TextDrawBackgroundColor(PasswordBox,0x0000ffcc);
  866.     TextDrawBackgroundColor(PasswordText,0xffffff66);
  867.     TextDrawBackgroundColor(UsernameText,0xffffff66);
  868.     TextDrawBackgroundColor(ContinueText,0x000000ff);
  869.     TextDrawBackgroundColor(CancelText,0x000000ff);
  870.     TextDrawFont(AdminLoginBox,3);
  871.     TextDrawLetterSize(AdminLoginBox,1.000000,27.000000);
  872.     TextDrawFont(AdminTextMain,0);
  873.     TextDrawLetterSize(AdminTextMain,0.899999,2.700000);
  874.     TextDrawFont(AdminText1,3);
  875.     TextDrawLetterSize(AdminText1,0.400000,1.300001);
  876.     TextDrawFont(AdminText2,3);
  877.     TextDrawLetterSize(AdminText2,0.399999,1.400000);
  878.     TextDrawFont(PasswordBox,3);
  879.     TextDrawLetterSize(PasswordBox,1.000000,1.200000);
  880.     TextDrawFont(PasswordText,3);
  881.     TextDrawLetterSize(PasswordText,0.499999,2.200001);
  882.     TextDrawFont(UsernameText,3);
  883.     TextDrawLetterSize(UsernameText,0.499999,2.200001);
  884.     TextDrawFont(ContinueText,3);
  885.     TextDrawLetterSize(ContinueText,0.499999,1.900000);
  886.     TextDrawFont(CancelText,3);
  887.     TextDrawLetterSize(CancelText,0.499999,1.700000);
  888.     TextDrawColor(AdminLoginBox,0xffffffff);
  889.     TextDrawColor(AdminTextMain,0xffffffff);
  890.     TextDrawColor(AdminText1,0x000000cc);
  891.     TextDrawColor(AdminText2,0x000000cc);
  892.     TextDrawColor(PasswordBox,0xffffffff);
  893.     TextDrawColor(PasswordText,0xffffffcc);
  894.     TextDrawColor(UsernameText,0xffffffcc);
  895.     TextDrawColor(ContinueText,0xffffffff);
  896.     TextDrawColor(CancelText,0xffffffff);
  897.     TextDrawSetOutline(AdminLoginBox,1);
  898.     TextDrawSetOutline(AdminTextMain,1);
  899.     TextDrawSetOutline(AdminText1,1);
  900.     TextDrawSetOutline(AdminText2,1);
  901.     TextDrawSetOutline(ContinueText,1);
  902.     TextDrawSetOutline(CancelText,1);
  903.     TextDrawAlignment(WrongPassword,0);
  904.     TextDrawAlignment(WrongUsername,0);
  905.     TextDrawBackgroundColor(WrongPassword,0x000000ff);
  906.     TextDrawBackgroundColor(WrongUsername,0x000000ff);
  907.     TextDrawFont(WrongPassword,0);
  908.     TextDrawFont(WrongUsername,0);
  909.     TextDrawLetterSize(WrongPassword,0.899999,2.299999);
  910.     TextDrawLetterSize(WrongUsername,0.899999,2.299999);
  911.     TextDrawColor(WrongPassword,0xff0000ff);
  912.     TextDrawColor(WrongUsername,0xff0000ff);
  913.     TextDrawSetOutline(WrongPassword,1);
  914.     TextDrawSetOutline(WrongUsername,1);
  915.     TextDrawSetProportional(WrongPassword,1);
  916.     TextDrawSetProportional(WrongUsername,1);
  917.     TextDrawSetShadow(WrongPassword,1);
  918.     TextDrawSetShadow(WrongUsername,1);
  919.     TextDrawAlignment(CorrectPassword,0);
  920.     TextDrawAlignment(CorrectUsername,0);
  921.     TextDrawBackgroundColor(CorrectPassword,0x000000ff);
  922.     TextDrawBackgroundColor(CorrectUsername,0x000000ff);
  923.     TextDrawLetterSize(CorrectPassword,0.899999,2.299999);
  924.     TextDrawLetterSize(CorrectUsername,0.899999,2.299999);
  925.     TextDrawColor(CorrectPassword,0x00ff00cc);
  926.     TextDrawColor(CorrectUsername,0x00ff00cc);
  927.     TextDrawSetOutline(CorrectPassword,1);
  928.     TextDrawSetOutline(CorrectUsername,1);
  929.     TextDrawSetProportional(CorrectPassword,1);
  930.     TextDrawSetProportional(CorrectUsername,1);
  931.     TextDrawSetShadow(CorrectPassword,1);
  932.     TextDrawSetShadow(CorrectUsername,1);
  933.     TextDrawFont(CorrectPassword,0);
  934.     TextDrawFont(CorrectUsername,0);
  935.     for(new i = 0; i < MAX_PLAYERS; i++)
  936.     {
  937.     ThePassword[i] = TextDrawCreate(270.000000,210.000000,"_");
  938.     CorrectUsernameText[i] = TextDrawCreate(191.000000,261.000000,"Moving to the next Step.");
  939.     CorrectPasswordText[i] = TextDrawCreate(191.000000,261.000000,"You'll log in more 5 Seconds.");
  940.     TimeJail[i] = TextDrawCreate(238.000000,138.000000,"00:00 ~g~Min");
  941.     TextDrawBackgroundColor(TimeJail[i],0x000000ff);
  942.     TextDrawLetterSize(TimeJail[i],0.799999,3.100000);
  943.     TextDrawColor(TimeJail[i],0xffffffff);
  944.     TextDrawSetOutline(TimeJail[i],1);
  945.     TextDrawSetProportional(TimeJail[i],1);
  946.     TextDrawSetShadow(TimeJail[i],1);
  947.     TextDrawAlignment(TimeJail[i],0);
  948.     TextDrawFont(TimeJail[i],3);
  949.     TextDrawSetOutline(ThePassword[i],1);
  950.     TextDrawColor(ThePassword[i],0xffffffcc);
  951.     TextDrawFont(ThePassword[i],3);
  952.     TextDrawLetterSize(ThePassword[i],0.599999,1.600000);
  953.     TextDrawBackgroundColor(ThePassword[i],0x00000099);
  954.     TextDrawAlignment(ThePassword[i],0);
  955.     TextDrawAlignment(CorrectPasswordText[i],0);
  956.     TextDrawBackgroundColor(CorrectPasswordText[i],0xffffffcc);
  957.     TextDrawLetterSize(CorrectPasswordText[i],0.399999,1.999999);
  958.     TextDrawColor(CorrectPasswordText[i],0x000000cc);
  959.     TextDrawFont(CorrectPasswordText[i],2);
  960.     TextDrawSetOutline(CorrectPasswordText[i],1);
  961.     TextDrawSetProportional(CorrectPasswordText[i],1);
  962.     TextDrawSetShadow(CorrectPasswordText[i],1);
  963.     TextDrawAlignment(CorrectUsernameText[i],0);
  964.     TextDrawBackgroundColor(CorrectUsernameText[i],0xffffffcc);
  965.     TextDrawLetterSize(CorrectUsernameText[i],0.399999,1.999999);
  966.     TextDrawColor(CorrectUsernameText[i],0x000000cc);
  967.     TextDrawFont(CorrectUsernameText[i],2);
  968.     TextDrawSetOutline(CorrectUsernameText[i],1);
  969.     TextDrawSetProportional(CorrectUsernameText[i],1);
  970.     TextDrawSetShadow(CorrectUsernameText[i],1);
  971.     }
  972.     CountStatus = 0;
  973.     SetTimer("SetClockDate",1000,1);
  974.     SetTimer("CheckJail",1000,1);
  975.     print("\n|------------------------------------|");
  976.     print("|PoWer Admin Mode Loaded Succesfully.|");
  977.     print("|------------------------------------|\n");
  978.     return 1;
  979. }
  980.  
  981. public OnFilterScriptExit()
  982. {
  983.     return 1;
  984. }
  985.  
  986. public OnPlayerConnect(playerid)
  987. {
  988.     SendClientMessage(playerid,COLOR_CONNECT, "This server uses PoWer - Admin Mode.");
  989.     new string[64];
  990.     new PlayerConnecting[MAX_PLAYER_NAME];
  991.     GetPlayerName(playerid, PlayerConnecting, sizeof(PlayerConnecting));
  992.     format(string, sizeof(string), "%s[ID:%d] Connected to The Server.", PlayerConnecting, playerid);
  993.     SendClientMessageToAllNoAFK(COLOR_CONNECT, string);
  994.     AdminModePlayerInfo[playerid][AFK] = 0;
  995.     AdminModePlayerInfo[playerid][Mute] = 0;
  996.     AdminModePlayerInfo[playerid][Spector] = 0;
  997.     AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  998.     AdminModePlayerInfo[playerid][AdminCount] = 0;
  999.     AdminModePlayerInfo[playerid][PlayerAdmin] = 0;
  1000.     AdminModePlayerInfo[playerid][UsernameNumber] = 255;
  1001.     AdminModePlayerInfo[playerid][NextStepCount] = 0;
  1002.     AdminModePlayerInfo[playerid][ClockStatus] = 0;
  1003.     AdminModePlayerInfo[playerid][DateStatus] = 0;
  1004.     AdminModePlayerInfo[playerid][LocationX] = 0;
  1005.     AdminModePlayerInfo[playerid][LocationY] = 0;
  1006.     AdminModePlayerInfo[playerid][LocationZ] = 0;
  1007.     AdminModePlayerInfo[playerid][JailStatus] = 0;
  1008.     AdminModePlayerInfo[playerid][JailMinutes] = 0;
  1009.     AdminModePlayerInfo[playerid][JailSeconds] = 0;
  1010.     TextDrawSetString(ThePassword[playerid],"_");
  1011.     TextDrawSetString(TimeJail[playerid],"00:00 ~g~Min");
  1012.     return 1;
  1013. }
  1014.  
  1015. public OnPlayerDisconnect(playerid, reason)
  1016. {
  1017.     new string[64];
  1018.     new PlayerDisconnecting[MAX_PLAYER_NAME];
  1019.     GetPlayerName(playerid, PlayerDisconnecting, sizeof(PlayerDisconnecting));
  1020.     if(reason == 0)
  1021.     {
  1022.      format(string, sizeof(string), "%s[ID:%d] Disconnected The Server.(Timed out)", PlayerDisconnecting, playerid);
  1023.     }
  1024.     else if(reason == 1)
  1025.     {
  1026.      format(string, sizeof(string), "%s[ID:%d] Disconnected from The Server.(Left)", PlayerDisconnecting, playerid);
  1027.     }
  1028.     else if(reason == 2)
  1029.     {
  1030.      format(string, sizeof(string), "%s[ID:%d] Disconnected from The Server.(Kicked/Banned)", PlayerDisconnecting, playerid);
  1031.     }
  1032.     SendClientMessageToAllNoAFK(COLOR_DISCONNECT, string);
  1033.     AdminModePlayerInfo[playerid][AFK] = 0;
  1034.     AdminModePlayerInfo[playerid][Mute] = 0;
  1035.     AdminModePlayerInfo[playerid][Spector] = 0;
  1036.     AdminModePlayerInfo[playerid][PlayerLogin] = 0;
  1037.     AdminModePlayerInfo[playerid][AdminCount] = 0;
  1038.     AdminModePlayerInfo[playerid][PlayerAdmin] = 0;
  1039.     AdminModePlayerInfo[playerid][UsernameNumber] = 255;
  1040.     AdminModePlayerInfo[playerid][NextStepCount] = 0;
  1041.     AdminModePlayerInfo[playerid][ClockStatus] = 0;
  1042.     AdminModePlayerInfo[playerid][DateStatus] = 0;
  1043.     AdminModePlayerInfo[playerid][LocationX] = 0;
  1044.     AdminModePlayerInfo[playerid][LocationY] = 0;
  1045.     AdminModePlayerInfo[playerid][LocationZ] = 0;
  1046.     AdminModePlayerInfo[playerid][JailStatus] = 0;
  1047.     AdminModePlayerInfo[playerid][JailMinutes] = 0;
  1048.     AdminModePlayerInfo[playerid][JailSeconds] = 0;
  1049.     TextDrawSetString(ThePassword[playerid],"_");
  1050.     TextDrawSetString(TimeJail[playerid],"00:00 ~g~Min");
  1051.     return 1;
  1052. }
  1053.  
  1054. public OnPlayerSpawn(playerid)
  1055. {
  1056.     if(AdminModePlayerInfo[playerid][AFK] == 1)
  1057.     {
  1058.       TogglePlayerControllable(playerid, 0);
  1059.       TextDrawShowForPlayer(playerid,AFKBox);
  1060.       TextDrawShowForPlayer(playerid,AFKText);
  1061.       TextDrawShowForPlayer(playerid,AFKTextReturn);
  1062.       SetPlayerVirtualWorld(playerid,playerid+1);
  1063.       return 1;
  1064.     }
  1065.     return 1;
  1066. }
  1067.  
  1068.  
  1069. public OnPlayerText(playerid, text[])
  1070. {
  1071.   if(AdminModePlayerInfo[playerid][Mute] == 0)
  1072.   {
  1073.     if(AdminModePlayerInfo[playerid][AFK] == 0)
  1074.     {
  1075.      if(AdminModePlayerInfo[playerid][PlayerLogin] == 1)
  1076.      {
  1077.       new string[256];
  1078.       format(string, sizeof(string), "%s", text);
  1079.       strmid(AdminModePlayerInfo[playerid][PlayerUsername], string, 0, strlen(string), 255);
  1080.       TextDrawSetString(ThePassword[playerid],text);
  1081.       return 0;
  1082.      }
  1083.      else if(AdminModePlayerInfo[playerid][PlayerLogin] == 2)
  1084.      {
  1085.       new string[256];
  1086.       format(string, sizeof(string), "%s", text);
  1087.       strmid(AdminModePlayerInfo[playerid][PlayerPassword], string, 0, strlen(string), 255);
  1088.       TextDrawSetString(ThePassword[playerid],text);
  1089.       return 0;
  1090.      }
  1091.      else
  1092.      {
  1093.       if(ChatStatus == 0)
  1094.       {
  1095.        if(IsAdmin(playerid))
  1096.        {
  1097.          new stringtext[256];
  1098.          new playername[256];
  1099.          GetPlayerName(playerid,playername,sizeof(playername));
  1100.          format(stringtext,sizeof(stringtext),"|Admin|%s[ID:%d]: %s",playername,playerid,text);
  1101.          SendClientMessageToAllNoAFK(COLOR_ADMINCHAT,stringtext);
  1102.          return 0;
  1103.        }
  1104.        else
  1105.        {
  1106.          new stringtext[256];
  1107.          new playername[256];
  1108.          GetPlayerName(playerid,playername,sizeof(playername));
  1109.          format(stringtext,sizeof(stringtext),"%s[ID:%d]: %s",playername,playerid,text);
  1110.          SendClientMessageToAllNoAFK(COLOR_CHAT,stringtext);
  1111.          return 0;
  1112.        }
  1113.       }
  1114.       else
  1115.       {
  1116.        if(IsAdmin(playerid))
  1117.        {
  1118.          new stringtext[256];
  1119.          new playername[256];
  1120.          GetPlayerName(playerid,playername,sizeof(playername));
  1121.          format(stringtext,sizeof(stringtext),"|Admin|%s[ID:%d]: %s",playername,playerid,text);
  1122.          SendClientMessageToAllNoAFK(COLOR_ADMINCHAT,stringtext);
  1123.          return 0;
  1124.        }
  1125.        else
  1126.        {
  1127.          SendClientMessage(playerid, COLOR_W, "Chat Close,You can't Write nothing!");
  1128.          return 0;
  1129.        }
  1130.       }
  1131.      }
  1132.     }
  1133.     else
  1134.     {
  1135.       SendClientMessage(playerid, COLOR_W, "You Are AFK,You can't Write nothing!");
  1136.       return 0;
  1137.     }
  1138.   }
  1139.   else
  1140.   {
  1141.     SendClientMessage(playerid, COLOR_W, "You Muted,You can't Write nothing!");
  1142.     return 0;
  1143.   }
  1144. }
  1145.  
  1146. public OnPlayerPrivmsg(playerid, recieverid, text[])
  1147. {
  1148.     new string[256], sendername[24],givename[24];
  1149.     GetPlayerName(playerid, sendername, sizeof(sendername));
  1150.     GetPlayerName(recieverid, givename, sizeof(givename));
  1151.     for(new i = 0; i < MAX_PLAYERS; i++)
  1152.     {
  1153.       if(IsAdmin(i))
  1154.       {
  1155.             format(string, sizeof (string), "PM: %s[ID:%d] To %s[ID:%d]: %s", sendername, playerid, givename, recieverid, text);
  1156.             SendClientMessageNoAFK(i, COLOR_PM, string);
  1157.       }
  1158.     }
  1159.     return 0;
  1160. }
  1161.  
  1162. public OnPlayerCommandText(playerid, cmdtext[])
  1163. {
  1164.   new string[256];
  1165.   new giveplayername[MAX_PLAYER_NAME];
  1166.   new sendername[MAX_PLAYER_NAME];
  1167.   new cmd[256];
  1168.   new tmp[256];
  1169.   new idx;
  1170.   new giveplayerid;
  1171.   cmd = strtok(cmdtext, idx);
  1172.   if(AdminModePlayerInfo[playerid][AFK] == 0)
  1173.   {
  1174. //----------------------------------------[Interior Commands]----------------------------------------|
  1175.     if(strcmp(cmd, "/setinterior", true) == 0)
  1176.     {
  1177.         if(IsPlayerConnected(playerid))
  1178.         {
  1179.           if(IsAdmin(playerid))
  1180.           {
  1181.             tmp = strtok(cmdtext, idx);
  1182.             if(!strlen(tmp))
  1183.             {
  1184.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setinterior [Interior ID]");
  1185.                 return 1;
  1186.             }
  1187.             new interiorid;
  1188.             interiorid = strval(tmp);
  1189.             SetPlayerInterior(playerid,interiorid);
  1190.             format(string, sizeof(string), "Your Interior Switched to |%d|.", interiorid);
  1191.             SendClientMessageNoAFK(playerid,COLOR_M, string);
  1192.             return 1;
  1193.           }
  1194.           else
  1195.           {
  1196.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1197.           }
  1198.         }
  1199.         return 1;
  1200.     }
  1201.     if(strcmp(cmd, "/getinterior", true) == 0)
  1202.     {
  1203.         if(IsPlayerConnected(playerid))
  1204.         {
  1205.           if(IsAdmin(playerid))
  1206.           {
  1207.             tmp = strtok(cmdtext, idx);
  1208.             if(!strlen(tmp))
  1209.             {
  1210.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Getinterior [Playerid/PartOfName]");
  1211.                 return 1;
  1212.             }
  1213.             giveplayerid = ReturnUser(tmp);
  1214.             if(IsPlayerConnected(giveplayerid))
  1215.             {
  1216.                if(giveplayerid != INVALID_PLAYER_ID)
  1217.                {
  1218.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1219.                 new interiorid;
  1220.                 interiorid = GetPlayerInterior(giveplayerid);
  1221.                 format(string, sizeof(string), "The Interior of %s[ID:%d] is |%d|.", giveplayername, giveplayerid, interiorid);
  1222.                 SendClientMessageNoAFK(playerid,COLOR_M, string);
  1223.                 return 1;
  1224.                }
  1225.             }
  1226.             else
  1227.             {
  1228.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1229.                 return 1;
  1230.             }
  1231.           }
  1232.           else
  1233.           {
  1234.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1235.           }
  1236.         }
  1237.         return 1;
  1238.     }
  1239. //----------------------------------------[Teleport Commands]----------------------------------------|
  1240.     if(strcmp(cmd, "/tpto", true) == 0)
  1241.     {
  1242.         if(IsPlayerConnected(playerid))
  1243.         {
  1244.           if(IsAdmin(playerid))
  1245.           {
  1246.             tmp = strtok(cmdtext, idx);
  1247.             if(!strlen(tmp))
  1248.             {
  1249.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPto [Playerid/PartOfName]");
  1250.                 return 1;
  1251.             }
  1252.             giveplayerid = ReturnUser(tmp);
  1253.             if(IsPlayerConnected(giveplayerid))
  1254.             {
  1255.                if(giveplayerid != INVALID_PLAYER_ID)
  1256.                {
  1257.                  if(IsPlayerInAnyVehicle(playerid))
  1258.                  {
  1259.                   new CurrentState = GetPlayerState(playerid);
  1260.                   if(CurrentState == PLAYER_STATE_PASSENGER)
  1261.                   {
  1262.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1263.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1264.                     new interiorid;
  1265.                     interiorid = GetPlayerInterior(giveplayerid);
  1266.                     SetPlayerInterior(playerid,interiorid);
  1267.                     GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1268.                     SetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1269.                     format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
  1270.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1271.                     return 1;
  1272.                   }
  1273.                   else if(CurrentState == PLAYER_STATE_DRIVER)
  1274.                   {
  1275.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1276.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1277.                     new interiorid;
  1278.                     interiorid = GetPlayerInterior(giveplayerid);
  1279.                     GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1280.                     new VehicleID = GetPlayerVehicleID(playerid);
  1281.                     LinkVehicleToInterior(VehicleID,interiorid);
  1282.                     SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1283.                     SetPlayerInterior(playerid,interiorid);
  1284.                     format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
  1285.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1286.                     return 1;
  1287.                   }
  1288.                  }
  1289.                  else
  1290.                  {
  1291.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1292.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1293.                     new interiorid;
  1294.                     interiorid = GetPlayerInterior(giveplayerid);
  1295.                     SetPlayerInterior(playerid,interiorid);
  1296.                     GetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1297.                     SetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1298.                     format(string, sizeof(string), "You teleported to %s[ID:%d].", giveplayername,giveplayerid);
  1299.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1300.                     return 1;
  1301.                  }
  1302.                }
  1303.             }
  1304.             else
  1305.             {
  1306.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1307.                 return 1;
  1308.             }
  1309.           }
  1310.           else
  1311.           {
  1312.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1313.           }
  1314.         }
  1315.         return 1;
  1316.     }
  1317.     if(strcmp(cmd, "/tphere", true) == 0)
  1318.     {
  1319.         if(IsPlayerConnected(playerid))
  1320.         {
  1321.           if(IsAdmin(playerid))
  1322.           {
  1323.             tmp = strtok(cmdtext, idx);
  1324.             if(!strlen(tmp))
  1325.             {
  1326.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPhere [Playerid/PartOfName]");
  1327.                 return 1;
  1328.             }
  1329.             giveplayerid = ReturnUser(tmp);
  1330.             if(IsPlayerConnected(giveplayerid))
  1331.             {
  1332.                if(giveplayerid != INVALID_PLAYER_ID)
  1333.                {
  1334.                  if(IsPlayerInAnyVehicle(giveplayerid))
  1335.                  {
  1336.                   new CurrentState = GetPlayerState(giveplayerid);
  1337.                   if(CurrentState == PLAYER_STATE_PASSENGER)
  1338.                   {
  1339.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1340.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1341.                     new interiorid;
  1342.                     interiorid = GetPlayerInterior(playerid);
  1343.                     SetPlayerInterior(giveplayerid,interiorid);
  1344.                     GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1345.                     SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1346.                     format(string, sizeof(string), "%s[ID:%d] Teleported to You.", giveplayername,giveplayerid);
  1347.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1348.                     return 1;
  1349.                   }
  1350.                   else if(CurrentState == PLAYER_STATE_DRIVER)
  1351.                   {
  1352.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1353.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1354.                     new interiorid;
  1355.                     interiorid = GetPlayerInterior(playerid);
  1356.                     GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1357.                     new VehicleID = GetPlayerVehicleID(giveplayerid);
  1358.                     LinkVehicleToInterior(VehicleID,interiorid);
  1359.                     SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1360.                     SetPlayerInterior(giveplayerid,interiorid);
  1361.                     format(string, sizeof(string), "%s[ID:%d] Teleported to You with Vehicle.", giveplayername,giveplayerid);
  1362.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1363.                     return 1;
  1364.                   }
  1365.                  }
  1366.                  else
  1367.                  {
  1368.                     GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1369.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1370.                     new interiorid;
  1371.                     interiorid = GetPlayerInterior(playerid);
  1372.                     SetPlayerInterior(giveplayerid,interiorid);
  1373.                     GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1374.                     SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1375.                     format(string, sizeof(string), "%s[ID:%d] Teleported to You.", giveplayername,giveplayerid);
  1376.                     SendClientMessageNoAFK(playerid,COLOR_M, string);
  1377.                     return 1;
  1378.                  }
  1379.                }
  1380.             }
  1381.             else
  1382.             {
  1383.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1384.                 return 1;
  1385.             }
  1386.           }
  1387.           else
  1388.           {
  1389.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1390.           }
  1391.         }
  1392.         return 1;
  1393.     }
  1394.     if(strcmp(cmd, "/tphereall", true) == 0)
  1395.     {
  1396.         if(IsPlayerConnected(playerid))
  1397.         {
  1398.           if(IsAdmin(playerid))
  1399.           {
  1400.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  1401.                     new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1402.                     new interiorid;
  1403.                     interiorid = GetPlayerInterior(playerid);
  1404.                     GetPlayerPos(playerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1405.                     for(new i = 0; i < MAX_PLAYERS; i++)
  1406.                     {
  1407.                        if(IsPlayerConnected(i))
  1408.                        {
  1409.                          if(i != playerid)
  1410.                          {
  1411.                            SetPlayerInterior(i,interiorid);
  1412.                            SetPlayerPos(i, PlayerPosX, PlayerPosY, PlayerPosZ+5);
  1413.                          }
  1414.                        }
  1415.                     }
  1416.                     format(string, sizeof(string), "Admin %s[ID:%d] Tped all Players.",sendername,playerid);
  1417.                     SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1418.                     return 1;
  1419.           }
  1420.           else
  1421.           {
  1422.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1423.           }
  1424.         }
  1425.         return 1;
  1426.     }
  1427.     if(strcmp(cmd, "/tptp", true) == 0)
  1428.     {
  1429.         if(IsPlayerConnected(playerid))
  1430.         {
  1431.           if(IsAdmin(playerid))
  1432.           {
  1433.             tmp = strtok(cmdtext, idx);
  1434.             if(!strlen(tmp))
  1435.             {
  1436.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPtp [Playerid/PartOfName to Teleport] [Playerid/PartOfName Destination]");
  1437.                 return 1;
  1438.             }
  1439.             giveplayerid = ReturnUser(tmp);
  1440.             if(IsPlayerConnected(giveplayerid))
  1441.             {
  1442.                if(giveplayerid != INVALID_PLAYER_ID)
  1443.                {
  1444.                      tmp = strtok(cmdtext, idx);
  1445.                      if(!strlen(tmp))
  1446.                      {
  1447.                      SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /TPtp [Playerid/PartOfName to Teleport] [Playerid/PartOfName Destination]");
  1448.                      return 1;
  1449.                      }
  1450.                      new destinationgiveplayername[256];
  1451.                      new destinationgiveplayerid;
  1452.                      destinationgiveplayerid = ReturnUser(tmp);
  1453.                      if(IsPlayerConnected(destinationgiveplayerid))
  1454.                      {
  1455.                        if(destinationgiveplayerid != INVALID_PLAYER_ID)
  1456.                        {
  1457.                          new Float:PlayerPosX,Float:PlayerPosY,Float:PlayerPosZ;
  1458.                          new interiorid;
  1459.                          GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1460.                          GetPlayerName(destinationgiveplayerid, destinationgiveplayername, sizeof(destinationgiveplayername));
  1461.                          if(IsPlayerInAnyVehicle(giveplayerid))
  1462.                          {
  1463.                            new CurrentState = GetPlayerState(giveplayerid);
  1464.                            if(CurrentState == PLAYER_STATE_PASSENGER)
  1465.                            {
  1466.                              interiorid = GetPlayerInterior(destinationgiveplayerid);
  1467.                              SetPlayerInterior(giveplayerid,interiorid);
  1468.                              GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1469.                              SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1470.                              format(string, sizeof(string), "You teleported %s[ID:%d] to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
  1471.                              SendClientMessageNoAFK(playerid,COLOR_M, string);
  1472.                              return 1;
  1473.                            }
  1474.                            else if(CurrentState == PLAYER_STATE_DRIVER)
  1475.                            {
  1476.                              interiorid = GetPlayerInterior(destinationgiveplayerid);
  1477.                              GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1478.                              new VehicleID = GetPlayerVehicleID(giveplayerid);
  1479.                              LinkVehicleToInterior(VehicleID,interiorid);
  1480.                              SetVehiclePos(VehicleID, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1481.                              SetPlayerInterior(giveplayerid,interiorid);
  1482.                              format(string, sizeof(string), "You teleported %s[ID:%d] with vehicle to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
  1483.                              SendClientMessageNoAFK(playerid,COLOR_M, string);
  1484.                              return 1;
  1485.                            }
  1486.                          }
  1487.                          else
  1488.                          {
  1489.                              interiorid = GetPlayerInterior(destinationgiveplayerid);
  1490.                              SetPlayerInterior(giveplayerid,interiorid);
  1491.                              GetPlayerPos(destinationgiveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ);
  1492.                              SetPlayerPos(giveplayerid, PlayerPosX, PlayerPosY, PlayerPosZ+4);
  1493.                              format(string, sizeof(string), "You teleported %s[ID:%d] to %s[ID:%d].", giveplayername,giveplayerid,destinationgiveplayername,destinationgiveplayerid);
  1494.                              SendClientMessageNoAFK(playerid,COLOR_M, string);
  1495.                              return 1;
  1496.                          }
  1497.                        }
  1498.                      }
  1499.                      else
  1500.                      {
  1501.                         SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !(Player to teleport)");
  1502.                         return 1;
  1503.                      }
  1504.                }
  1505.             }
  1506.             else
  1507.             {
  1508.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !(Player Destination)");
  1509.                 return 1;
  1510.             }
  1511.           }
  1512.           else
  1513.           {
  1514.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1515.           }
  1516.         }
  1517.         return 1;
  1518.     }
  1519. //----------------------------------------[un/Freeze Commands]----------------------------------------|
  1520.     if(strcmp(cmd, "/freeze", true) == 0 || strcmp(cmd, "/f", true) == 0)
  1521.     {
  1522.         if(IsPlayerConnected(playerid))
  1523.         {
  1524.           if(IsAdmin(playerid))
  1525.           {
  1526.             tmp = strtok(cmdtext, idx);
  1527.             if(!strlen(tmp))
  1528.             {
  1529.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Freeze [Playerid/PartOfName]");
  1530.                 return 1;
  1531.             }
  1532.             giveplayerid = ReturnUser(tmp);
  1533.             if(giveplayerid == playerid)
  1534.             {
  1535.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1536.                         SendClientMessageNoAFK(playerid,COLOR_M,"You Froze Yourself.");
  1537.                         format(string, sizeof(string), "Admin %s Froze by himself.",sendername);
  1538.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1539.                         TogglePlayerControllable(playerid, 0);
  1540.                         return 1;
  1541.             }
  1542.             if(IsAdmin(giveplayerid))
  1543.             {
  1544.                 SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Freeze an Admin !");
  1545.                 return 1;
  1546.             }
  1547.             if(IsPlayerConnected(giveplayerid))
  1548.             {
  1549.                     if(giveplayerid != INVALID_PLAYER_ID)
  1550.                     {
  1551.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1552.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1553.                         TogglePlayerControllable(giveplayerid, 0);
  1554.                         format(string, sizeof(string), "You Froze %s[ID:%d].",giveplayername,giveplayerid);
  1555.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  1556.                         format(string, sizeof(string), "You have been Frozen By Admin %s[ID:%d].",sendername,playerid);
  1557.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  1558.                         format(string, sizeof(string), "%s Froze by Admin %s",giveplayername ,sendername);
  1559.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1560.                         return 1;
  1561.                     }
  1562.             }
  1563.             else
  1564.             {
  1565.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1566.                 return 1;
  1567.             }
  1568.           }
  1569.           else
  1570.           {
  1571.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1572.               return 1;
  1573.           }
  1574.         }
  1575.         return 1;
  1576.     }
  1577.     if(strcmp(cmd, "/unfreeze", true) == 0 || strcmp(cmd, "/unf", true) == 0)
  1578.     {
  1579.         if(IsPlayerConnected(playerid))
  1580.         {
  1581.           if(IsAdmin(playerid))
  1582.           {
  1583.             tmp = strtok(cmdtext, idx);
  1584.             if(!strlen(tmp))
  1585.             {
  1586.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Unfreeze [Playerid/PartOfName]");
  1587.                 return 1;
  1588.             }
  1589.             giveplayerid = ReturnUser(tmp);
  1590.             if(giveplayerid == playerid)
  1591.             {
  1592.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1593.                         SendClientMessageNoAFK(playerid,COLOR_M,"You unFroze Yourself.");
  1594.                         format(string, sizeof(string), "Admin %s unFrozen by himself.",sendername);
  1595.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1596.                         TogglePlayerControllable(playerid, 1);
  1597.                         return 1;
  1598.             }
  1599.             if(IsAdmin(giveplayerid))
  1600.             {
  1601.                 SendClientMessageNoAFK(playerid, COLOR_W, "You Can not unFreeze an Admin !");
  1602.                 return 1;
  1603.             }
  1604.             if(IsPlayerConnected(giveplayerid))
  1605.             {
  1606.                     if(giveplayerid != INVALID_PLAYER_ID)
  1607.                     {
  1608.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1609.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1610.                         TogglePlayerControllable(giveplayerid, 1);
  1611.                         format(string, sizeof(string), "You unFroze %s[ID:%d].",giveplayername,giveplayerid);
  1612.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  1613.                         format(string, sizeof(string), "You have been unFrozen By Admin %s[ID:%d].",sendername,playerid);
  1614.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  1615.                         format(string, sizeof(string), "%s unFrozen by Admin %s",giveplayername ,sendername);
  1616.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1617.                         return 1;
  1618.                     }
  1619.             }
  1620.             else
  1621.             {
  1622.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1623.                 return 1;
  1624.             }
  1625.           }
  1626.           else
  1627.           {
  1628.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1629.               return 1;
  1630.           }
  1631.         }
  1632.         return 1;
  1633.     }
  1634.     if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fa", true) == 0)
  1635.     {
  1636.         if(IsPlayerConnected(playerid))
  1637.         {
  1638.           if(IsAdmin(playerid))
  1639.           {
  1640.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1641.                         for(new i = 0; i < MAX_PLAYERS; i++)
  1642.                         {
  1643.                           if(IsPlayerConnected(i))
  1644.                           {
  1645.                                TogglePlayerControllable(i, 0);
  1646.                           }
  1647.                         }
  1648.                         format(string, sizeof(string), "Admin %s[ID:%d] Froze all Players.",sendername,playerid);
  1649.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1650.                         return 1;
  1651.           }
  1652.           else
  1653.           {
  1654.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1655.               return 1;
  1656.           }
  1657.         }
  1658.         return 1;
  1659.     }
  1660.     if(strcmp(cmd, "/unfreezeall", true) == 0 || strcmp(cmd, "/unfa", true) == 0)
  1661.     {
  1662.         if(IsPlayerConnected(playerid))
  1663.         {
  1664.           if(IsAdmin(playerid))
  1665.           {
  1666.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1667.                         for(new i = 0; i < MAX_PLAYERS; i++)
  1668.                         {
  1669.                           if(IsPlayerConnected(i))
  1670.                           {
  1671.                                TogglePlayerControllable(i, 1);
  1672.                           }
  1673.                         }
  1674.                         format(string, sizeof(string), "Admin %s[ID:%d] unFroze all Players.",sendername,playerid);
  1675.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1676.                         return 1;
  1677.           }
  1678.           else
  1679.           {
  1680.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1681.               return 1;
  1682.           }
  1683.         }
  1684.         return 1;
  1685.     }
  1686. //----------------------------------------[Fix Vehicle Command]----------------------------------------|
  1687.     if(strcmp(cmd, "/fixvehicle", true) == 0 || strcmp(cmd, "/fixveh", true) == 0)
  1688.     {
  1689.         if(IsPlayerConnected(playerid))
  1690.         {
  1691.           if(IsAdmin(playerid))
  1692.           {
  1693.             tmp = strtok(cmdtext, idx);
  1694.             if(!strlen(tmp))
  1695.             {
  1696.               if(IsPlayerInAnyVehicle(playerid))
  1697.               {
  1698.                 giveplayerid = ReturnUser(tmp);
  1699.                 new VehicleID = GetPlayerVehicleID(giveplayerid);
  1700.                 SetVehicleHealth(VehicleID,1000);
  1701.                 SendClientMessageNoAFK(playerid,COLOR_M,"Vehicle fixed.");
  1702.                 return 1;
  1703.               }
  1704.               else
  1705.               {
  1706.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not in a Vehicle !");
  1707.                 return 1;
  1708.               }
  1709.             }
  1710.             giveplayerid = ReturnUser(tmp);
  1711.             if(IsPlayerConnected(giveplayerid))
  1712.             {
  1713.               if(giveplayerid != INVALID_PLAYER_ID)
  1714.               {
  1715.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1716.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1717.                 format(string, sizeof(string), "You fixed %s[ID:%d] Vehicle.",giveplayername,giveplayerid);
  1718.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  1719.                 format(string, sizeof(string), "Your Vehicle fixed By Admin %s[ID:%d].",sendername,playerid);
  1720.                 SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  1721.                 return 1;
  1722.               }
  1723.             }
  1724.             else
  1725.             {
  1726.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1727.                 return 1;
  1728.             }
  1729.           }
  1730.           else
  1731.           {
  1732.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1733.               return 1;
  1734.           }
  1735.         }
  1736.         return 1;
  1737.     }
  1738. //----------------------------------------[Set HP/Armor Commands]----------------------------------------|
  1739.     if(strcmp(cmd, "/sethp", true) == 0)
  1740.     {
  1741.         if(IsPlayerConnected(playerid))
  1742.         {
  1743.           if(IsAdmin(playerid))
  1744.           {
  1745.             tmp = strtok(cmdtext, idx);
  1746.             if(!strlen(tmp))
  1747.             {
  1748.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Sethp [Playerid/PartOfName] [Health]");
  1749.                 return 1;
  1750.             }
  1751.             giveplayerid = ReturnUser(tmp);
  1752.             if(IsPlayerConnected(giveplayerid))
  1753.             {
  1754.               if(giveplayerid != INVALID_PLAYER_ID)
  1755.               {
  1756.                 tmp = strtok(cmdtext, idx);
  1757.                 if(!strlen(tmp))
  1758.                 {
  1759.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Sethp [Playerid/PartOfName] [Health]");
  1760.                   return 1;
  1761.                 }
  1762.                 new hp;
  1763.                 hp = strval(tmp);
  1764.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1765.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1766.                 format(string, sizeof(string), "You changed %s[ID:%d] Health to %d.",giveplayername,giveplayerid,hp);
  1767.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  1768.                 SetPlayerHealth(giveplayerid,hp);
  1769.                 return 1;
  1770.               }
  1771.             }
  1772.             else
  1773.             {
  1774.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1775.                 return 1;
  1776.             }
  1777.           }
  1778.           else
  1779.           {
  1780.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1781.               return 1;
  1782.           }
  1783.         }
  1784.         return 1;
  1785.     }
  1786.     if(strcmp(cmd, "/setarmor", true) == 0)
  1787.     {
  1788.         if(IsPlayerConnected(playerid))
  1789.         {
  1790.           if(IsAdmin(playerid))
  1791.           {
  1792.             tmp = strtok(cmdtext, idx);
  1793.             if(!strlen(tmp))
  1794.             {
  1795.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setarmor [Playerid/PartOfName] [Armor]");
  1796.                 return 1;
  1797.             }
  1798.             giveplayerid = ReturnUser(tmp);
  1799.             if(IsPlayerConnected(giveplayerid))
  1800.             {
  1801.               if(giveplayerid != INVALID_PLAYER_ID)
  1802.               {
  1803.                 tmp = strtok(cmdtext, idx);
  1804.                 if(!strlen(tmp))
  1805.                 {
  1806.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setarmor [Playerid/PartOfName] [Armor]");
  1807.                   return 1;
  1808.                 }
  1809.                 new armor;
  1810.                 armor = strval(tmp);
  1811.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1812.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1813.                 format(string, sizeof(string), "You changed %s[ID:%d] Armour to %d.",giveplayername,giveplayerid,armor);
  1814.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  1815.                 SetPlayerArmour(giveplayerid,armor);
  1816.                 return 1;
  1817.               }
  1818.             }
  1819.             else
  1820.             {
  1821.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1822.                 return 1;
  1823.             }
  1824.           }
  1825.           else
  1826.           {
  1827.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1828.               return 1;
  1829.           }
  1830.         }
  1831.         return 1;
  1832.     }
  1833. //----------------------------------------[Set HP/Armor All Commands]----------------------------------------|
  1834.     if(strcmp(cmd, "/hp", true) == 0)
  1835.     {
  1836.         if(IsPlayerConnected(playerid))
  1837.         {
  1838.           if(IsAdmin(playerid))
  1839.           {
  1840.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1841.                 for(new i = 0; i < MAX_PLAYERS; i++)
  1842.                 {
  1843.                   if(IsPlayerConnected(i))
  1844.                   {
  1845.                      SetPlayerHealth(i, 100);
  1846.                   }
  1847.                 }
  1848.                 format(string, sizeof(string), "Admin %s[ID:%d] Raised all Players Health.",sendername,playerid);
  1849.                 SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1850.                 return 1;
  1851.           }
  1852.           else
  1853.           {
  1854.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1855.               return 1;
  1856.           }
  1857.         }
  1858.         return 1;
  1859.     }
  1860.     if(strcmp(cmd, "/armor", true) == 0)
  1861.     {
  1862.         if(IsPlayerConnected(playerid))
  1863.         {
  1864.           if(IsAdmin(playerid))
  1865.           {
  1866.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1867.                 format(string, sizeof(string), "Admin %s[ID:%d] Raised all Players Armour.",sendername,playerid);
  1868.                 SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  1869.                 for(new i = 0; i < MAX_PLAYERS; i++)
  1870.                 {
  1871.                   if(IsPlayerConnected(i))
  1872.                   {
  1873.                      SetPlayerArmour(i, 100);
  1874.                   }
  1875.                 }
  1876.                 return 1;
  1877.           }
  1878.           else
  1879.           {
  1880.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1881.               return 1;
  1882.           }
  1883.         }
  1884.         return 1;
  1885.     }
  1886. //----------------------------------------[Set Skin Command]----------------------------------------|
  1887.     if(strcmp(cmd, "/setskin", true) == 0)
  1888.     {
  1889.         if(IsPlayerConnected(playerid))
  1890.         {
  1891.           if(IsAdmin(playerid))
  1892.           {
  1893.             tmp = strtok(cmdtext, idx);
  1894.             if(!strlen(tmp))
  1895.             {
  1896.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setskin [Playerid/PartOfName] [Skin ID]");
  1897.                 return 1;
  1898.             }
  1899.             giveplayerid = ReturnUser(tmp);
  1900.             if(IsPlayerConnected(giveplayerid))
  1901.             {
  1902.               if(giveplayerid != INVALID_PLAYER_ID)
  1903.               {
  1904.                 tmp = strtok(cmdtext, idx);
  1905.                 if(!strlen(tmp))
  1906.                 {
  1907.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setskin [Playerid/PartOfName] [Skin ID]");
  1908.                   return 1;
  1909.                 }
  1910.                 new skin;
  1911.                 skin = strval(tmp);
  1912.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1913.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1914.                 format(string, sizeof(string), "You changed %s[ID:%d] Skin to %d.",giveplayername,giveplayerid,skin);
  1915.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  1916.                 format(string, sizeof(string), "Your Skin changed to %d By Admin %s[ID:%d]",skin,sendername,playerid);
  1917.                 SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  1918.                 SetPlayerSkin(giveplayerid,skin);
  1919.                 return 1;
  1920.               }
  1921.             }
  1922.             else
  1923.             {
  1924.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1925.                 return 1;
  1926.             }
  1927.           }
  1928.           else
  1929.           {
  1930.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1931.               return 1;
  1932.           }
  1933.         }
  1934.         return 1;
  1935.     }
  1936. //----------------------------------------[Money Commands]----------------------------------------|
  1937.     if(strcmp(cmd, "/setmoney", true) == 0)
  1938.     {
  1939.         if(IsPlayerConnected(playerid))
  1940.         {
  1941.           if(IsAdmin(playerid))
  1942.           {
  1943.             tmp = strtok(cmdtext, idx);
  1944.             if(!strlen(tmp))
  1945.             {
  1946.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setmoney [Playerid/PartOfName] [Amount]");
  1947.                 return 1;
  1948.             }
  1949.             giveplayerid = ReturnUser(tmp);
  1950.             if(IsPlayerConnected(giveplayerid))
  1951.             {
  1952.               if(giveplayerid != INVALID_PLAYER_ID)
  1953.               {
  1954.                 tmp = strtok(cmdtext, idx);
  1955.                 if(!strlen(tmp))
  1956.                 {
  1957.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Setmoney [Playerid/PartOfName] [Amount]");
  1958.                   return 1;
  1959.                 }
  1960.                 new money;
  1961.                 money = strval(tmp);
  1962.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1963.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1964.                 format(string, sizeof(string), "You Set %s[ID:%d] Money to $%d.",giveplayername,giveplayerid,money);
  1965.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  1966.                 format(string, sizeof(string), "Your Money set to $%d By Admin %s[ID:%d]",money,sendername,playerid);
  1967.                 SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  1968.                 ResetPlayerMoney(giveplayerid);
  1969.                 GivePlayerMoney(giveplayerid, money);
  1970.                 return 1;
  1971.               }
  1972.             }
  1973.             else
  1974.             {
  1975.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  1976.                 return 1;
  1977.             }
  1978.           }
  1979.           else
  1980.           {
  1981.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  1982.               return 1;
  1983.           }
  1984.         }
  1985.         return 1;
  1986.     }
  1987.     if(strcmp(cmd, "/givemoney", true) == 0)
  1988.     {
  1989.         if(IsPlayerConnected(playerid))
  1990.         {
  1991.           if(IsAdmin(playerid))
  1992.           {
  1993.             tmp = strtok(cmdtext, idx);
  1994.             if(!strlen(tmp))
  1995.             {
  1996.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Givemoney [Playerid/PartOfName] [Amount]");
  1997.                 return 1;
  1998.             }
  1999.             giveplayerid = ReturnUser(tmp);
  2000.             if(IsPlayerConnected(giveplayerid))
  2001.             {
  2002.               if(giveplayerid != INVALID_PLAYER_ID)
  2003.               {
  2004.                 tmp = strtok(cmdtext, idx);
  2005.                 if(!strlen(tmp))
  2006.                 {
  2007.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Givemoney [Playerid/PartOfName] [Amount]");
  2008.                   return 1;
  2009.                 }
  2010.                 new money;
  2011.                 money = strval(tmp);
  2012.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2013.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  2014.                 format(string, sizeof(string), "You Added $%d to %s[ID:%d].",money,giveplayername,giveplayerid);
  2015.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  2016.                 format(string, sizeof(string), "You Got from Admin %s[ID:%d] $%d.",sendername,playerid,money);
  2017.                 SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  2018.                 GivePlayerMoney(giveplayerid,money);
  2019.                 return 1;
  2020.               }
  2021.             }
  2022.             else
  2023.             {
  2024.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2025.                 return 1;
  2026.             }
  2027.           }
  2028.           else
  2029.           {
  2030.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2031.               return 1;
  2032.           }
  2033.         }
  2034.         return 1;
  2035.     }
  2036.     if(strcmp(cmd, "/takemoney", true) == 0)
  2037.     {
  2038.         if(IsPlayerConnected(playerid))
  2039.         {
  2040.           if(IsAdmin(playerid))
  2041.           {
  2042.             tmp = strtok(cmdtext, idx);
  2043.             if(!strlen(tmp))
  2044.             {
  2045.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Takemoney [Playerid/PartOfName] [Amount]");
  2046.                 return 1;
  2047.             }
  2048.             giveplayerid = ReturnUser(tmp);
  2049.             if(IsPlayerConnected(giveplayerid))
  2050.             {
  2051.               if(giveplayerid != INVALID_PLAYER_ID)
  2052.               {
  2053.                 tmp = strtok(cmdtext, idx);
  2054.                 if(!strlen(tmp))
  2055.                 {
  2056.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Takemoney [Playerid/PartOfName] [Amount]");
  2057.                   return 1;
  2058.                 }
  2059.                 new money;
  2060.                 money = strval(tmp);
  2061.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2062.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  2063.                 format(string, sizeof(string), "You Took $%d from %s[ID:%d].",money,giveplayername,giveplayerid);
  2064.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  2065.                 format(string, sizeof(string), "$%d Took By Admin %s[ID:%d].",sendername,playerid,money);
  2066.                 SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  2067.                 GivePlayerMoney(giveplayerid,-money);
  2068.                 return 1;
  2069.               }
  2070.             }
  2071.             else
  2072.             {
  2073.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2074.                 return 1;
  2075.             }
  2076.           }
  2077.           else
  2078.           {
  2079.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2080.               return 1;
  2081.           }
  2082.         }
  2083.         return 1;
  2084.     }
  2085.     if(strcmp(cmd, "/checkmoney", true) == 0)
  2086.     {
  2087.         if(IsPlayerConnected(playerid))
  2088.         {
  2089.           if(IsAdmin(playerid))
  2090.           {
  2091.             tmp = strtok(cmdtext, idx);
  2092.             if(!strlen(tmp))
  2093.             {
  2094.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Checkmoney [Playerid/PartOfName]");
  2095.                 return 1;
  2096.             }
  2097.             giveplayerid = ReturnUser(tmp);
  2098.             if(IsPlayerConnected(giveplayerid))
  2099.             {
  2100.               if(giveplayerid != INVALID_PLAYER_ID)
  2101.               {
  2102.                 new money;
  2103.                 money = GetPlayerMoney(giveplayerid);
  2104.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2105.                 format(string, sizeof(string), "$%d - %s[ID:%d].",money,giveplayername,giveplayerid);
  2106.                 SendClientMessageNoAFK(playerid,COLOR_M,string);
  2107.                 return 1;
  2108.               }
  2109.             }
  2110.             else
  2111.             {
  2112.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2113.                 return 1;
  2114.             }
  2115.           }
  2116.           else
  2117.           {
  2118.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2119.               return 1;
  2120.           }
  2121.         }
  2122.         return 1;
  2123.     }
  2124. //----------------------------------------[un/Mute Commands]----------------------------------------|
  2125.     if(strcmp(cmd, "/mute", true) == 0)
  2126.     {
  2127.         if(IsPlayerConnected(playerid))
  2128.         {
  2129.           if(IsAdmin(playerid))
  2130.           {
  2131.             tmp = strtok(cmdtext, idx);
  2132.             if(!strlen(tmp))
  2133.             {
  2134.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Mute [Playerid/PartOfName]");
  2135.                 return 1;
  2136.             }
  2137.             giveplayerid = ReturnUser(tmp);
  2138.             if(IsAdmin(giveplayerid))
  2139.             {
  2140.                 SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Mute an Admin !");
  2141.                 return 1;
  2142.             }
  2143.             if(IsPlayerConnected(giveplayerid))
  2144.             {
  2145.                     if(giveplayerid != INVALID_PLAYER_ID)
  2146.                     {
  2147.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2148.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2149.                         AdminModePlayerInfo[giveplayerid][Mute] = 1;
  2150.                         format(string, sizeof(string), "You Muted %s[ID:%d].",giveplayername,giveplayerid);
  2151.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  2152.                         format(string, sizeof(string), "You have been Muted By Admin %s[ID:%d].",sendername,playerid);
  2153.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  2154.                         format(string, sizeof(string), "%s Muted by Admin %s",giveplayername ,sendername);
  2155.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  2156.                         return 1;
  2157.                     }
  2158.             }
  2159.             else
  2160.             {
  2161.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2162.                 return 1;
  2163.             }
  2164.           }
  2165.           else
  2166.           {
  2167.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2168.               return 1;
  2169.           }
  2170.         }
  2171.         return 1;
  2172.     }
  2173.     if(strcmp(cmd, "/unmute", true) == 0)
  2174.     {
  2175.         if(IsPlayerConnected(playerid))
  2176.         {
  2177.           if(IsAdmin(playerid))
  2178.           {
  2179.             tmp = strtok(cmdtext, idx);
  2180.             if(!strlen(tmp))
  2181.             {
  2182.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unMute [Playerid/PartOfName]");
  2183.                 return 1;
  2184.             }
  2185.             giveplayerid = ReturnUser(tmp);
  2186.             if(IsPlayerConnected(giveplayerid))
  2187.             {
  2188.                     if(giveplayerid != INVALID_PLAYER_ID)
  2189.                     {
  2190.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2191.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2192.                         AdminModePlayerInfo[giveplayerid][Mute] = 0;
  2193.                         format(string, sizeof(string), "You unMuted %s[ID:%d].",giveplayername,giveplayerid);
  2194.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  2195.                         format(string, sizeof(string), "You have been unMuted By Admin %s[ID:%d].",sendername,playerid);
  2196.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  2197.                         format(string, sizeof(string), "%s unMuted by Admin %s",giveplayername ,sendername);
  2198.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  2199.                         return 1;
  2200.                     }
  2201.             }
  2202.             else
  2203.             {
  2204.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2205.                 return 1;
  2206.             }
  2207.           }
  2208.           else
  2209.           {
  2210.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2211.               return 1;
  2212.           }
  2213.         }
  2214.         return 1;
  2215.     }
  2216. //----------------------------------------[ClearChat Command]----------------------------------------|
  2217.     if(strcmp(cmd, "/clearchat", true) == 0 || strcmp(cmd, "/cc", true) == 0)
  2218.     {
  2219.         if(IsPlayerConnected(playerid))
  2220.         {
  2221.             if(IsAdmin(playerid))
  2222.             {
  2223.               GetPlayerName(playerid, sendername, sizeof(sendername));
  2224.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2225.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2226.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2227.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2228.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2229.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2230.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2231.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2232.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2233.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2234.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2235.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2236.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2237.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2238.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2239.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2240.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2241.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2242.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2243.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2244.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2245.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2246.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2247.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2248.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2249.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2250.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2251.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2252.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2253.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2254.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2255.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2256.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2257.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2258.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2259.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2260.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2261.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2262.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2263.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2264.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2265.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2266.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2267.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2268.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2269.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2270.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2271.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2272.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, " ");
  2273.               format(string, sizeof(string), "Chat Cleared by Admin %s[ID:%d]", sendername, playerid);
  2274.               SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2275.               return 1;
  2276.             }
  2277.             else
  2278.             {
  2279.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2280.                 return 1;
  2281.             }
  2282.         }
  2283.         return 1;
  2284.     }
  2285. //----------------------------------------[Kick/Ban Commands]----------------------------------------|
  2286.     if(strcmp(cmd, "/kick", true) == 0)
  2287.     {
  2288.         if(IsPlayerConnected(playerid))
  2289.         {
  2290.             if(IsAdmin(playerid))
  2291.             {
  2292.                 tmp = strtok(cmdtext, idx);
  2293.                 if(!strlen(tmp))
  2294.                 {
  2295.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kick [Playerid/PartOfName] [Reason]");
  2296.                   return 1;
  2297.                 }
  2298.                 giveplayerid = ReturnUser(tmp);
  2299.                 if(IsPlayerConnected(giveplayerid))
  2300.                 {
  2301.                     if(giveplayerid != INVALID_PLAYER_ID)
  2302.                     {
  2303.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2304.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2305.                         new length = strlen(cmdtext);
  2306.                         while ((idx < length) && (cmdtext[idx] <= ' '))
  2307.                         {
  2308.                             idx++;
  2309.                         }
  2310.                         new offset = idx;
  2311.                         new result[64];
  2312.                         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2313.                         {
  2314.                             result[idx - offset] = cmdtext[idx];
  2315.                             idx++;
  2316.                         }
  2317.                         result[idx - offset] = EOS;
  2318.                         if(!strlen(result))
  2319.                         {
  2320.                             SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kick [Playerid/PartOfName] [Reason]");
  2321.                             return 1;
  2322.                         }
  2323.                         new Year, Month, Day, Hours, Minutes, Seconds;
  2324.                         gettime(Hours, Minutes,Seconds);
  2325.                         getdate(Year, Month, Day);
  2326.                         format(string, sizeof(string), "You kicked By Admin %s[ID:%d], reason: %s", sendername, playerid, (result));
  2327.                         SendClientMessageNoAFK(giveplayerid,COLOR_M, string);
  2328.                         Kick(giveplayerid);
  2329.                         format(string, sizeof(string), "%s kicked By Admin %s[ID:%d], reason: %s", giveplayername, sendername, playerid, (result));
  2330.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2331.                         format(string, sizeof(string), "%s Kicked By Admin %s, reason: %s Date:(%d/%d/%d) Time:(%d:%d:%d)", giveplayername, sendername, (result), Day, Month, Year, Hours, Minutes, Seconds);
  2332.                         KickLog(string);
  2333.                         return 1;
  2334.                     }
  2335.                 }
  2336.                 else
  2337.                 {
  2338.                    SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2339.                    return 1;
  2340.                 }
  2341.             }
  2342.             else
  2343.             {
  2344.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2345.                 return 1;
  2346.             }
  2347.         }
  2348.         return 1;
  2349.     }
  2350.     if(strcmp(cmd, "/kickall", true) == 0)
  2351.     {
  2352.         if(IsPlayerConnected(playerid))
  2353.         {
  2354.             if(IsAdmin(playerid))
  2355.             {
  2356.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2357.                         new length = strlen(cmdtext);
  2358.                         while ((idx < length) && (cmdtext[idx] <= ' '))
  2359.                         {
  2360.                             idx++;
  2361.                         }
  2362.                         new offset = idx;
  2363.                         new result[64];
  2364.                         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2365.                         {
  2366.                             result[idx - offset] = cmdtext[idx];
  2367.                             idx++;
  2368.                         }
  2369.                         result[idx - offset] = EOS;
  2370.                         if(!strlen(result))
  2371.                         {
  2372.                             SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kickall [Reason]");
  2373.                             return 1;
  2374.                         }
  2375.                         format(string, sizeof(string), "Admin %s[ID:%d] Kicked all Players, reason: %s",sendername, playerid, (result));
  2376.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2377.                         for(new i = 0; i < MAX_PLAYERS; i++)
  2378.                         {
  2379.                               if(IsPlayerConnected(i))
  2380.                               {
  2381.                                 if(!IsAdmin(playerid))
  2382.                                 {
  2383.                                   Kick(i);
  2384.                                 }
  2385.                               }
  2386.                         }
  2387.                         new Year, Month, Day, Hours, Minutes, Seconds;
  2388.                         gettime(Hours, Minutes, Seconds);
  2389.                         getdate(Year, Month, Day);
  2390.                         format(string, sizeof(string), "Admin %s Kicked All Players, reason: %s Date:(%d/%d/%d) Time:(%d:%d)", sendername, (result),Year, Month, Day, Hours, Minutes);
  2391.                         KickLog(string);
  2392.                         return 1;
  2393.             }
  2394.             else
  2395.             {
  2396.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2397.                 return 1;
  2398.             }
  2399.         }
  2400.         return 1;
  2401.     }
  2402.     if(strcmp(cmd, "/ban", true) == 0)
  2403.     {
  2404.         if(IsPlayerConnected(playerid))
  2405.         {
  2406.             if(IsAdmin(playerid))
  2407.             {
  2408.                 tmp = strtok(cmdtext, idx);
  2409.                 if(!strlen(tmp))
  2410.                 {
  2411.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Ban [Playerid/PartOfName] [Reason]");
  2412.                   return 1;
  2413.                 }
  2414.                 giveplayerid = ReturnUser(tmp);
  2415.                 if(IsPlayerConnected(giveplayerid))
  2416.                 {
  2417.                     if(giveplayerid != INVALID_PLAYER_ID)
  2418.                     {
  2419.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2420.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2421.                         new length = strlen(cmdtext);
  2422.                         while ((idx < length) && (cmdtext[idx] <= ' '))
  2423.                         {
  2424.                             idx++;
  2425.                         }
  2426.                         new offset = idx;
  2427.                         new result[64];
  2428.                         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2429.                         {
  2430.                             result[idx - offset] = cmdtext[idx];
  2431.                             idx++;
  2432.                         }
  2433.                         result[idx - offset] = EOS;
  2434.                         if(!strlen(result))
  2435.                         {
  2436.                             SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Ban [Playerid/PartOfName] [Reason]");
  2437.                             return 1;
  2438.                         }
  2439.                         new IP[16];
  2440.                         GetPlayerIp(giveplayerid, IP, sizeof(IP));
  2441.                         format(string, sizeof(string), "You Banned By Admin %s[ID:%d], reason: %s", sendername,playerid, (result));
  2442.                         SendClientMessageNoAFK(giveplayerid,COLOR_M, string);
  2443.                         BanEx(giveplayerid,(result));
  2444.                         format(string, sizeof(string), "%s Banned By Admin %s[ID:%d], reason: %s", giveplayername, sendername, playerid, (result));
  2445.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2446.                         new Year, Month, Day, Hours, Minutes, Seconds;
  2447.                         getdate(Year, Month, Day);
  2448.                         gettime(Hours, Minutes, Seconds);
  2449.                         format(string, sizeof(string), "%s Banned By Admin %s, reason: %s Date:(%d/%d/%d) Time:(%d:%d) IP:(%s)", giveplayername, sendername, (result), Day, Month, Year, Hours, Minutes, IP);
  2450.                         BanLog(string);
  2451.                         return 1;
  2452.                     }
  2453.                 }
  2454.                 else
  2455.                 {
  2456.                    SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2457.                    return 1;
  2458.                 }
  2459.             }
  2460.             else
  2461.             {
  2462.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2463.                 return 1;
  2464.             }
  2465.         }
  2466.         return 1;
  2467.     }
  2468.     if(strcmp(cmd, "/unban", true) == 0)
  2469.     {
  2470.         if(IsPlayerConnected(playerid))
  2471.         {
  2472.           if(IsAdmin(playerid))
  2473.           {
  2474.             new length = strlen(cmdtext);
  2475.             while ((idx < length) && (cmdtext[idx] <= ' '))
  2476.             {
  2477.                     idx++;
  2478.             }
  2479.             new offset = idx;
  2480.             new result[64];
  2481.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2482.             {
  2483.                     result[idx - offset] = cmdtext[idx];
  2484.                     idx++;
  2485.             }
  2486.             result[idx - offset] = EOS;
  2487.             if(!strlen(result))
  2488.             {
  2489.                     SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unBan [IP Adress]");
  2490.                     return 1;
  2491.             }
  2492.             format(string,sizeof(string),"unbanip %s",(result));
  2493.             SendRconCommand(string);
  2494.             format(string, sizeof(string), "|%s| IP unBanned.",(result));
  2495.             SendClientMessage(playerid,COLOR_M,string);
  2496.             return 1;
  2497.           }
  2498.           else
  2499.           {
  2500.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2501.             return 1;
  2502.           }
  2503.         }
  2504.         return 1;
  2505.     }
  2506. //----------------------------------------[Kill Command]----------------------------------------|
  2507.     if(strcmp(cmd, "/kill", true) == 0)
  2508.     {
  2509.         if(IsPlayerConnected(playerid))
  2510.         {
  2511.             if(IsAdmin(playerid))
  2512.             {
  2513.                 tmp = strtok(cmdtext, idx);
  2514.                 if(!strlen(tmp))
  2515.                 {
  2516.                     SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Kill [Playerid/PartOfName]");
  2517.                     return 1;
  2518.                 }
  2519.                 giveplayerid = ReturnUser(tmp);
  2520.                 if(IsPlayerConnected(giveplayerid))
  2521.                 {
  2522.                     if(giveplayerid != INVALID_PLAYER_ID)
  2523.                     {
  2524.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2525.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  2526.                         format(string, sizeof(string), "%s Killed By Admin %s[ID:%d]", giveplayername, sendername, playerid);
  2527.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2528.                         SetPlayerHealth(giveplayerid,0);
  2529.                         return 1;
  2530.                     }
  2531.                 }
  2532.                 else
  2533.                 {
  2534.                    SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2535.                    return 1;
  2536.                 }
  2537.             }
  2538.             else
  2539.             {
  2540.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2541.                 return 1;
  2542.             }
  2543.         }
  2544.         return 1;
  2545.     }
  2546. //----------------------------------------[un/Spec Command]----------------------------------------|
  2547.     if(strcmp(cmd, "/spec", true) == 0)
  2548.     {
  2549.         if(IsPlayerConnected(playerid))
  2550.         {
  2551.             if(IsAdmin(playerid))
  2552.             {
  2553.                 tmp = strtok(cmdtext, idx);
  2554.                 if(!strlen(tmp))
  2555.                 {
  2556.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Spec [Playerid/PartOfName]");
  2557.                  return 1;
  2558.                 }
  2559.                 giveplayerid = ReturnUser(tmp);
  2560.                 if(IsPlayerConnected(giveplayerid))
  2561.                 {
  2562.                     if(giveplayerid != INVALID_PLAYER_ID)
  2563.                     {
  2564.                       if(IsPlayerInAnyVehicle(giveplayerid))
  2565.                       {
  2566.                         new Specvehicleid = GetPlayerVehicleID(giveplayerid);
  2567.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2568.                         format(string, sizeof(string), "Spectating %s[ID:%d](In Vehicle).", giveplayername, giveplayerid);
  2569.                         SendClientMessageNoAFK(playerid,COLOR_M, string);
  2570.                         TogglePlayerSpectating(playerid, 1);
  2571.                         PlayerSpectateVehicle(playerid, Specvehicleid);
  2572.                         AdminModePlayerInfo[playerid][Spector] = 1;
  2573.                         return 1;
  2574.                       }
  2575.                       else
  2576.                       {
  2577.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  2578.                         format(string, sizeof(string), "Spectating %s[ID:%d].", giveplayername, giveplayerid);
  2579.                         SendClientMessageNoAFK(playerid,COLOR_M, string);
  2580.                         TogglePlayerSpectating(playerid, 1);
  2581.                         PlayerSpectatePlayer(playerid, giveplayerid);
  2582.                         AdminModePlayerInfo[playerid][Spector] = 1;
  2583.                         return 1;
  2584.                       }
  2585.                     }
  2586.                 }
  2587.                 else
  2588.                 {
  2589.                    SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  2590.                    return 1;
  2591.                 }
  2592.             }
  2593.             else
  2594.             {
  2595.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2596.                 return 1;
  2597.             }
  2598.         }
  2599.         return 1;
  2600.     }
  2601.     if(strcmp(cmd, "/unspec", true) == 0)
  2602.     {
  2603.         if(IsPlayerConnected(playerid))
  2604.         {
  2605.             if(IsAdmin(playerid))
  2606.             {
  2607.                 if(AdminModePlayerInfo[playerid][Spector] == 1)
  2608.                 {
  2609.                         SendClientMessageNoAFK(playerid,COLOR_M, "unSpectated.");
  2610.                         TogglePlayerSpectating(playerid, 0);
  2611.                         AdminModePlayerInfo[playerid][Spector] = 0;
  2612.                         return 1;
  2613.                 }
  2614.                 else
  2615.                 {
  2616.                    SendClientMessageNoAFK(playerid, COLOR_W, "You Are not Spectating Someone!");
  2617.                    return 1;
  2618.                 }
  2619.             }
  2620.             else
  2621.             {
  2622.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2623.                 return 1;
  2624.             }
  2625.         }
  2626.         return 1;
  2627.     }
  2628. //----------------------------------------[Admin Message Commands]----------------------------------------|
  2629.     if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
  2630.     {
  2631.         if(IsPlayerConnected(playerid))
  2632.         {
  2633.             if(IsAdmin(playerid))
  2634.             {
  2635.                 new length = strlen(cmdtext);
  2636.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  2637.                 {
  2638.                     idx++;
  2639.                 }
  2640.                 new offset = idx;
  2641.                 new result[64];
  2642.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2643.                 {
  2644.                     result[idx - offset] = cmdtext[idx];
  2645.                     idx++;
  2646.                 }
  2647.                 result[idx - offset] = EOS;
  2648.                 if(!strlen(result))
  2649.                 {
  2650.                    SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Admin [Text]");
  2651.                    return 1;
  2652.                 }
  2653.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  2654.                 format(string, sizeof(string), "~w~%s: ~b~%s", sendername, result);
  2655.                 GameTextForAllNoAFK(string, 5000, 6);
  2656.                 return 1;
  2657.             }
  2658.             else
  2659.             {
  2660.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2661.                 return 1;
  2662.             }
  2663.         }
  2664.         return 1;
  2665.     }
  2666.     if(strcmp(cmd, "/adminchat", true) == 0 || strcmp(cmd, "/ac", true) == 0)
  2667.     {
  2668.         if(IsPlayerConnected(playerid))
  2669.         {
  2670.             if(IsAdmin(playerid))
  2671.             {
  2672.                 new length = strlen(cmdtext);
  2673.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  2674.                 {
  2675.                     idx++;
  2676.                 }
  2677.                 new offset = idx;
  2678.                 new result[64];
  2679.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2680.                 {
  2681.                     result[idx - offset] = cmdtext[idx];
  2682.                     idx++;
  2683.                 }
  2684.                 result[idx - offset] = EOS;
  2685.                 if(!strlen(result))
  2686.                 {
  2687.                    SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /AdminChat [Text]");
  2688.                    return 1;
  2689.                 }
  2690.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  2691.                 format(string, sizeof(string), "Admin %s[ID:%d]: %s", sendername, playerid, result);
  2692.                 SendAdminMessage(COLOR_CHATADMIN, string);
  2693.                 return 1;
  2694.             }
  2695.             else
  2696.             {
  2697.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2698.                 return 1;
  2699.             }
  2700.         }
  2701.         return 1;
  2702.     }
  2703. //----------------------------------------[Admin Restart Command]----------------------------------------|
  2704.     if(strcmp(cmd, "/restart", true) == 0)
  2705.     {
  2706.         if(IsPlayerConnected(playerid))
  2707.         {
  2708.             if(IsAdmin(playerid))
  2709.             {
  2710.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  2711.                 format(string, sizeof(string), "Admin %s is Restarting the Mode.", sendername);
  2712.                 SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  2713.                 GameModeExit();
  2714.                 return 1;
  2715.             }
  2716.             else
  2717.             {
  2718.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2719.                 return 1;
  2720.             }
  2721.         }
  2722.         return 1;
  2723.     }
  2724. //----------------------------------------[AFK Command]----------------------------------------|
  2725.     if(strcmp(cmd, "/afk", true) == 0)
  2726.     {
  2727.         if(IsPlayerConnected(playerid))
  2728.         {
  2729.             if(AdminModePlayerInfo[playerid][AFK] == 0)
  2730.             {
  2731.                 new AFKname[256];
  2732.                 GetPlayerName(playerid, AFKname, sizeof(AFKname));
  2733.                 format(string, sizeof(string), "%s is now in AFK Mode.", AFKname);
  2734.                 SendClientMessageToAllNoAFK(COLOR_AFK, string);
  2735.                 AdminModePlayerInfo[playerid][AFK] = 1;
  2736.                 format(string, sizeof(string), "[AFK]%s", AFKname);
  2737.                 SetPlayerName(playerid, string);
  2738.                 TogglePlayerControllable(playerid, 0);
  2739.                 TextDrawShowForPlayer(playerid,AFKBox);
  2740.                 TextDrawShowForPlayer(playerid,AFKText);
  2741.                 TextDrawShowForPlayer(playerid,AFKTextReturn);
  2742.                 SetPlayerVirtualWorld(playerid,playerid+1);
  2743.                 return 1;
  2744.             }
  2745.             else if(AdminModePlayerInfo[playerid][AFK] == 1)
  2746.             {
  2747.                 AdminModePlayerInfo[playerid][AFK] = 0;
  2748.                 new AFKname[256];
  2749.                 GetPlayerName(playerid, AFKname, sizeof(AFKname));
  2750.                 strdel(AFKname, 0, 5);
  2751.                 format(string, sizeof(string), "%s", AFKname);
  2752.                 SetPlayerName(playerid, string);
  2753.                 TogglePlayerControllable(playerid, 1);
  2754.                 format(string, sizeof(string), "%s is back from AFK Mode.", AFKname);
  2755.                 SendClientMessageToAllNoAFK(COLOR_AFK, string);
  2756.                 TextDrawHideForPlayer(playerid,AFKBox);
  2757.                 TextDrawHideForPlayer(playerid,AFKText);
  2758.                 TextDrawHideForPlayer(playerid,AFKTextReturn);
  2759.                 SetPlayerVirtualWorld(playerid,0);
  2760.                 return 1;
  2761.             }
  2762.         }
  2763.         return 1;
  2764.     }
  2765. //----------------------------------------[Count Commands]----------------------------------------|
  2766.     if(strcmp(cmd, "/count", true) == 0)
  2767.     {
  2768.         if(IsPlayerConnected(playerid))
  2769.         {
  2770.           if(IsAdmin(playerid))
  2771.           {
  2772.             tmp = strtok(cmdtext, idx);
  2773.             if(!strlen(tmp))
  2774.             {
  2775.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Count [Time(Seconds)]");
  2776.                 return 1;
  2777.             }
  2778.             new time;
  2779.             time = strval(tmp);
  2780.             if(CountStatus == 0)
  2781.             {
  2782.               new AdminName[256];
  2783.               GetPlayerName(playerid,AdminName,sizeof(AdminName));
  2784.               GameTextForAllNoAFK("~g~Count Started", 1500, 3);
  2785.               format(string, sizeof(string), "Count Activated for: %d Seconds.",time);
  2786.               SendClientMessageNoAFK(playerid,COLOR_M,string);
  2787.               format(string, sizeof(string), "Admin %s Activated Count for: %d Seconds.", AdminName, time);
  2788.               SendAdminMessage(COLOR_M, string);
  2789.               CountStatus = 1;
  2790.               SetCount(time);
  2791.               Count = SetTimer("CountTimer",Second,1);
  2792.               return 1;
  2793.             }
  2794.             else
  2795.             {
  2796.                 SendClientMessageNoAFK(playerid, COLOR_W, "Count Already Activate !");
  2797.                 return 1;
  2798.             }
  2799.           }
  2800.           else
  2801.           {
  2802.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2803.               return 1;
  2804.           }
  2805.         }
  2806.     }
  2807.     if(strcmp(cmd, "/cancelcount", true) == 0)
  2808.     {
  2809.         if(IsPlayerConnected(playerid))
  2810.         {
  2811.           if(IsAdmin(playerid))
  2812.           {
  2813.             if(CountStatus == 1)
  2814.             {
  2815.               new AdminName[256];
  2816.               GetPlayerName(playerid,AdminName,sizeof(AdminName));
  2817.               format(string, sizeof(string), "Admin %s Canceled the Count.", AdminName);
  2818.               SendAdminMessage(COLOR_M, string);
  2819.               GameTextForAllNoAFK("~r~Count Canceled!", 1500, 3);
  2820.               SendClientMessageNoAFK(playerid,COLOR_M,"Count Canceled.");
  2821.               CountStatus = 0;
  2822.               KillTimer(Count);
  2823.               KillTimer(CountGo);
  2824.               CountTime = 0;
  2825.               return 1;
  2826.             }
  2827.             else
  2828.             {
  2829.                 SendClientMessageNoAFK(playerid, COLOR_W, "Count didn't Activate !");
  2830.                 return 1;
  2831.             }
  2832.           }
  2833.           else
  2834.           {
  2835.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2836.               return 1;
  2837.           }
  2838.         }
  2839.     }
  2840. //----------------------------------------[Admins Commands]----------------------------------------|
  2841.     if(strcmp(cmd, "/admins", true) == 0)
  2842.     {
  2843.         if(IsPlayerConnected(playerid))
  2844.         {
  2845.             new AdminsCount = 0;
  2846.             SendClientMessage(playerid, COLOR_ADMINS, "Admins Online:");
  2847.             for(new i = 0; i < MAX_PLAYERS; i++)
  2848.             {
  2849.                 if(IsPlayerConnected(i))
  2850.                 {
  2851.                     if(IsAdmin(i))
  2852.                     {
  2853.                       new AdminName[256];
  2854.                       GetPlayerName(i,AdminName,sizeof(AdminName));
  2855.                       format(string,sizeof(string),"Admin %s",AdminName);
  2856.                       SendClientMessage(playerid, COLOR_ADMINS, string);
  2857.                       AdminsCount += 1;
  2858.                     }
  2859.                 }
  2860.             }
  2861.             if(AdminsCount == 0)
  2862.             {
  2863.               SendClientMessage(playerid, COLOR_ADMINS, "None.");
  2864.             }
  2865.             else if(AdminsCount == 1)
  2866.             {
  2867.               SendClientMessage(playerid, COLOR_ADMINS, "Total: 1 Admin Online.");
  2868.             }
  2869.             else
  2870.             {
  2871.               format(string,sizeof(string),"Total: %d Admins Online.",AdminsCount);
  2872.               SendClientMessage(playerid, COLOR_ADMINS, string);
  2873.             }
  2874.             return 1;
  2875.         }
  2876.         return 1;
  2877.     }
  2878.     if(strcmp(cmd, "/adminlogin", true) == 0 || strcmp(cmd, "/al", true) == 0)
  2879.     {
  2880.         if(IsPlayerConnected(playerid))
  2881.         {
  2882.             AdminModePlayerInfo[playerid][PlayerLogin] = 1;
  2883.             ShowAdministrationLoginStep(playerid,1);
  2884.             return 1;
  2885.         }
  2886.         return 1;
  2887.     }
  2888. //----------------------------------------[Vehicle Commands]----------------------------------------|
  2889.     if(strcmp(cmd, "/createvehicle", true) == 0)
  2890.     {
  2891.         if(IsPlayerConnected(playerid))
  2892.         {
  2893.           if(IsAdmin(playerid))
  2894.           {
  2895.             tmp = strtok(cmdtext, idx);
  2896.             if(!strlen(tmp))
  2897.             {
  2898.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
  2899.                 return 1;
  2900.             }
  2901.             new VehicleModel;
  2902.             VehicleModel = strval(tmp);
  2903.             if(VehicleModel < 400 || VehicleModel > 611)
  2904.             {
  2905.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Model can be Between 400 to 611 !");
  2906.                 return 1;
  2907.             }
  2908.             tmp = strtok(cmdtext, idx);
  2909.             if(!strlen(tmp))
  2910.             {
  2911.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
  2912.                 return 1;
  2913.             }
  2914.             new Color1;
  2915.             Color1 = strval(tmp);
  2916.             if(Color1 < 0 || Color1 > 126)
  2917.             {
  2918.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Colors can be Between 0 to 126 ! (Color1)");
  2919.                 return 1;
  2920.             }
  2921.             tmp = strtok(cmdtext, idx);
  2922.             if(!strlen(tmp))
  2923.             {
  2924.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Createvehicle [Vehicle Model] [Color 1] [Color 2]");
  2925.                 return 1;
  2926.             }
  2927.             new Color2;
  2928.             Color2 = strval(tmp);
  2929.             if(Color2 < 0 || Color2 > 126)
  2930.             {
  2931.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Vehicle Colors can be Between 0 to 126 ! (Color2)");
  2932.                 return 1;
  2933.             }
  2934.             new Float:X,Float:Y,Float:Z;
  2935.             GetPlayerPos(playerid, X,Y,Z);
  2936.             CreateVehicle(VehicleModel, X,Y,Z+5, 0.0, Color1, Color2, 300000);//Spawn after 5 Minutes back.
  2937.             SendClientMessageNoAFK(playerid, COLOR_M, "Vehicle Spawned.");
  2938.           }
  2939.           else
  2940.           {
  2941.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2942.             return 1;
  2943.           }
  2944.         }
  2945.         return 1;
  2946.     }
  2947.     if(strcmp(cmd, "/spawnvehicle", true) == 0)
  2948.     {
  2949.         if(IsPlayerConnected(playerid))
  2950.         {
  2951.           if(IsAdmin(playerid))
  2952.           {
  2953.             tmp = strtok(cmdtext, idx);
  2954.             if(!strlen(tmp))
  2955.             {
  2956.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Spawnvehicle [Vehicle ID]");
  2957.                 return 1;
  2958.             }
  2959.             new VehicleID;
  2960.             VehicleID = strval(tmp);
  2961.             new Float:VehicleX,Float:VehicleY,Float:VehicleZ;
  2962.             GetVehiclePos(VehicleID, VehicleX,VehicleY,VehicleZ);
  2963.             SetPlayerPos(playerid, VehicleX,VehicleY,VehicleZ+5);
  2964.             format(string, sizeof(string), "You Spawned to Vehicle %d.",VehicleID);
  2965.             SendClientMessageNoAFK(playerid, COLOR_M, string);
  2966.           }
  2967.           else
  2968.           {
  2969.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2970.             return 1;
  2971.           }
  2972.         }
  2973.         return 1;
  2974.     }
  2975. //----------------------------------------[Weather Commands]----------------------------------------|
  2976.     if(strcmp(cmd, "/weather", true) == 0)
  2977.     {
  2978.         if(IsPlayerConnected(playerid))
  2979.         {
  2980.           if(IsAdmin(playerid))
  2981.           {
  2982.             tmp = strtok(cmdtext, idx);
  2983.             if(!strlen(tmp))
  2984.             {
  2985.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Weather [Weather ID]");
  2986.                 return 1;
  2987.             }
  2988.             new WeatherID;
  2989.             WeatherID = strval(tmp);
  2990.             format(string, sizeof(string), "You Changed Weather to Weather ID - %d.",WeatherID);
  2991.             SendClientMessageNoAFK(playerid, COLOR_M, string);
  2992.             SetWeather(WeatherID);
  2993.           }
  2994.           else
  2995.           {
  2996.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  2997.             return 1;
  2998.           }
  2999.         }
  3000.         return 1;
  3001.     }
  3002.     if(strcmp(cmd, "/setweather", true) == 0)
  3003.     {
  3004.         if(IsPlayerConnected(playerid))
  3005.         {
  3006.           if(IsAdmin(playerid))
  3007.           {
  3008.             tmp = strtok(cmdtext, idx);
  3009.             if(!strlen(tmp))
  3010.             {
  3011.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetWeather [Playerid/PartOfName] [Weather ID]");
  3012.                 return 1;
  3013.             }
  3014.             giveplayerid = ReturnUser(tmp);
  3015.             if(IsPlayerConnected(giveplayerid))
  3016.             {
  3017.                 if(giveplayerid != INVALID_PLAYER_ID)
  3018.                 {
  3019.                   tmp = strtok(cmdtext, idx);
  3020.                   if(!strlen(tmp))
  3021.                   {
  3022.                     SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetWeather [Playerid/PartOfName] [Weather ID]");
  3023.                     return 1;
  3024.                   }
  3025.                   new WeatherID;
  3026.                   WeatherID = strval(tmp);
  3027.                   GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3028.                   format(string, sizeof(string), "You Changed %s[ID:%d] Weather to Weather ID - %d.",giveplayername ,giveplayerid ,WeatherID);
  3029.                   SendClientMessageNoAFK(playerid, COLOR_M, string);
  3030.                   SetPlayerWeather(giveplayerid,WeatherID);
  3031.                 }
  3032.             }
  3033.             else
  3034.             {
  3035.                   SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3036.                   return 1;
  3037.             }
  3038.           }
  3039.           else
  3040.           {
  3041.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3042.             return 1;
  3043.           }
  3044.         }
  3045.         return 1;
  3046.     }
  3047. //----------------------------------------[Time Commands]----------------------------------------|
  3048.     if(strcmp(cmd, "/time", true) == 0)
  3049.     {
  3050.         if(IsPlayerConnected(playerid))
  3051.         {
  3052.           if(IsAdmin(playerid))
  3053.           {
  3054.             tmp = strtok(cmdtext, idx);
  3055.             if(!strlen(tmp))
  3056.             {
  3057.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /time [Time(Hours)]");
  3058.                 return 1;
  3059.             }
  3060.             new Time;
  3061.             Time = strval(tmp);
  3062.             format(string, sizeof(string), "You Changed Time to %d:00.",Time);
  3063.             SendClientMessageNoAFK(playerid, COLOR_M, string);
  3064.             SetTime(Time);
  3065.           }
  3066.           else
  3067.           {
  3068.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3069.             return 1;
  3070.           }
  3071.         }
  3072.         return 1;
  3073.     }
  3074.     if(strcmp(cmd, "/settime", true) == 0)
  3075.     {
  3076.         if(IsPlayerConnected(playerid))
  3077.         {
  3078.           if(IsAdmin(playerid))
  3079.           {
  3080.             tmp = strtok(cmdtext, idx);
  3081.             if(!strlen(tmp))
  3082.             {
  3083.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetTime [Playerid/PartOfName] [Time(Hours)]");
  3084.                 return 1;
  3085.             }
  3086.             giveplayerid = ReturnUser(tmp);
  3087.             if(IsPlayerConnected(giveplayerid))
  3088.             {
  3089.                 if(giveplayerid != INVALID_PLAYER_ID)
  3090.                 {
  3091.                   tmp = strtok(cmdtext, idx);
  3092.                   if(!strlen(tmp))
  3093.                   {
  3094.                     SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /SetTime [Playerid/PartOfName] [Time(Hours)]");
  3095.                     return 1;
  3096.                   }
  3097.                   new Time;
  3098.                   Time = strval(tmp);
  3099.                   GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3100.                   format(string, sizeof(string), "You Changed %s[ID:%d] Time to %d:00.",giveplayername ,giveplayerid ,Time);
  3101.                   SendClientMessageNoAFK(playerid, COLOR_M, string);
  3102.                   SetPlayerTime(giveplayerid,Time,00);
  3103.                 }
  3104.             }
  3105.             else
  3106.             {
  3107.                   SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3108.                   return 1;
  3109.             }
  3110.           }
  3111.           else
  3112.           {
  3113.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3114.             return 1;
  3115.           }
  3116.         }
  3117.         return 1;
  3118.     }
  3119. //----------------------------------------[Weapon Commands]----------------------------------------|
  3120.     if(strcmp(cmd, "/giveweapon", true) == 0 || strcmp(cmd, "/gw", true) == 0)
  3121.     {
  3122.         if(IsPlayerConnected(playerid))
  3123.         {
  3124.           if(IsAdmin(playerid))
  3125.           {
  3126.             tmp = strtok(cmdtext, idx);
  3127.             if(!strlen(tmp))
  3128.             {
  3129.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
  3130.                 return 1;
  3131.             }
  3132.             giveplayerid = ReturnUser(tmp);
  3133.             if(IsPlayerConnected(giveplayerid))
  3134.             {
  3135.                 if(giveplayerid != INVALID_PLAYER_ID)
  3136.                 {
  3137.                  tmp = strtok(cmdtext, idx);
  3138.                  if(!strlen(tmp))
  3139.                  {
  3140.                    SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
  3141.                    return 1;
  3142.                  }
  3143.                  new WeaponID;
  3144.                  WeaponID = strval(tmp);
  3145.                  if(!strlen(tmp))
  3146.                  {
  3147.                    SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
  3148.                    return 1;
  3149.                  }
  3150.                  if(WeaponID < 1 || WeaponID > 46)
  3151.                  {
  3152.                   SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Weapon ID Must be between 1 - 46.");
  3153.                   return 1;
  3154.                  }
  3155.                  if(WeaponID == 38)
  3156.                  {
  3157.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Minigun - unAvailable Weapon.");
  3158.                  return 1;
  3159.                  }
  3160.                  if(WeaponID == 39)
  3161.                  {
  3162.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Satchel Charge - unAvailable Weapon.");
  3163.                  return 1;
  3164.                  }
  3165.                  if(WeaponID == 40)
  3166.                  {
  3167.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Detonator - unAvailable Weapon.");
  3168.                  return 1;
  3169.                  }
  3170.                  if(WeaponID == 43)
  3171.                  {
  3172.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Camera - unAvailable Weapon.");
  3173.                  return 1;
  3174.                  }
  3175.                  if(WeaponID == 44)
  3176.                  {
  3177.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Nightvision Goggles - unAvailable Weapon.");
  3178.                  return 1;
  3179.                  }
  3180.                  if(WeaponID == 45)
  3181.                  {
  3182.                  SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Infrared Vision - unAvailable Weapon.");
  3183.                  return 1;
  3184.                  }
  3185.                  tmp = strtok(cmdtext, idx);
  3186.                  if(!strlen(tmp))
  3187.                  {
  3188.                    SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GiveWeapon [Playerid/PartOfName] [Weapon ID] [Bullets Amount]");
  3189.                    return 1;
  3190.                  }
  3191.                  new WeaponName[256];
  3192.                  new BulletsAmount;
  3193.                  BulletsAmount = strval(tmp);
  3194.                  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3195.                  GetPlayerName(playerid, sendername, sizeof(sendername));
  3196.                  GivePlayerWeapon(giveplayerid,WeaponID,BulletsAmount);
  3197.                  GetWeaponName(WeaponID, WeaponName, 64);
  3198.                  format(string, sizeof(string), "You Gave %s[ID:%d] Weapon:%s Bullets:%d.",giveplayername,giveplayerid,WeaponName,BulletsAmount);
  3199.                  SendClientMessageNoAFK(playerid,COLOR_M,string);
  3200.                  format(string, sizeof(string), "You Got Weapon:%s Bullets:%d from Admin %s[ID:%d].",WeaponName,BulletsAmount,sendername,playerid);
  3201.                  SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  3202.                 }
  3203.             }
  3204.             else
  3205.             {
  3206.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3207.                 return 1;
  3208.             }
  3209.           }
  3210.           else
  3211.           {
  3212.             SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3213.             return 1;
  3214.           }
  3215.         }
  3216.         return 1;
  3217.     }
  3218.     if(strcmp(cmd, "/disarm", true) == 0)
  3219.     {
  3220.         if(IsPlayerConnected(playerid))
  3221.         {
  3222.           if(IsAdmin(playerid))
  3223.           {
  3224.             tmp = strtok(cmdtext, idx);
  3225.             if(!strlen(tmp))
  3226.             {
  3227.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Disarm [Playerid/PartOfName]");
  3228.                 return 1;
  3229.             }
  3230.             giveplayerid = ReturnUser(tmp);
  3231.             if(giveplayerid == playerid)
  3232.             {
  3233.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  3234.                         SendClientMessageNoAFK(playerid,COLOR_M,"You Disarmed Yourself.");
  3235.                         format(string, sizeof(string), "Admin %s Disarmed by himself.",sendername);
  3236.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  3237.                         ResetPlayerWeapons(playerid);
  3238.                         return 1;
  3239.             }
  3240.             if(IsAdmin(giveplayerid))
  3241.             {
  3242.                 SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Disarm an Admin !");
  3243.                 return 1;
  3244.             }
  3245.             if(IsPlayerConnected(giveplayerid))
  3246.             {
  3247.                     if(giveplayerid != INVALID_PLAYER_ID)
  3248.                     {
  3249.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3250.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  3251.                         format(string, sizeof(string), "You Disarmed %s[ID:%d].",giveplayername,giveplayerid);
  3252.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  3253.                         format(string, sizeof(string), "You have been Disarmed By Admin %s[ID:%d].",sendername,playerid);
  3254.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  3255.                         format(string, sizeof(string), "%s Disarmed by Admin %s",giveplayername ,sendername);
  3256.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  3257.                         ResetPlayerWeapons(giveplayerid);
  3258.                         return 1;
  3259.                     }
  3260.             }
  3261.             else
  3262.             {
  3263.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3264.                 return 1;
  3265.             }
  3266.           }
  3267.           else
  3268.           {
  3269.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3270.               return 1;
  3271.           }
  3272.         }
  3273.         return 1;
  3274.     }
  3275.     if(strcmp(cmd, "/disarmall", true) == 0)
  3276.     {
  3277.         if(IsPlayerConnected(playerid))
  3278.         {
  3279.           if(IsAdmin(playerid))
  3280.           {
  3281.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  3282.                         for(new i = 0; i < MAX_PLAYERS; i++)
  3283.                         {
  3284.                           if(IsPlayerConnected(i))
  3285.                           {
  3286.                                ResetPlayerWeapons(i);
  3287.                           }
  3288.                         }
  3289.                         format(string, sizeof(string), "Admin %s[ID:%d] Disarmed all Players.",sendername,playerid);
  3290.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  3291.                         return 1;
  3292.           }
  3293.           else
  3294.           {
  3295.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3296.               return 1;
  3297.           }
  3298.         }
  3299.         return 1;
  3300.     }
  3301. //----------------------------------------[Chat on/off Command]----------------------------------------|
  3302.     if(strcmp(cmd, "/chatstatus", true) == 0)
  3303.     {
  3304.         if(IsPlayerConnected(playerid))
  3305.         {
  3306.             if(IsAdmin(playerid))
  3307.             {
  3308.               if(ChatStatus == 0)
  3309.               {
  3310.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  3311.                 format(string, sizeof(string), "Admin %s Closed the Chat.", sendername);
  3312.                 SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  3313.                 ChatStatus = 1;
  3314.                 return 1;
  3315.               }
  3316.               else
  3317.               {
  3318.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  3319.                 format(string, sizeof(string), "Admin %s Opened the Chat.", sendername);
  3320.                 SendClientMessageToAllNoAFK(COLOR_ADMINCMD, string);
  3321.                 ChatStatus = 0;
  3322.                 return 1;
  3323.               }
  3324.             }
  3325.             else
  3326.             {
  3327.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3328.                 return 1;
  3329.             }
  3330.         }
  3331.         return 1;
  3332.     }
  3333. //----------------------------------------[IP Command]----------------------------------------|
  3334.     if(strcmp(cmd, "/getip", true) == 0)
  3335.     {
  3336.         if(IsPlayerConnected(playerid))
  3337.         {
  3338.           if(IsAdmin(playerid))
  3339.           {
  3340.             tmp = strtok(cmdtext, idx);
  3341.             if(!strlen(tmp))
  3342.             {
  3343.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /GetIP [Playerid/PartOfName]");
  3344.                 return 1;
  3345.             }
  3346.             giveplayerid = ReturnUser(tmp);
  3347.             if(IsPlayerConnected(giveplayerid))
  3348.             {
  3349.                if(giveplayerid != INVALID_PLAYER_ID)
  3350.                {
  3351.                 GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3352.                 new IP[16];
  3353.                 GetPlayerIp(giveplayerid, IP, sizeof(IP));
  3354.                 format(string, sizeof(string), "The IP of %s[ID:%d] is |%s|.", giveplayername, giveplayerid, IP);
  3355.                 SendClientMessageNoAFK(playerid,COLOR_M, string);
  3356.                 return 1;
  3357.                }
  3358.             }
  3359.             else
  3360.             {
  3361.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3362.                 return 1;
  3363.             }
  3364.           }
  3365.           else
  3366.           {
  3367.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3368.           }
  3369.         }
  3370.         return 1;
  3371.     }
  3372. //----------------------------------------[JetPack Command]----------------------------------------|
  3373.     if(strcmp(cmd, "/jetpack", true) == 0)
  3374.     {
  3375.         if(IsPlayerConnected(playerid))
  3376.         {
  3377.           if(IsAdmin(playerid))
  3378.           {
  3379.                 SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  3380.                 SendClientMessageNoAFK(playerid,COLOR_M, "You got a JetPack.");
  3381.                 return 1;
  3382.           }
  3383.           else
  3384.           {
  3385.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3386.           }
  3387.         }
  3388.         return 1;
  3389.     }
  3390. //----------------------------------------[Clock Command]----------------------------------------|
  3391.     if(strcmp(cmd, "/clock", true) == 0)
  3392.     {
  3393.         if(IsPlayerConnected(playerid))
  3394.         {
  3395.               if(AdminModePlayerInfo[playerid][ClockStatus] == 0)
  3396.               {
  3397.                 TextDrawShowForPlayer(playerid, Clock);
  3398.                 SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Clock Revealed.");
  3399.                 AdminModePlayerInfo[playerid][ClockStatus] = 1;
  3400.                 return 1;
  3401.               }
  3402.               else
  3403.               {
  3404.                 TextDrawHideForPlayer(playerid, Clock);
  3405.                 SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Clock Hid.");
  3406.                 AdminModePlayerInfo[playerid][ClockStatus] = 0;
  3407.                 return 1;
  3408.               }
  3409.         }
  3410.         return 1;
  3411.     }
  3412. //----------------------------------------[Date Command]----------------------------------------|
  3413.     if(strcmp(cmd, "/date", true) == 0)
  3414.     {
  3415.         if(IsPlayerConnected(playerid))
  3416.         {
  3417.               if(AdminModePlayerInfo[playerid][DateStatus] == 0)
  3418.               {
  3419.                 TextDrawShowForPlayer(playerid, Date);
  3420.                 SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Date Revealed.");
  3421.                 AdminModePlayerInfo[playerid][DateStatus] = 1;
  3422.                 return 1;
  3423.               }
  3424.               else
  3425.               {
  3426.                 TextDrawHideForPlayer(playerid, Date);
  3427.                 SendClientMessageNoAFK(playerid,COLOR_CLOCKDATE, "Date Hid.");
  3428.                 AdminModePlayerInfo[playerid][DateStatus] = 0;
  3429.                 return 1;
  3430.               }
  3431.         }
  3432.         return 1;
  3433.     }
  3434. //----------------------------------------[Location Command]----------------------------------------|
  3435.     if(strcmp(cmd, "/location", true) == 0 ||strcmp(cmd, "/l", true) == 0 )
  3436.     {
  3437.         if(IsPlayerConnected(playerid))
  3438.         {
  3439.             if(IsAdmin(playerid))
  3440.             {
  3441.               tmp = strtok(cmdtext, idx);
  3442.               if(!strlen(tmp))
  3443.               {
  3444.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Location [Save/Spawn]");
  3445.                 return 1;
  3446.               }
  3447.               new Choose[256];
  3448.               strmid(Choose, tmp, 0, strlen(cmdtext), 255);
  3449.               if(strcmp(Choose,"save",true) == 0)//Save Position/Location
  3450.               {
  3451.                 new Float:X,Float:Y,Float:Z;
  3452.                 GetPlayerPos(playerid,X,Y,Z);
  3453.                 AdminModePlayerInfo[playerid][LocationX] = X;
  3454.                 AdminModePlayerInfo[playerid][LocationY] = Y;
  3455.                 AdminModePlayerInfo[playerid][LocationZ] = Z;
  3456.                 SendClientMessageNoAFK(playerid, COLOR_M, "Location/Position Saved.");
  3457.                 return 1;
  3458.               }
  3459.               else if(strcmp(Choose,"spawn",true) == 0)//Spawn to Position/Location
  3460.               {
  3461.                if(!(AdminModePlayerInfo[playerid][LocationX] == 0 && AdminModePlayerInfo[playerid][LocationY] == 0 && AdminModePlayerInfo[playerid][LocationZ] == 0))
  3462.                {
  3463.                 SetPlayerPos(playerid,AdminModePlayerInfo[playerid][LocationX],AdminModePlayerInfo[playerid][LocationY],AdminModePlayerInfo[playerid][LocationZ]);
  3464.                 SendClientMessageNoAFK(playerid, COLOR_M, "You Teleported to your Location/Position.");
  3465.                }
  3466.                else
  3467.                {
  3468.                 SendClientMessageNoAFK(playerid, COLOR_W, "You didn't save Location/Position!");
  3469.                 return 1;
  3470.                }
  3471.               }
  3472.               else
  3473.               {
  3474.                format(string,sizeof(string),"Unknown Choose (%s).",Choose);
  3475.                SendClientMessageNoAFK(playerid, COLOR_W,string);
  3476.                SendClientMessageNoAFK(playerid, COLOR_W, "Form| /Location [Save/Spawn]");
  3477.               }
  3478.               return 1;
  3479.             }
  3480.             else
  3481.             {
  3482.                 SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3483.                 return 1;
  3484.             }
  3485.         }
  3486.         return 1;
  3487.     }
  3488. //----------------------------------------[Jail Commands]----------------------------------------|
  3489.     if(strcmp(cmd, "/jail", true) == 0 || strcmp(cmd, "/j", true) == 0)
  3490.     {
  3491.         if(IsPlayerConnected(playerid))
  3492.         {
  3493.           if(IsAdmin(playerid))
  3494.           {
  3495.             tmp = strtok(cmdtext, idx);
  3496.             if(!strlen(tmp))
  3497.             {
  3498.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
  3499.                 return 1;
  3500.             }
  3501.             giveplayerid = ReturnUser(tmp);
  3502.             if(IsAdmin(giveplayerid))
  3503.             {
  3504.                 SendClientMessageNoAFK(playerid, COLOR_W, "You Can not Jail an Admin !");
  3505.                 return 1;
  3506.             }
  3507.             if(IsPlayerConnected(giveplayerid))
  3508.             {
  3509.                     if(giveplayerid != INVALID_PLAYER_ID)
  3510.                     {
  3511.                         tmp = strtok(cmdtext, idx);
  3512.                         if(!strlen(tmp))
  3513.                         {
  3514.                            SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
  3515.                            return 1;
  3516.                         }
  3517.                         new JailTime;
  3518.                         JailTime = strval(tmp);
  3519.                         if(JailTime <= 30 && JailTime >= 1)
  3520.                         {
  3521.                             new length = strlen(cmdtext);
  3522.                             while ((idx < length) && (cmdtext[idx] <= ' '))
  3523.                             {
  3524.                                 idx++;
  3525.                             }
  3526.                             new offset = idx;
  3527.                             new result[64];
  3528.                             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  3529.                             {
  3530.                                 result[idx - offset] = cmdtext[idx];
  3531.                                 idx++;
  3532.                             }
  3533.                             result[idx - offset] = EOS;
  3534.                             if(!strlen(result))
  3535.                             {
  3536.                                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Jail [Playerid/PartOfName] [Minutes(1-30)] [Reason]");
  3537.                                 return 1;
  3538.                             }
  3539.                             GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3540.                             GetPlayerName(playerid, sendername, sizeof(sendername));
  3541.                             AdminModePlayerInfo[giveplayerid][JailStatus] = 1;
  3542.                             AdminModePlayerInfo[giveplayerid][JailMinutes] = JailTime-1;
  3543.                             AdminModePlayerInfo[giveplayerid][JailSeconds] = 60;
  3544.                             format(string, sizeof(string), "You Jailed %s[ID:%d] for %d Minutes with Reason:%s.",giveplayername,giveplayerid,JailTime,(result));
  3545.                             SendClientMessageNoAFK(playerid,COLOR_M,string);
  3546.                             format(string, sizeof(string), "You have been Jailed By Admin %s[ID:%d] for %d Minutes, Reason:%s.",sendername,playerid,JailTime,(result));
  3547.                             SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  3548.                             format(string, sizeof(string), "%s Jailed by Admin %s for %d Minutes, Reason:%s",giveplayername , sendername, JailTime, (result));
  3549.                             SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  3550.                             TextDrawShowForPlayer(giveplayerid,TextJail);
  3551.                             format(string, sizeof(string), "%d:00 ~g~Min",JailTime);
  3552.                             TextDrawSetString(TimeJail[giveplayerid],string);
  3553.                             TextDrawShowForPlayer(giveplayerid,TimeJail[giveplayerid]);
  3554.                             SetPlayerInterior(giveplayerid, 3);
  3555.                             SetPlayerPos(giveplayerid, 197.7777,174.6500,1003.0234);
  3556.                             ResetPlayerWeapons(giveplayerid);
  3557.                             return 1;
  3558.                         }
  3559.                         else
  3560.                         {
  3561.                            SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Jail Time(Minutes) must be Between 1 to 30!");
  3562.                            return 1;
  3563.                         }
  3564.                     }
  3565.             }
  3566.             else
  3567.             {
  3568.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3569.                 return 1;
  3570.             }
  3571.           }
  3572.           else
  3573.           {
  3574.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3575.               return 1;
  3576.           }
  3577.         }
  3578.         return 1;
  3579.     }
  3580.     if(strcmp(cmd, "/unjail", true) == 0 || strcmp(cmd, "/unj", true) == 0)
  3581.     {
  3582.         if(IsPlayerConnected(playerid))
  3583.         {
  3584.           if(IsAdmin(playerid))
  3585.           {
  3586.             tmp = strtok(cmdtext, idx);
  3587.             if(!strlen(tmp))
  3588.             {
  3589.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /unJail [Playerid/PartOfName]");
  3590.                 return 1;
  3591.             }
  3592.             giveplayerid = ReturnUser(tmp);
  3593.             if(IsPlayerConnected(giveplayerid))
  3594.             {
  3595.                     if(giveplayerid != INVALID_PLAYER_ID)
  3596.                     {
  3597.                       if(AdminModePlayerInfo[giveplayerid][JailStatus] == 1)
  3598.                       {
  3599.                         GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  3600.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  3601.                         TextDrawHideForPlayer(giveplayerid,TimeJail[giveplayerid]);
  3602.                         TextDrawSetString(TimeJail[giveplayerid],"00:00 ~g~Min");
  3603.                         TextDrawHideForPlayer(giveplayerid,TextJail);
  3604.                         AdminModePlayerInfo[giveplayerid][JailStatus] = 0;
  3605.                         AdminModePlayerInfo[giveplayerid][JailMinutes] = 0;
  3606.                         AdminModePlayerInfo[giveplayerid][JailSeconds] = 0;
  3607.                         SpawnPlayer(giveplayerid);
  3608.                         format(string, sizeof(string), "You unJailed %s[ID:%d].",giveplayername,giveplayerid);
  3609.                         SendClientMessageNoAFK(playerid,COLOR_M,string);
  3610.                         format(string, sizeof(string), "You have been Jailed By Admin %s[ID:%d]",sendername,playerid);
  3611.                         SendClientMessageNoAFK(giveplayerid,COLOR_M,string);
  3612.                         format(string, sizeof(string), "%s unJailed by Admin %s",giveplayername , sendername);
  3613.                         SendClientMessageToAllNoAFK(COLOR_ADMINCMD,string);
  3614.                         return 1;
  3615.                       }
  3616.                       else
  3617.                       {
  3618.                         SendClientMessageNoAFK(playerid, COLOR_W, "This Player isn't in Jail!");
  3619.                         return 1;
  3620.                       }
  3621.                     }
  3622.             }
  3623.             else
  3624.             {
  3625.                 SendClientMessageNoAFK(playerid, COLOR_W, "This Player is Offline !");
  3626.                 return 1;
  3627.             }
  3628.           }
  3629.           else
  3630.           {
  3631.               SendClientMessageNoAFK(playerid, COLOR_W, "You are not an Admin !");
  3632.               return 1;
  3633.           }
  3634.         }
  3635.         return 1;
  3636.     }
  3637. //----------------------------------------[Admin Help Command]----------------------------------------|
  3638.     if(strcmp(cmd, "/adminhelp", true) == 0 ||strcmp(cmd, "/ah", true) == 0 )
  3639.     {
  3640.         if(IsPlayerConnected(playerid))
  3641.         {
  3642.             if(IsAdmin(playerid))
  3643.             {
  3644.               tmp = strtok(cmdtext, idx);
  3645.               if(!strlen(tmp))
  3646.               {
  3647.                 SendClientMessageNoAFK(playerid, COLOR_WRONGFORM, "Form| /Adminhelp [Category]");
  3648.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "|Categories|");
  3649.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "<Chat> <Interior> <Teleport> <Freeze> <Spec>");
  3650.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "<Armor> <Skin> <Money> <Mute> <Kick> <Jetpack>");
  3651.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "<Kill> <Weapon> <HP> <Time> <Ban> <IP> <Jail>");
  3652.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "<Vehicle> <Weather> <AdminCmd> <Restart> <Count>");
  3653.                 return 1;
  3654.               }
  3655.               new Category[256];
  3656.               strmid(Category, tmp, 0, strlen(cmdtext), 255);
  3657.               if(strcmp(Category,"chat",true) == 0)//Chat Commands
  3658.               {
  3659.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Clearchat (/cc) [Clears Global Chat]");
  3660.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Chatstatus [Close/Open Global Chat]");
  3661.                 return 1;
  3662.               }
  3663.               else if(strcmp(Category,"interior",true) == 0)//Interior Commands
  3664.               {
  3665.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setinterior [Sets Player Interior]");
  3666.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Getinterior [Gets Player Interior]");
  3667.               }
  3668.               else if(strcmp(Category,"teleport",true) == 0)//Teleport Commands
  3669.               {
  3670.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tpto [Teleports you to Player]");
  3671.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tphere [Teleports Player to you]");
  3672.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tphereall [Teleports all Players to you]");
  3673.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Tptp [Teleports player to player]");
  3674.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Location (/l) [Saves/Spawns you to your Location]");
  3675.               }
  3676.               else if(strcmp(Category,"freeze",true) == 0)//Freeze Commands
  3677.               {
  3678.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Freeze (/f) [Freezes Player]");
  3679.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unFreeze (/unf) [unFreezes Player]");
  3680.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Freezeall (/fa) [Freezes all Players]");
  3681.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unFreezeall (/unfa) [unFreezes all Players]");
  3682.               }
  3683.               else if(strcmp(Category,"spec",true) == 0)//Spec Commands
  3684.               {
  3685.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Spec [Spectating Player]");
  3686.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unSpec [unSpectating]");
  3687.               }
  3688.               else if(strcmp(Category,"hp",true) == 0)//HP Commands
  3689.               {
  3690.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Sethp [Sets HP to Player]");
  3691.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Hp [Raises HP to all]");
  3692.               }
  3693.               else if(strcmp(Category,"armor",true) == 0)//Armor Commands
  3694.               {
  3695.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setarmor [Sets Armour to Player]");
  3696.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Armor [Raises Armour to all]");
  3697.               }
  3698.               else if(strcmp(Category,"skin",true) == 0)//Skin Command
  3699.               {
  3700.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setskin [Sets Skin to Player]");
  3701.               }
  3702.               else if(strcmp(Category,"money",true) == 0)//Money Commands
  3703.               {
  3704.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Setmoney [Sets Money to Player]");
  3705.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Givemoney [Gives Money to Player]");
  3706.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Takemoney [Takes Money from Player]");
  3707.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Checkmoney [Checks Player Money]");
  3708.               }
  3709.               else if(strcmp(Category,"mute",true) == 0)//Mute Commands
  3710.               {
  3711.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Mute [Mutes Player(Can't talk in Global chat)]");
  3712.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unMute [unMutes Player(Can talk in Global chat)]");
  3713.               }
  3714.               else if(strcmp(Category,"kick",true) == 0)//Kick Commands
  3715.               {
  3716.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kick [Kicks Player]");
  3717.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kickall [Kicks all Players(not Admins)]");
  3718.                 return 1;
  3719.               }
  3720.               else if(strcmp(Category,"kill",true) == 0)//Kill Command
  3721.               {
  3722.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Kill [Kills Player]");
  3723.               }
  3724.               else if(strcmp(Category,"vehicle",true) == 0)//Vehicle Commands
  3725.               {
  3726.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Fixvehicle [fixes Player Vehicle]");
  3727.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Createvehicle [Create a new Vehicle]");
  3728.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Spawnvehicle [Spawns you to Vehicle(ID)]");
  3729.               }
  3730.               else if(strcmp(Category,"count",true) == 0)//Count Commands
  3731.               {
  3732.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Count [Starts Count]");
  3733.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Cancelcount [Cancels Count]");
  3734.               }
  3735.               else if(strcmp(Category,"time",true) == 0)//Time Commands
  3736.               {
  3737.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Time [Sets Global Time]");
  3738.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/SetTime [Sets Player Time]");
  3739.               }
  3740.               else if(strcmp(Category,"ban",true) == 0)//Ban Command
  3741.               {
  3742.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Ban [Bans Player IP]");
  3743.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unBan [unBans Player IP]");
  3744.               }
  3745.               else if(strcmp(Category,"weapon",true) == 0)//Weapon Commands
  3746.               {
  3747.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Giveweapon [Gives Weapon to Player]");
  3748.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Disarm [Disarms player(Resets Weapons)]");
  3749.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Disarmall [Disarms all Players(Resets Weapons)]");
  3750.               }
  3751.               else if(strcmp(Category,"weather",true) == 0)//Weather Commands
  3752.               {
  3753.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Weather [Sets Global Weather]");
  3754.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/SetWeather [Sets Player Weather]");
  3755.               }
  3756.               else if(strcmp(Category,"admincmd",true) == 0)//AdminCmd Commands
  3757.               {
  3758.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/adminchat (/ac) [Admins Chat]");
  3759.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/admin (/a) [Shows a Admin message on the Screen]");
  3760.               }
  3761.               else if(strcmp(Category,"restart",true) == 0)//Restart Command
  3762.               {
  3763.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Restart [Restarts GameMode]");
  3764.               }
  3765.               else if(strcmp(Category,"ip",true) == 0)//IP Command
  3766.               {
  3767.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/GetIp [Gets Player IP]");
  3768.               }
  3769.               else if(strcmp(Category,"jetpack",true) == 0)//JetPack Command
  3770.               {
  3771.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/JetPack [Gives JackPack to you.]");
  3772.               }
  3773.               else if(strcmp(Category,"jail",true) == 0)//Jail Commands
  3774.               {
  3775.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/Jail (/j) [Jails Player]");
  3776.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/unJail (/unj) [unJails Player]");
  3777.               }
  3778.               else
  3779.               {
  3780.                format(string,sizeof(string),"Unknown Category (%s).",Category);
  3781.                SendClientMessageNoAFK(playerid, COLOR_W,string);
  3782.               }
  3783.               return 1;
  3784.             }
  3785.             else
  3786.             {
  3787.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/afk [Become AFK/Back from AFK]");
  3788.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/adminlogin (/al) [Login as Admin]");
  3789.                 SendClientMessageNoAFK(playerid, COLOR_HELP, "/admins [Admins Online]");
  3790.                 return 1;
  3791.             }
  3792.         }
  3793.         return 1;
  3794.     }
  3795.     format(string,sizeof(string),"Unknown Command (%s).",cmdtext);
  3796.     return SendClientMessage(playerid,COLOR_W,string);
  3797.   }
  3798.   else
  3799.   {
  3800. //----------------------------------------[AFK Commands]----------------------------------------|
  3801.     if(strcmp(cmd, "/afk", true) == 0)
  3802.     {
  3803.        AdminModePlayerInfo[playerid][AFK] = 0;
  3804.        new AFKname[256];
  3805.        GetPlayerName(playerid, AFKname, sizeof(AFKname));
  3806.        strdel(AFKname, 0, 5);
  3807.        format(string, sizeof(string), "%s", AFKname);
  3808.        SetPlayerName(playerid, string);
  3809.        TogglePlayerControllable(playerid, 1);
  3810.        format(string, sizeof(string), "%s is back from AFK Mode.", AFKname);
  3811.        SendClientMessageToAllNoAFK(COLOR_AFK, string);
  3812.        TextDrawHideForPlayer(playerid,AFKBox);
  3813.        TextDrawHideForPlayer(playerid,AFKText);
  3814.        TextDrawHideForPlayer(playerid,AFKTextReturn);
  3815.        SetPlayerVirtualWorld(playerid,0);
  3816.        return 1;
  3817.     }
  3818.     return SendClientMessage(playerid, COLOR_W, "You Are AFK,You can't Write nothing!");
  3819.   }
  3820. }
Advertisement
Add Comment
Please, Sign In to add comment