Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <ccsplayer>
  3. #include <sdktools>
  4. #include <sdkhooks>
  5. #pragma semicolon 1
  6. #pragma newdecls required
  7. #define PLUGIN_AUTHOR "Jadow"
  8. #define PLUGIN_VERSION "1.00"
  9.  
  10. enum TenManSpecialStatus{
  11. CT_ONLY = 1,
  12. T_ONLY,
  13. ENABLED
  14. };
  15.  
  16. public Plugin myinfo = {
  17. name = "Fancy 10 Mans",
  18. author = PLUGIN_AUTHOR,
  19. description = "Yes",
  20. version = PLUGIN_VERSION,
  21. url = ""
  22. };
  23. ConVar ExoBootsToggle;
  24. ConVar BumpMineToggle;
  25. ConVar ShieldToggle;
  26. ConVar BreachChargeToggle;
  27. ConVar MediShotToggle;
  28. ConVar MediShotNum;
  29.  
  30. public void OnPluginStart(){
  31. RegAdminCmd("sm_bumpy", Command_Bumpy, ADMFLAG_ROOT);
  32. HookEvent("round_start", Event_RoundStart);
  33. HookEvent("round_end", Event_RoundEnd);
  34.  
  35. ExoBootsToggle = CreateConVar("sm_10man_toggle_exoboots", "0", "0 = Disabled, 1 = CT, 2 = T, 3 = Both", _, true, 0.0, true, 3.0);
  36. BumpMineToggle = CreateConVar("sm_10man_toggle_bumpmine", "0", "0 = Disabled, 1 = CT, 2 = T, 3 = Both", _, true, 0.0, true, 3.0);
  37. ShieldToggle = CreateConVar("sm_10man_toggle_shield", "0", "0 = Disabled, 1 = CT, 2 = T, 3 = Both", _, true, 0.0, true, 3.0);
  38. BreachChargeToggle = CreateConVar("sm_10man_toggle_breachcharge", "0", "0 = Disabled, 1 = CT, 2 = T, 3 = Both", _, true, 0.0, true, 3.0);
  39. MediShotToggle = CreateConVar("sm_10man_toggle_medishot", "0", "0 = Disabled, 1 = CT, 2 = T, 3 = Both", _, true, 0.0, true, 3.0);
  40. MediShotNum = CreateConVar("sm_10man_num_medishot", "1", "Amount of MediShots", _, true, 0.0, true, 5.0);
  41. AutoExecConfig(true, "plugin.fancytenman");
  42. }
  43.  
  44. public Action Command_Bumpy(int client, int args){
  45. PrintToChatAll("bumpy bumpy");
  46. }
  47.  
  48. public void Event_RoundStart(Event event, const char[] name, bool dontbroadcast){
  49. if(BumpMineToggle.IntValue == view_as<int>(CT_ONLY)){
  50. GiveAllCTsWeapon("weapon_bumpmine");
  51. }else if(BumpMineToggle.IntValue == view_as<int>(T_ONLY)){
  52. GiveAllTsWeapon("weapon_bumpmine");
  53. }else if(BumpMineToggle.IntValue == view_as<int>(ENABLED)){
  54. GiveAllPlayersWeapon("weapon_bumpmine");
  55. }
  56. if(ShieldToggle.IntValue == view_as<int>(CT_ONLY)){
  57. GiveAllCTsWeapon("weapon_shield");
  58. }else if(ShieldToggle.IntValue == view_as<int>(T_ONLY)){
  59. GiveAllTsWeapon("weapon_shield");
  60. }else if(ShieldToggle.IntValue == view_as<int>(ENABLED)){
  61. GiveAllPlayersWeapon("weapon_shield");
  62. }
  63. if(BreachChargeToggle.IntValue == view_as<int>(CT_ONLY)){
  64. GiveAllCTsWeapon("weapon_breachcharge");
  65. }else if(BreachChargeToggle.IntValue == view_as<int>(T_ONLY)){
  66. GiveAllTsWeapon("weapon_breachcharge");
  67. }else if(BreachChargeToggle.IntValue == view_as<int>(ENABLED)){
  68. GiveAllPlayersWeapon("weapon_breachcharge");
  69. }
  70. if(MediShotToggle.IntValue == view_as<int>(CT_ONLY)){
  71. for(int num = 1; num <= MediShotNum.IntValue; num++){
  72. GiveAllCTsWeapon("weapon_healthshot");
  73. }
  74. }else if(MediShotToggle.IntValue == view_as<int>(T_ONLY)){
  75. for(int num = 1; num <= MediShotNum.IntValue; num++){
  76. GiveAllTsWeapon("weapon_healthshot");
  77. }
  78. }else if(MediShotToggle.IntValue == view_as<int>(ENABLED)){
  79. for(int num = 1; num <= MediShotNum.IntValue; num++){
  80. GiveAllPlayersWeapon("weapon_healthshot");
  81. }
  82. }
  83. if(ExoBootsToggle.IntValue == view_as<int>(CT_ONLY)){
  84. CCSPlayer p;
  85. while(CCSPlayer.Next(p)){
  86. if(p.InGame && p.Alive){
  87. if(p.Team == CS_TEAM_CT){
  88. SetEntProp(p.Index, Prop_Send, "m_passiveItems", 1, 1, 1);
  89. }
  90. }
  91. }
  92. }else if(ExoBootsToggle.IntValue == view_as<int>(T_ONLY)){
  93. CCSPlayer p;
  94. while(CCSPlayer.Next(p)){
  95. if(p.InGame && p.Alive){
  96. if(p.Team == CS_TEAM_T){
  97. SetEntProp(p.Index, Prop_Send, "m_passiveItems", 1, 1, 1);
  98. }
  99. }
  100. }
  101. }else if(ExoBootsToggle.IntValue == view_as<int>(ENABLED)){
  102. CCSPlayer p;
  103. while(CCSPlayer.Next(p)){
  104. if(p.InGame && p.Alive){
  105. SetEntProp(p.Index, Prop_Send, "m_passiveItems", 1, 1, 1);
  106. }
  107. }
  108. }
  109. }
  110.  
  111. public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast){
  112. CCSPlayer p;
  113. while(CCSPlayer.Next(p)){
  114. if(p.InGame && p.Alive){
  115. CWeapon wep = p.GetWeapon(CS_SLOT_C4);
  116. char weaponClassName[32];
  117. wep.GetClassname(weaponClassName, sizeof(weaponClassName));
  118. PrintToChatAll(weaponClassName);
  119. if(StrEqual(weaponClassName, "weapon_bumpmine")||StrEqual(weaponClassName, "weapon_breachcharge")){
  120. p.RemoveItem(wep);
  121. wep.Kill();
  122. }
  123. }
  124. }
  125. }
  126.  
  127. public void GiveAllPlayersWeapon(char[] weapon_Name){
  128. CCSPlayer p;
  129. while(CCSPlayer.Next(p)){
  130. if(p.InGame && p.Alive){
  131. GivePlayerWeapon(p, weapon_Name);
  132. }
  133. }
  134. }
  135.  
  136. public void GiveAllCTsWeapon(char[] weapon_Name){
  137. CCSPlayer p;
  138. while(CCSPlayer.Next(p)){
  139. if(p.InGame && p.Alive && p.Team == CS_TEAM_CT){
  140. GivePlayerWeapon(p, weapon_Name);
  141. }
  142. }
  143. }
  144.  
  145. public void GiveAllTsWeapon(char[] weapon_Name){
  146. CCSPlayer p;
  147. while(CCSPlayer.Next(p)){
  148. if(p.InGame && p.Alive && p.Team == CS_TEAM_T){
  149. GivePlayerWeapon(p, weapon_Name);
  150. }
  151. }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement