p2svox

medic_0.3.4

Sep 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.97 KB | None | 0 0
  1. OnRoundStart()
  2. {
  3. VariableFloat.Set("radius", 50.0);
  4. VariableInt.Set("revTime", 5);
  5. VariableInt.Set("deathTime", 120);
  6. VariableInt.Set("cooldown", 30);
  7. VariableInt.Set("counterMain", 0);
  8. VariableInt.Set("cooldown0", 0);
  9. VariableInt.Set("cooldown1", 0);
  10. VariableInt.Set("cooldown2", 0);
  11. VariableInt.Set("cooldown3", 0);
  12. VariableInt.Set("cooldown4", 0);
  13. VariableInt.Set("cooldown5", 0);
  14. VariableInt.Set("cooldown6", 0);
  15. VariableInt.Set("cooldown7", 0);
  16. VariableInt.Set("cooldown8", 0);
  17. VariableInt.Set("cooldown9", 0);
  18. VariableInt.Set("cooldown10", 0);
  19. VariableInt.Set("cooldown11", 0);
  20. VariableInt.Set("cooldown12", 0);
  21. VariableInt.Set("cooldown13", 0);
  22. VariableInt.Set("cooldown14", 0);
  23. VariableInt.Set("cooldown15", 0);
  24. VariableInt.Set("cooldown16", 0);
  25. VariableInt.Set("cooldown17", 0);
  26. VariableInt.Set("cooldown18", 0);
  27. VariableInt.Set("cooldown19", 0);
  28. VariableInt.Set("cooldown20", 0);
  29. VariableInt.Set("cooldown21", 0);
  30. VariableInt.Set("cooldown22", 0);
  31. VariableInt.Set("cooldown23", 0);
  32. VariableInt.Set("cooldown24", 0);
  33. VariableInt.Set("cooldown25", 0);
  34. VariableInt.Set("cooldown26", 0);
  35. VariableInt.Set("cooldown27", 0);
  36. VariableInt.Set("cooldown28", 0);
  37. VariableInt.Set("cooldown29", 0);
  38. VariableString.Concat("radiusWhat", "<size=10>revive</size><size=1>___</size><size=10>radius</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableFloat("radius").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>meters</size>");
  39. Game.PrintMessage(VariableString("radiusWhat"));
  40. VariableString.Concat("revTimeWhat", "<size=10>revive</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("revTime").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  41. Game.PrintMessage(VariableString("revTimeWhat"));
  42. VariableString.Concat("deathWhat", "<size=10>death</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("deathTime").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  43. Game.PrintMessage(VariableString("deathWhat"));
  44. VariableString.Concat("cooldownWhat", "<size=10>cooldown</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("cooldown").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  45. Game.PrintMessage(VariableString("cooldownWhat"));
  46. }
  47. OnUpdate()
  48. {
  49. VariableInt.Set("counterPlayer", 0);
  50. VariablePlayer.Set("player", VariablePlayer("null"));
  51. ForeachPlayer("player")
  52. {
  53. VariableString.Concat("xDir","x",VariableInt("counterPlayer").ConvertToString());
  54. VariableString.Concat("yDir","y",VariableInt("counterPlayer").ConvertToString());
  55. VariableString.Concat("zDir","z",VariableInt("counterPlayer").ConvertToString());
  56. VariableString.Concat("revDir","rev",VariableInt("counterPlayer").ConvertToString());
  57. VariableString.Concat("deathDir","death",VariableInt("counterPlayer").ConvertToString());
  58. VariableString.Concat("cooldownDirMain","cooldown",VariableInt("counterPlayer").ConvertToString());
  59. If(Bool.Equals(VariablePlayer("player").GetIsAlive(), true))
  60. {
  61. VariableFloat.Set("x", VariablePlayer("player").GetPositionX());
  62. VariableFloat.Set("y", VariablePlayer("player").GetPositionY());
  63. VariableFloat.Set("z", VariablePlayer("player").GetPositionZ());
  64. If(Float.NotEquals(VariableFloat("x"), 0.0))
  65. {
  66. VariableFloat.Set(VariableString("xDir"), VariableFloat("x"));
  67. }
  68. If(Float.NotEquals(VariableFloat("y"), 0.0))
  69. {
  70. VariableFloat.Set(VariableString("yDir"), VariableFloat("y"));
  71. }
  72. If(Float.NotEquals(VariableFloat("z"), 0.0))
  73. {
  74. VariableFloat.Set(VariableString("zDir"), VariableFloat("z"));
  75. }
  76. VariableInt.Set(VariableString("revDir"), 0);
  77. VariableInt.Set(VariableString("deathDir"), 0);
  78. }
  79. If(Bool.Equals(VariablePlayer("player").GetIsAlive(), false))
  80. {
  81. If(Int.LessThan(VariableInt(VariableString("deathDir")), VariableInt("deathTime")))
  82. {
  83. VariableInt.Set("counterPlayerMedic", 0);
  84. VariablePlayer.Set("playerMedic", VariablePlayer("null"));
  85. ForeachPlayer("playerMedic")
  86. {
  87. VariableString.Concat("cooldownDirSub","cooldown",VariableInt("counterPlayer").ConvertToString());
  88. If(Player.NotEquals(VariablePlayer("player"), VariablePlayer("playerMedic")))
  89. {
  90. If(String.Equals(VariablePlayer("playerMedic").GetGuildName(), "[ffffff][ffffff]Medic"))
  91. {
  92. If(Bool.Equals(VariablePlayer("playerMedic").GetIsAlive(), true))
  93. {
  94. If(Int.LessThanOrEqual(VariableInt(VariableString("cooldownDirSub")), 0))
  95. {
  96. VariableFloat.Set("xgreater", VariableFloat(VariableString("xDir")));
  97. VariableFloat.Add("xgreater", VariableFloat("radius"));
  98. If(Float.LessThan(VariablePlayer("playerMedic").GetPositionX(), VariableFloat("xgreater")))
  99. {
  100. VariableFloat.Set("xless", VariableFloat(VariableString("xDir")));
  101. VariableFloat.Subtract("xless", VariableFloat("radius"));
  102. If(Float.GreaterThan(VariablePlayer("playerMedic").GetPositionX(), VariableFloat("xless")))
  103. {
  104. VariableFloat.Set("zgreater", VariableFloat(VariableString("zDir")));
  105. VariableFloat.Add("zgreater", VariableFloat("radius"));
  106. If(Float.LessThan(VariablePlayer("playerMedic").GetPositionZ(), VariableFloat("zgreater")))
  107. {
  108. VariableFloat.Set("zless", VariableFloat(VariableString("zDir")));
  109. VariableFloat.Subtract("zless", VariableFloat("radius"));
  110. If(Float.GreaterThan(VariablePlayer("playerMedic").GetPositionZ(), VariableFloat("zless")))
  111. {
  112. VariableInt.Add(VariableString("revDir"), 1);
  113. If(Int.Equals(VariableInt(VariableString("revDir")), 1))
  114. {
  115. VariableString.Concat("reviveWho", "<size=10>reviving</size><size=1>___</size><size=10>player</size><size=1>___</size><size=10>wait</size><size=1>___</size>","<size=15><color=#ff0000>", VariableInt("revTime").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  116. Game.PrintMessage(VariableString("reviveWho"));
  117. }
  118. If(Int.GreaterThanOrEqual(VariableInt(VariableString("revDir")), VariableInt("revTime")))
  119. {
  120. Player.SpawnPlayerAt(VariablePlayer("player"), VariablePlayer("playerMedic").GetPositionX(), VariablePlayer("playerMedic").GetPositionY(), VariablePlayer("playerMedic").GetPositionZ());
  121. VariableInt.Set(VariableString("revDir"), 0);
  122. VariableInt.Set(VariableString("cooldownDirSub"), VariableInt("cooldown"));
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. VariableInt.Add("counterPlayerMedic", 1);
  133. }
  134. }
  135. If(Int.Equals(VariableInt(VariableString("deathDir")), VariableInt("deathTime")))
  136. {
  137. Game.PrintMessage("<size=10>a</size><size=1>___</size><size=10>soldier</size><size=1>___</size><size=10>has</size><size=1>___</size><size=10>been</size><size=1>___</size><size=10>lost</size>")
  138. }
  139. VariableInt.Add(VariableString("deathDir"), 1);
  140. }
  141. VariableInt.Add("counterPlayer", 1);
  142. VariableInt.Subtract(VariableString("cooldownDirMain"), 1);
  143. }
  144. VariableInt.Add("counterMain", 1);
  145. }
  146. OnChatInput("chatInput")
  147. {
  148. If(String.StartsWith(VariableString("chatInput"), "/medic"))
  149. {
  150. VariableString.Remove("chatInput", "/medic");
  151. VariablePlayer.Set("player", VariablePlayer("null"));
  152. ForeachPlayer("player")
  153. {
  154. VariableBool.Set("passNotMedic", false);
  155. If(String.Contains(VariablePlayer("player").GetName(), VariableString("chatInput")))
  156. {
  157. If(String.NotEquals(VariablePlayer("player").GetGuildName(), "[ffffff][ffffff]Medic"))
  158. {
  159. Player.SetGuildName(VariablePlayer("player"), "[ffffff][ffffff]Medic");
  160. VariableString.Concat("AM", VariableString("chatInput"), "_is_now_medic");
  161. Game.PrintMessage(VariableString("AM"));
  162. VariableBool.Set("passNotMedic", true);
  163. }
  164. If(Bool.Equals(VariableBool("passNotMedic"), false))
  165. {
  166. If(String.Equals(VariablePlayer("player").GetGuildName(), "[ffffff][ffffff]Medic"))
  167. {
  168. Player.SetGuildName(VariablePlayer("player"), "");
  169. VariableString.Concat("ANM", VariableString("chatInput"), "_is_not_medic");
  170. Game.PrintMessage(VariableString("ANM"));
  171. }
  172. }
  173. }
  174. }
  175. }
  176. If(String.StartsWith(VariableString("chatInput"), "/revtime"))
  177. {
  178. VariableString.Remove("chatInput", "/revtime");
  179. VariableInt.Set("revTime", VariableString("chatInput").ConvertToInt());
  180. VariableString.Concat("revTimeWhat", "<size=10>revive</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("revTime").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  181. Game.PrintMessage(VariableString("revTimeWhat"));
  182. }
  183. If(String.StartsWith(VariableString("chatInput"), "/revradius"))
  184. {
  185. VariableString.Remove("chatInput", "/revradius");
  186. VariableFloat.Set("radius", VariableString("chatInput").ConvertToInt().ConvertToFloat());
  187. VariableString.Concat("radiusWhat", "<size=10>revive</size><size=1>___</size><size=10>radius</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableFloat("radius").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>meters</size>");
  188. Game.PrintMessage(VariableString("radiusWhat"));
  189. }
  190. If(String.StartsWith(VariableString("chatInput"), "/deathtime"))
  191. {
  192. VariableString.Remove("chatInput", "/deathtime");
  193. VariableInt.Set("deathTime", VariableString("chatInput").ConvertToInt());
  194. VariableString.Concat("deathWhat", "<size=10>death</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("deathTime").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  195. Game.PrintMessage(VariableString("deathWhat"));
  196. }
  197. If(String.StartsWith(VariableString("chatInput"), "/cooldown"))
  198. {
  199. VariableString.Remove("chatInput", "/cooldown");
  200. VariableInt.Set("cooldown", VariableString("chatInput").ConvertToInt());
  201. VariableString.Concat("cooldownWhat", "<size=10>cooldown</size><size=1>___</size><size=10>time</size><size=1>___</size><size=10>is</size><size=1>___</size>","<size=12><color=#ff4444>", VariableInt("cooldown").ConvertToString(),"</color></size>", "<size=1>___</size><size=10>seconds</size>");
  202. Game.PrintMessage(VariableString("cooldownWhat"));
  203. }
  204. }
Advertisement
Add Comment
Please, Sign In to add comment