Advertisement
jlalt

MOBAW

Apr 20th, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 19.71 KB | None | 0 0
  1. enum pInfo
  2. {
  3.     [MoB],
  4.     var_[MoB]HighLight[2],
  5.     MoBOLDRank,
  6. };
  7.  
  8. public OnPlayerConnect(playerid)
  9. {
  10.     PlayerInfo[playerid][MoB] = 0;
  11.     PlayerInfo[playerid][var_MoBHighLight][0] = 0;
  12.     PlayerInfo[playerid][var_MoBHighLight][1] = 0;
  13. }
  14.  
  15. public OnPlayerDisconnect(playerid)
  16. {
  17.     if(PlayerInfo[playerid][var_MoBHighLight][0] > 0)
  18.     {
  19.         KillTimer(PlayerInfo[playerid][var_MoBHighLight][1]);
  20.         PlayerInfo[playerid][var_MoBHighLight][0] = 0;
  21.         PlayerInfo[playerid][var_MoBHighLight][1] = 0;
  22.     }
  23. }
  24.  
  25. new MoBRanks[11][1][40] =
  26. {
  27.     { "Not Member" },
  28.     { "Newbie" },
  29.     { "Honored" },
  30.     { "Trusted" },
  31.     { "Elite" },
  32.     { "Assistant" },
  33.     { "Co-Leader" },
  34.     { "Leader" },
  35.     { "Co-Manager" },
  36.     { "Manager" },
  37.     { "Ceo" }
  38. };
  39.  
  40. new MoBRanksColors[10][1] =
  41. {
  42.     { 0xFF9900AA },
  43.     { 0xD2691EAA },
  44.     { 0x33CCFFAA },
  45.     { 0x0000BBAA },
  46.     { 0xFFFFFFAA },
  47.     { 0xC0C0C0AA },
  48.     { 0xFFFF00AA },
  49.     { 0xF6BB0AA },
  50.     { 0xFF0000AA },
  51.     { 0x33FF33AA }
  52. };
  53.  
  54. new MoBHighLightColors[2][1] =
  55. {
  56.     { 0xAA3333AA },
  57.     { 0x000000AA }
  58. };
  59.  
  60. CMD:mobhelp(playerid, params[])
  61. {
  62.     if(PlayerInfo[playerid][MoB] < 1)
  63.     {
  64.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  65.     }
  66.     else
  67.     {
  68.         new Handle[2500];
  69.         strcat(Handle, "{00FFFF}/MoBmembers       {FFFFFF}| {1aa3ff}Shows You The Online MoB Members!{FFFFFF}.\n");
  70.         strcat(Handle, "{00FFFF}/MoBWeaps  {FFFFFF}| {1aa3ff}Gives You MoB Weapons.\n");
  71.         strcat(Handle, "{00FFFF}/MoBCar1        {FFFFFF}| {1aa3ff}Gives You MoB Car Model 1.\n");
  72.         strcat(Handle, "{00FFFF}/MoBCar2        {FFFFFF}| {1aa3ff}Gives You MoB Car Model 2.\n");
  73.         strcat(Handle, "{00FFFF}/MoBBike1       {FFFFFF}| {1aa3ff}Gives You MoB Bike Model 1.\n");
  74.         strcat(Handle, "{00FFFF}/MoBBike2       {FFFFFF}| {1aa3ff}Gives You MoB Bike Model 2.\n");
  75.         strcat(Handle, "{00FFFF}/MoBSkin1       {FFFFFF}| {1aa3ff}Gives You MoB Skin Model 1.\n");
  76.         strcat(Handle, "{00FFFF}/MoBSkin2       {FFFFFF}| {1aa3ff}Gives You MoB Skin Model 2.\n");
  77.         strcat(Handle, "{00FFFF}/MoBSkin3       {FFFFFF}| {1aa3ff}Gives You MoB Skin Model 3.\n");
  78.         strcat(Handle, "{00FFFF}/MoBhighlight {FFFFFF}| {1aa3ff}Gives You MoB Highlight [ {FFFF00}Name Color Highlights {1aa3ff}]{FFFFFF}.\n");
  79.         strcat(Handle, "{00FFFF}/MoBann          {FFFFFF}| {1aa3ff}Announces A Text For MoB Members{FFFFFF}.\n");
  80.         strcat(Handle, "{00FFFF}/SetTempMoB {FFFFFF}| {1aa3ff}Sets A Player MoB Member For Temp Period Time Member [ {FFFF00}Usage: /SetTempmob PlayerID Rank {1aa3ff}]{FFFFFF}.\n");
  81.         strcat(Handle, "{00FFFF}/SETMoB           {FFFFFF}| {1aa3ff}Sets A Player MoB Member [ {FFFF00}Usage: /SETmob PlayerID Rank {1aa3ff}]{FFFFFF}.\n");
  82.         strcat(Handle, "{00FFFF}/OsetMoB         {FFFFFF}|{1aa3ff} Sets A Player MoB Member By His Name [ {FFFF00}Usage: /Osetmob PlayerName Rank {1aa3ff}]{FFFFFF}.\n");
  83.         strcat(Handle, "\t\t\t{00FFFF}Commands By: {DC143C}****{33FF33}BlackTurbo{DC143C}****");
  84.         ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FFFF00}MoB Commands", Handle, "Close", "");
  85.         CMDMessageToMoB(playerid, "MoBHELP");
  86.     }
  87.     return 1;
  88. }
  89.  
  90. CMD:mobmembers(playerid, params[])
  91. {
  92.     if(PlayerInfo[playerid][Registered] && PlayerInfo[playerid][LoggedIn])
  93.     {
  94.         new
  95.             string[180],
  96.             counter = 0
  97.         ;
  98.         SendClientMessage(playerid, 0xFF0000AA, " ");
  99.         SendClientMessage(playerid, 0x00FFFFAA, "__________ |- Online {FFFF00}Murder members {00FFFF}Members -| __________");
  100.         SendClientMessage(playerid, 0xFF0000AA, " ");
  101.         for(new i = 0; i < MAX_PLAYERS; i++)
  102.         {
  103.             if(IsPlayerConnected(i))
  104.             {
  105.                 if(PlayerInfo[i][MoB])
  106.                 {
  107.                     if(!PlayerInfo[i][Registered])
  108.                     {
  109.                         PlayerInfo[i][MoB] = 0;
  110.                     }
  111.                     else
  112.                     {
  113.                         format(string, 128, "Rank: %d - %s (Id:%i) | %s |",PlayerInfo[i][MoB], pName(i), i, MoBRanks[PlayerInfo[i][MoB]][0][0]);
  114.                         SendClientMessage(playerid, MoBRanksColors[ PlayerInfo[i][MoB] -  1 ][0], string);
  115.                         counter++;
  116.                     }
  117.                 }
  118.             }
  119.         }
  120.         if(!counter)
  121.         {
  122.             SendClientMessage(playerid,0xFF0000AA,"There're no Murder members member onlline");
  123.         }
  124.         SendClientMessage(playerid, 0x00FFFFAA, "___________________________________________");
  125.     }
  126.     else
  127.     {
  128.         SendClientMessage(playerid, red, "ERROR: You need to be registered and loggedin to use this command!");
  129.     }
  130.     return 1;
  131. }
  132.  
  133. CMD:mobweaps(playerid, params[])
  134. {
  135.     if(PlayerInfo[playerid][MoB] < 2)
  136.     {
  137.         SendClientMessage(playerid, red,"ERROR: You need to be rank 2 to use this command!");
  138.     }
  139.     else
  140.     {
  141.         GivePlayerWeapon(playerid, 4, 1000);
  142.         GivePlayerWeapon(playerid, 31, 1000);
  143.         GivePlayerWeapon(playerid, 42, 1000);
  144.         GivePlayerWeapon(playerid, 28, 1000);
  145.         GivePlayerWeapon(playerid, 26, 1000);
  146.         GivePlayerWeapon(playerid, 34, 1000);
  147.         GivePlayerWeapon(playerid, 24, 1000);
  148.         GivePlayerWeapon(playerid, 16, 1000);
  149.         new string[140];
  150.         format(string, sizeof string,"[INFO]: %s have used MoB weapons | **/MoBWeaps** |", pName(playerid));
  151.         SendClientMessageToAll(red, string);
  152.         CMDMessageToMoB(playerid, "MoBWEAPS");
  153.     }
  154.     return 1;
  155. }
  156. CMD:mobcar1(playerid, params[])
  157. {
  158.     if(PlayerInfo[playerid][MoB] < 1)
  159.     {
  160.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  161.     }
  162.     else
  163.     {
  164.         if(IsPlayerInAnyVehicle(playerid))
  165.         {
  166.             SendClientMessage(playerid, red, "ERROR: You're already inside a vehicle!");
  167.         }
  168.         else
  169.         {
  170.             CarSpawner(playerid, 520);
  171.             CMDMessageToMoB(playerid, "MoBCAR1");
  172.             SendClientMessage(playerid, blue, "Enjoy With MoB Car!");
  173.         }
  174.     }
  175.     return 1;
  176. }
  177. CMD:mobcar2(playerid, params[])
  178. {
  179.     if(PlayerInfo[playerid][MoB] < 1)
  180.     {
  181.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  182.     }
  183.     else
  184.     {
  185.         if(IsPlayerInAnyVehicle(playerid))
  186.         {
  187.             SendClientMessage(playerid, red, "ERROR: You're already inside a vehicle!");
  188.         }
  189.         else
  190.         {
  191.             CarSpawner(playerid, 425);
  192.             CMDMessageToMoB(playerid, "MoBCAR2");
  193.             SendClientMessage(playerid, blue, "Enjoy With MoB Car!");
  194.         }
  195.     }
  196.     return 1;
  197. }
  198. CMD:mobbike1(playerid, params[])
  199. {
  200.     if(PlayerInfo[playerid][MoB] < 1)
  201.     {
  202.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  203.     }
  204.     else
  205.     {
  206.         if(IsPlayerInAnyVehicle(playerid))
  207.         {
  208.             SendClientMessage(playerid, red, "ERROR: You're already inside a vehicle!");
  209.         }
  210.         else
  211.         {
  212.             CarSpawner(playerid, 411);
  213.             CMDMessageToMoB(playerid, "MoBBIKE1");
  214.             SendClientMessage(playerid, blue, "Enjoy With MoB Bike!");
  215.         }
  216.     }
  217.     return 1;
  218. }
  219. CMD:mobbike2(playerid, params[])
  220. {
  221.     if(PlayerInfo[playerid][MoB] < 1)
  222.     {
  223.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  224.     }
  225.     else
  226.     {
  227.         if(IsPlayerInAnyVehicle(playerid))
  228.         {
  229.             SendClientMessage(playerid, red, "ERROR: You're already inside a vehicle!");
  230.         }
  231.         else
  232.         {
  233.             CarSpawner(playerid, 579);
  234.             CMDMessageToMoB(playerid, "MoBBIKE1");
  235.             SendClientMessage(playerid, blue, "Enjoy With MoB Bike!");
  236.         }
  237.     }
  238.     return 1;
  239. }
  240. CMD:mobskin1(playerid, params[])
  241. {
  242.     if(PlayerInfo[playerid][MoB] < 1)
  243.     {
  244.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  245.     }
  246.     else
  247.     {
  248.         SetPlayerSkin(playerid, 61);
  249.         CMDMessageToMoB(playerid, "MoBSKIN1");
  250.         SendClientMessage(playerid, blue, "Enjoy With MoB Skin!");
  251.     }
  252.     return 1;
  253. }
  254. CMD:mobskin2(playerid, params[])
  255. {
  256.     if(PlayerInfo[playerid][MoB] < 4)
  257.     {
  258.         SendClientMessage(playerid, red,"ERROR: You need to be rank 4 to use this command!");
  259.     }
  260.     else
  261.     {
  262.         SetPlayerSkin(playerid, 287);
  263.         CMDMessageToMoB(playerid, "MoBSKIN2");
  264.         SendClientMessage(playerid, blue, "Enjoy With MoB Skin!");
  265.     }
  266.     return 1;
  267. }
  268. CMD:mobskin3(playerid, params[])
  269. {
  270.     if(PlayerInfo[playerid][MoB] < 8)
  271.     {
  272.         SendClientMessage(playerid, red,"ERROR: You need to be rank 8 to use this command!");
  273.     }
  274.     else
  275.     {
  276.         SetPlayerSkin(playerid, 83);
  277.         CMDMessageToMoB(playerid, "MoBSKIN3");
  278.         SendClientMessage(playerid, blue, "Enjoy With MoB Skin!");
  279.     }
  280.     return 1;
  281. }
  282. CMD:mobann(playerid, params[])
  283. {
  284.     if(PlayerInfo[playerid][MoB] < 4)
  285.     {
  286.         SendClientMessage(playerid, red,"ERROR: You need to be rank 4 to use this command!");
  287.     }
  288.     else
  289.     {
  290.         if(isnull(params))
  291.         {
  292.             SendClientMessage(playerid, red,"Usage: /mobann [text]");
  293.         }
  294.         else
  295.         {
  296.             for(new i = 0; i < MAX_PLAYERS; i++)
  297.             {
  298.                 if(IsPlayerConnected(i))
  299.                 {
  300.                     if(PlayerInfo[i][MoB])
  301.                     {
  302.                         GameTextForPlayer(playerid, params, 4000, 3);
  303.                     }
  304.                 }
  305.             }
  306.             CMDMessageToMoB(playerid, "MoBANN");
  307.         }
  308.     }
  309.     return 1;
  310. }
  311.  
  312. CMD:mob(playerid, params[])
  313. {
  314.     if(PlayerInfo[playerid][MoB] < 1)
  315.     {
  316.         SendClientMessage(playerid, red,"ERROR: You need to be rank 1 to use this command!");
  317.     }
  318.     else
  319.     {
  320.         if(isnull(params))
  321.         {
  322.             SendClientMessage(playerid, red, "Usage: /mob [text]");
  323.         }
  324.         else
  325.         {
  326.             new string[148];
  327.             format(string, sizeof string,"[MoB - %s] - %s(%d){00FFFF}: %s",MoBRanks[PlayerInfo[playerid][MoB]][0][0],  pName(playerid), playerid, params);
  328.             MessageToMoB(MoBRanksColors[ PlayerInfo[playerid][MoB] - 1 ][0], string);
  329.         }
  330.     }
  331.     return 1;
  332. }
  333.  
  334. CMD:settempmob(playerid,params[]) {
  335.     if(PlayerInfo[playerid][LoggedIn] == 1)
  336.     {
  337.         if(PlayerInfo[playerid][MoB] < 8)
  338.         {
  339.             ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ERROR", "You need to be MoB rank 8 to use this command!", "Close", "");
  340.         }
  341.         else
  342.         {
  343.             new
  344.                 player1,
  345.                 level,
  346.                 playername[MAX_PLAYER_NAME],
  347.                 adminname[MAX_PLAYER_NAME],
  348.                 string[128],
  349.                 tmp[128],
  350.                 tmp2[128],
  351.                 Index
  352.             ;
  353.             tmp = strtok(params, Index);
  354.             tmp2 = strtok(params, Index);
  355.             if(isnull(params))
  356.             {
  357.                 SendClientMessage(playerid, 0xFF0000AA, "USAGE: /settempmob [playerid] [level]");
  358.                 SendClientMessage(playerid, orange, "Function: Will set temp the Level of MoB of the Specific Player");
  359.             }
  360.             else
  361.             {
  362.                 player1 = strval(tmp);
  363.                 if(isnull(tmp2))
  364.                 {
  365.                     SendClientMessage(playerid, 0xFF0000AA, "USAGE: /settempmob [playerid] [level]");
  366.                     SendClientMessage(playerid, orange, "Function: Will set temp the Level of MoB of the Specific Player");
  367.                 }
  368.                 else
  369.                 {
  370.                     level = strval(tmp2);
  371.                     if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
  372.                      {
  373.                         if(PlayerInfo[player1][LoggedIn] == 1)
  374.                         {
  375.                             if(level > 10)
  376.                             {
  377.                                 SendClientMessage(playerid,0xFF0000AA,"ERROR: Max MoB Level is 10");
  378.                             }
  379.                             else
  380.                             {
  381.                                 if(level == PlayerInfo[player1][MoB])
  382.                                 {
  383.                                     SendClientMessage(playerid,0xFF0000AA,"ERROR: Player is already this MoB level");
  384.                                 }
  385.                                 else
  386.                                 {
  387.                                     CMDMessageToMoB(playerid,"SETTEMPMoB");
  388.                                     GetPlayerName(player1, playername, sizeof(playername));
  389.                                     GetPlayerName(playerid, adminname, sizeof(adminname));
  390.                                     new
  391.                                         year,
  392.                                         month,
  393.                                         day
  394.                                     ;
  395.                                     getdate(year, month, day);
  396.                                     new
  397.                                         hour,
  398.                                         minute,
  399.                                         second
  400.                                     ;
  401.                                     gettime(hour,minute,second);
  402.                                     if(level > 0)
  403.                                     {
  404.                                         format(string,sizeof(string)," %s has set your MoB Status to level %d",adminname, level);
  405.                                     }
  406.                                     else
  407.                                     {
  408.                                         format(string,sizeof(string)," %s has set your MoB Status to level %d",adminname, level);
  409.                                     }
  410.                                     SendClientMessage(player1,0x00FFFFAA,string);
  411.                                     if(level > PlayerInfo[player1][MoB])
  412.                                     {
  413.                                         GameTextForPlayer(player1,"~g~MoB LEVEL UP", 2000, 3);
  414.                                     }
  415.                                     else
  416.                                     {
  417.                                         GameTextForPlayer(player1,"~r~MoB LEVEL DOWN", 2000, 3);
  418.                                     }
  419.                                     format(string,sizeof(string),"You have made %s MoB Temp Level %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second);
  420.                                     SendClientMessage(playerid,0x00FFFFAA,string);
  421.                                     format(string,sizeof(string),"%s has made %s MoB Temp Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second);
  422.                                     PlayerInfo[player1][MoB] = level;
  423.                                     PlayerPlaySound(player1,1057,0.0,0.0,0.0);
  424.                                 }
  425.                             }
  426.                         }
  427.                         else
  428.                         {
  429.                             SendClientMessage(playerid,0xFF0000AA,"ERROR: Player must be registered and logged in to be set as a MoB member");
  430.                         }
  431.                     }
  432.                     else
  433.                     {
  434.                         SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
  435.                     }
  436.                 }
  437.             }
  438.         }
  439.     }
  440.     else
  441.     {
  442.         SendClientMessage(playerid,0xFF0000AA,"ERROR: You must be logged in to use this command");
  443.     }
  444.     return 1;
  445. }
  446.  
  447. CMD:setmob(playerid,params[]) {
  448.     if(PlayerInfo[playerid][LoggedIn] == 1)
  449.     {
  450.         if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][MoB] < 8)
  451.         {
  452.             ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{FF0000}ERROR", "You need to be MoB rank 8 to use this command", "Close", "");
  453.         }
  454.         else
  455.         {
  456.             new
  457.               player1,
  458.               level,
  459.               playername[MAX_PLAYER_NAME],
  460.               adminname[MAX_PLAYER_NAME],
  461.               string[128],
  462.               tmp[128],
  463.               tmp2[128],
  464.               Index
  465.             ;
  466.             tmp = strtok(params, Index);
  467.             tmp2 = strtok(params, Index);
  468.             if(isnull(params))
  469.             {
  470.                 SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setmob [playerid] [level]");
  471.                 SendClientMessage(playerid, orange, "Function: Will set the Level of MoB of the Specific Player");
  472.             }
  473.             else
  474.             {
  475.                 player1 = strval(tmp);
  476.                 if(isnull(tmp2))
  477.                 {
  478.                     SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setmob [playerid] [level]");
  479.                     SendClientMessage(playerid, orange, "Function: Will set the Level of MoB of the Specific Player");
  480.                 }
  481.                 else
  482.                 {
  483.                     level = strval(tmp2);
  484.                     if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
  485.                     {
  486.                         if(PlayerInfo[player1][LoggedIn] == 1)
  487.                         {
  488.                             if(level > 10)
  489.                             {
  490.                                 SendClientMessage(playerid,0xFF0000AA,"ERROR: Max MoB Level is 10");
  491.                             }
  492.                             else
  493.                             {
  494.                                 if(level == PlayerInfo[player1][MoB])
  495.                                 {
  496.                                     SendClientMessage(playerid,0xFF0000AA,"ERROR: Player is already this MoB level");
  497.                                 }
  498.                                 else
  499.                                 {
  500.                                     CMDMessageToAdmins(playerid,"SETMoB");
  501.                                     CMDMessageToMoB(playerid,"SETMoB");
  502.                                     GetPlayerName(player1, playername, sizeof(playername));
  503.                                     GetPlayerName(playerid, adminname, sizeof(adminname));
  504.                                     new
  505.                                         year,
  506.                                         month,
  507.                                         day
  508.                                     ;
  509.                                     getdate(year, month, day);
  510.                                     new
  511.                                        hour,
  512.                                        minute,
  513.                                        second
  514.                                     ;
  515.                                     gettime(hour,minute,second);
  516.                                     if(level > 0)
  517.                                     {
  518.                                         format(string,sizeof(string)," %s has set your MoB Status to level %d",adminname, level);
  519.                                     }
  520.                                     else
  521.                                     {
  522.                                         format(string,sizeof(string)," %s has set your MoB Status to level %d",adminname, level);
  523.                                     }
  524.                                     SendClientMessage(player1,0x00FFFFAA,string);
  525.  
  526.                                     if(level > PlayerInfo[player1][MoB])
  527.                                     {
  528.                                         GameTextForPlayer(player1,"~g~MoB LEVEL UP", 2000, 3);
  529.                                     }
  530.                                     else
  531.                                     {
  532.                                         GameTextForPlayer(player1,"~r~MoB LEVEL DOWN", 2000, 3);
  533.                                     }
  534.                                     format(string,sizeof(string),"You have made %s MoB Level %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second);
  535.                                     SendClientMessage(playerid,0x00FFFFAA,string);
  536.                                     format(string,sizeof(string),"%s has made %s MoB Level %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second);
  537.                                     SaveToFile("MoBmembers",string);
  538.                                     dUserSetINT(pName(player1)).("MoB",(level));
  539.                                     PlayerInfo[player1][MoB] = level;
  540.                                     PlayerPlaySound(player1,1057,0.0,0.0,0.0);
  541.                                 }
  542.                             }
  543.                         }
  544.                         else
  545.                         {
  546.                             SendClientMessage(playerid,0xFF0000AA,"ERROR: Player must be registered and logged in to be set as a MoB member");
  547.                         }
  548.                     }
  549.                     else
  550.                     {
  551.                         SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
  552.                     }
  553.                 }
  554.             }
  555.         }
  556.     }
  557.     else
  558.     {
  559.         SendClientMessage(playerid,0xFF0000AA,"ERROR: You must be logged in to use this command");
  560.     }
  561.     return 1;
  562. }
  563.  
  564. CMD:osetmob(playerid,params[])
  565. {
  566.     if(PlayerInfo[playerid][MoB] < 8)
  567.     {
  568.         SendClientMessage(playerid, red, "You need to be MoB rank 8 to use this command!");
  569.     }
  570.     else
  571.     {
  572.         new
  573.             file[256],
  574.             string[120],
  575.             tmp[128],
  576.             tmp2[128],
  577.             Index
  578.         ;
  579.         tmp = strtok(params,Index);
  580.         tmp2 = strtok(params,Index);
  581.         if(isnull(params))
  582.         {
  583.             SendClientMessage(playerid, red, "USAGE: /osetmob [name] [level]");
  584.         }
  585.         else
  586.         {
  587.             if(isnull(tmp2))
  588.             {
  589.                 SendClientMessage(playerid, red, "ERROR: You must input a level");
  590.             }
  591.             else
  592.             {
  593.                 format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(tmp));
  594.                 if(!fexist(file))
  595.                 {
  596.                     SendClientMessage(playerid, red, "ERROR: that account doesn't even exist!");
  597.                 }
  598.                 else
  599.                 {
  600.                     dini_Set(file,"MoB",tmp2);
  601.                     CMDMessageToMoB(playerid,"OSETMoB");
  602.                     new
  603.                         year,
  604.                         month,
  605.                         day
  606.                     ;
  607.                     getdate(year, month, day);
  608.                     new
  609.                        hour,
  610.                        minute,
  611.                        second
  612.                     ;
  613.                     gettime(hour,minute,second);
  614.                     format(string,sizeof(string),"You have set %s's MoB level to %s on %d/%d/%d at %d:%d:%d",tmp,tmp2 ,day, month, year, hour, minute, second );
  615.                     SendClientMessage(playerid,blue,string);
  616.                 }
  617.             }
  618.         }
  619.     }
  620.     return 1;
  621. }
  622.  
  623. CMD:mobhighlight(playerid, params[])
  624. {
  625.     if(PlayerInfo[playerid][MoB] < 4)
  626.     {
  627.         SendClientMessage(playerid, red,"ERROR: You need to be rank 4 to use this command!");
  628.     }
  629.     else
  630.     {
  631.         if(PlayerInfo[playerid][var_MoBHighLight][0] > 0)
  632.         {
  633.             KillTimer(PlayerInfo[playerid][var_MoBHighLight][1]);
  634.             PlayerInfo[playerid][var_MoBHighLight][0] = 0;
  635.             PlayerInfo[playerid][var_MoBHighLight][1] = 0;
  636.             SendClientMessage(playerid, blue, "Successfully turned MoB highlight off!");
  637.             CMDMessageToMoB(playerid, "MoBHIGHLIGHT");
  638.             SetPlayerColor(playerid, PlayerInfo[playerid][MoBOLDRank]);
  639.         }
  640.         else
  641.         {
  642.             PlayerInfo[playerid][MoBOLDRank] = GetPlayerColor(playerid);
  643.             PlayerInfo[playerid][var_MoBHighLight][0] = 1;
  644.             PlayerInfo[playerid][var_MoBHighLight][1] = SetTimerEx("MoBHighLight", 1000, 1, "i", playerid);
  645.             SendClientMessage(playerid, blue, "Successfully turned MoB highlight on!");
  646.             CMDMessageToMoB(playerid, "MoBHIGHLIGHT");
  647.         }
  648.     }
  649.     return 1;
  650. }
  651.  
  652. forward public MoBHighLight(playerid);
  653. public MoBHighLight(playerid)
  654. {
  655.     if(PlayerInfo[playerid][var_MoBHighLight][0] >= (sizeof(MoBHighLightColors)))
  656.     {
  657.         PlayerInfo[playerid][var_MoBHighLight][0] = 0;
  658.     }
  659.     SetPlayerColor(playerid, MoBHighLightColors[PlayerInfo[playerid][var_MoBHighLight][0]][0]);
  660.     PlayerInfo[playerid][var_MoBHighLight][0]++;
  661. }
  662.  
  663. CMDMessageToMoB(playerid, const cmd[])
  664. {
  665.     new string[128];
  666.     GetPlayerName(playerid, string, sizeof(string));
  667.     format(string,sizeof(string),"[MoB - %s] '%s' (Level: %d) | Command: %s",MoBRanks[PlayerInfo[playerid][MoB]][0][0], string, PlayerInfo[playerid][MoB], cmd);
  668.     MessageToMoB(blue, string);
  669. }
  670.  
  671. MessageToMoB(const color, const string[])
  672. {
  673.     for(new i = 0; i < MAX_PLAYERS; i++)
  674.     {
  675.         if(IsPlayerConnected(i))
  676.         {
  677.             if(PlayerInfo[i][MoB])
  678.             {
  679.                 SendClientMessage(i, color, string);
  680.             }
  681.         }
  682.     }
  683. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement