Advertisement
China_BuleSky

error

Jul 27th, 2022 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. namespace ChinaBlueSky.Roles
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using ChinaBlueSky.Api;
  6. using CommandSystem;
  7. using Exiled.API.Features;
  8. using Exiled.CustomItems.API.Features;
  9. using Exiled.CustomRoles.API.Features;
  10.  
  11. [CommandHandler(typeof(ClientCommandHandler))]
  12. class ComandoCfg : ICommand
  13. {
  14. public string Command => ("cd");
  15.  
  16. public string[] Aliases => null;
  17.  
  18. public string Description => "";
  19.  
  20. public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
  21. {
  22. var ply = Player.Get(sender);
  23.  
  24. var scp1325 = CustomRole.Get(1325);
  25. var scp13251 = CustomRole.Get(13251);
  26.  
  27. bool isScp1325 = scp1325.Check(ply);
  28. bool isScp13251 = scp13251.Check(ply);
  29.  
  30. if (isScp13251)
  31. {
  32. if (!Scp1325Item.Scp13251Cooldown.TryGetValue(ply, out var cooldown))
  33. {
  34. response = "error";
  35. return true;
  36. }
  37.  
  38. if (cooldown > 1)
  39. {
  40. response = $"u need wait {cooldown} s";
  41. return true;
  42. }
  43.  
  44. ply.SetCustomRank("", "default");
  45. Scp1325Item.Scps13251.Remove(ply);
  46. Scp1325Item.Scp13251Cooldown.Remove(ply);
  47. scp1325.AddRole(ply);
  48. response = "u are Scp-1325 now!";
  49. return true;
  50. }
  51.  
  52. if (isScp1325)
  53. {
  54. if (!Scp1325Role.Delay.TryGetValue(ply, out var cooldown))
  55. {
  56. response = "error";
  57. return true;
  58. }
  59.  
  60. if (cooldown > 1)
  61. {
  62. response = $"Need wait {cooldown} s";
  63. return true;
  64. }
  65.  
  66. var randomList = new List<ItemType>
  67. {
  68. ItemType.Medkit,
  69. ItemType.Adrenaline,
  70. ItemType.Painkillers
  71. };
  72.  
  73. var item = ply.AddItem(randomList[Plugin.Random.Next(0, randomList.Count)]);
  74. CustomItem.Get(1325).TrackedSerials.Add(item.Serial);
  75. Scp1325Role.Delay[ply] = 120;
  76.  
  77. response = $"done";
  78. return true;
  79. }
  80.  
  81. response = "u can not use this command.";
  82. return true;
  83. }
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement