p2svox

AoTTG_Fall_Damage_v1.0.2

Sep 12th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.39 KB | None | 0 0
  1. OnRoundStart()
  2. {
  3. Game.PrintMessage("<size=17>Fall_Damage_Custom_Logic</size>");
  4. Game.PrintMessage("<size=12>Ensure_player_count_does_not_exceed_10</size>");
  5. VariableFloat.Set("speedThreshold", 13.0);
  6. VariableFloat.Set("xThreshold", 15.0);
  7. VariableFloat.Set("yThreshold", 75.0);
  8. VariableFloat.Set("zThreshold", 15.0);
  9. VariableFloat.Set("nxThreshold", -15.0);
  10. VariableFloat.Set("nyThreshold", -15.0);
  11. VariableFloat.Set("nzThreshold", -15.0);
  12. VariableFloat.Set("clearance", 0.5);
  13. VariableFloat.Set("nclearance", -0.5);
  14. VariableFloat.Set("oldSpeed0", 0.0);
  15. VariableFloat.Set("oldSpeed1", 0.0);
  16. VariableFloat.Set("oldSpeed2", 0.0);
  17. VariableFloat.Set("oldSpeed3", 0.0);
  18. VariableFloat.Set("oldSpeed4", 0.0);
  19. VariableFloat.Set("oldSpeed5", 0.0);
  20. VariableFloat.Set("oldSpeed6", 0.0);
  21. VariableFloat.Set("oldSpeed7", 0.0);
  22. VariableFloat.Set("oldSpeed8", 0.0);
  23. VariableFloat.Set("oldSpeed9", 0.0);
  24.  
  25. VariableFloat.Set("eoldSpeed0", 0.0);
  26. VariableFloat.Set("eoldSpeed1", 0.0);
  27. VariableFloat.Set("eoldSpeed2", 0.0);
  28. VariableFloat.Set("eoldSpeed3", 0.0);
  29. VariableFloat.Set("eoldSpeed4", 0.0);
  30. VariableFloat.Set("eoldSpeed5", 0.0);
  31. VariableFloat.Set("eoldSpeed6", 0.0);
  32. VariableFloat.Set("eoldSpeed7", 0.0);
  33. VariableFloat.Set("eoldSpeed8", 0.0);
  34. VariableFloat.Set("eoldSpeed9", 0.0);
  35.  
  36. VariableFloat.Set("x0", 0.0);
  37. VariableFloat.Set("x1", 0.0);
  38. VariableFloat.Set("x2", 0.0);
  39. VariableFloat.Set("x3", 0.0);
  40. VariableFloat.Set("x4", 0.0);
  41. VariableFloat.Set("x5", 0.0);
  42. VariableFloat.Set("x6", 0.0);
  43. VariableFloat.Set("x7", 0.0);
  44. VariableFloat.Set("x8", 0.0);
  45. VariableFloat.Set("x9", 0.0);
  46.  
  47. VariableFloat.Set("y0", 0.0);
  48. VariableFloat.Set("y1", 0.0);
  49. VariableFloat.Set("y2", 0.0);
  50. VariableFloat.Set("y3", 0.0);
  51. VariableFloat.Set("y4", 0.0);
  52. VariableFloat.Set("y5", 0.0);
  53. VariableFloat.Set("y6", 0.0);
  54. VariableFloat.Set("y7", 0.0);
  55. VariableFloat.Set("y8", 0.0);
  56. VariableFloat.Set("y9", 0.0);
  57.  
  58. VariableFloat.Set("z0", 0.0);
  59. VariableFloat.Set("z1", 0.0);
  60. VariableFloat.Set("z2", 0.0);
  61. VariableFloat.Set("z3", 0.0);
  62. VariableFloat.Set("z4", 0.0);
  63. VariableFloat.Set("z5", 0.0);
  64. VariableFloat.Set("z6", 0.0);
  65. VariableFloat.Set("z7", 0.0);
  66. VariableFloat.Set("z8", 0.0);
  67. VariableFloat.Set("z9", 0.0);
  68.  
  69. VariableFloat.Set("vx0", 0.0);
  70. VariableFloat.Set("vx1", 0.0);
  71. VariableFloat.Set("vx2", 0.0);
  72. VariableFloat.Set("vx3", 0.0);
  73. VariableFloat.Set("vx4", 0.0);
  74. VariableFloat.Set("vx5", 0.0);
  75. VariableFloat.Set("vx6", 0.0);
  76. VariableFloat.Set("vx7", 0.0);
  77. VariableFloat.Set("vx8", 0.0);
  78. VariableFloat.Set("vx9", 0.0);
  79.  
  80. VariableFloat.Set("vy0", 0.0);
  81. VariableFloat.Set("vy1", 0.0);
  82. VariableFloat.Set("vy2", 0.0);
  83. VariableFloat.Set("vy3", 0.0);
  84. VariableFloat.Set("vy4", 0.0);
  85. VariableFloat.Set("vy5", 0.0);
  86. VariableFloat.Set("vy6", 0.0);
  87. VariableFloat.Set("vy7", 0.0);
  88. VariableFloat.Set("vy8", 0.0);
  89. VariableFloat.Set("vy9", 0.0);
  90.  
  91. VariableFloat.Set("vz0", 0.0);
  92. VariableFloat.Set("vz1", 0.0);
  93. VariableFloat.Set("vz2", 0.0);
  94. VariableFloat.Set("vz3", 0.0);
  95. VariableFloat.Set("vz4", 0.0);
  96. VariableFloat.Set("vz5", 0.0);
  97. VariableFloat.Set("vz6", 0.0);
  98. VariableFloat.Set("vz7", 0.0);
  99. VariableFloat.Set("vz8", 0.0);
  100. VariableFloat.Set("vz9", 0.0);
  101.  
  102. VariableFloat.Set("evx0", 0.0);
  103. VariableFloat.Set("evx1", 0.0);
  104. VariableFloat.Set("evx2", 0.0);
  105. VariableFloat.Set("evx3", 0.0);
  106. VariableFloat.Set("evx4", 0.0);
  107. VariableFloat.Set("evx5", 0.0);
  108. VariableFloat.Set("evx6", 0.0);
  109. VariableFloat.Set("evx7", 0.0);
  110. VariableFloat.Set("evx8", 0.0);
  111. VariableFloat.Set("evx9", 0.0);
  112.  
  113. VariableFloat.Set("evy0", 0.0);
  114. VariableFloat.Set("evy1", 0.0);
  115. VariableFloat.Set("evy2", 0.0);
  116. VariableFloat.Set("evy3", 0.0);
  117. VariableFloat.Set("evy4", 0.0);
  118. VariableFloat.Set("evy5", 0.0);
  119. VariableFloat.Set("evy6", 0.0);
  120. VariableFloat.Set("evy7", 0.0);
  121. VariableFloat.Set("evy8", 0.0);
  122. VariableFloat.Set("evy9", 0.0);
  123.  
  124. VariableFloat.Set("evz0", 0.0);
  125. VariableFloat.Set("evz1", 0.0);
  126. VariableFloat.Set("evz2", 0.0);
  127. VariableFloat.Set("evz3", 0.0);
  128. VariableFloat.Set("evz4", 0.0);
  129. VariableFloat.Set("evz5", 0.0);
  130. VariableFloat.Set("evz6", 0.0);
  131. VariableFloat.Set("evz7", 0.0);
  132. VariableFloat.Set("evz8", 0.0);
  133. VariableFloat.Set("evz9", 0.0);
  134. }
  135. OnUpdate()
  136. {
  137. VariableInt.Set("counter", 0);
  138. VariablePlayer.Set("player", VariablePlayer("null"));
  139. ForeachPlayer("player")
  140. {
  141. VariableString.Concat("xDir","x",VariableInt("counter").ConvertToString());
  142. VariableString.Concat("yDir","y",VariableInt("counter").ConvertToString());
  143. VariableString.Concat("zDir","z",VariableInt("counter").ConvertToString());
  144. VariableString.Concat("vxDir","vx",VariableInt("counter").ConvertToString());
  145. VariableString.Concat("vyDir","vy",VariableInt("counter").ConvertToString());
  146. VariableString.Concat("vzDir","vz",VariableInt("counter").ConvertToString());
  147. VariableString.Concat("evxDir","evx",VariableInt("counter").ConvertToString());
  148. VariableString.Concat("evyDir","evy",VariableInt("counter").ConvertToString());
  149. VariableString.Concat("evzDir","evz",VariableInt("counter").ConvertToString());
  150. VariableFloat.Set("x", VariablePlayer("player").GetPositionX());
  151. VariableFloat.Set("y", VariablePlayer("player").GetPositionY());
  152. VariableFloat.Set("z", VariablePlayer("player").GetPositionZ());
  153. VariableFloat.Subtract("x", VariableFloat(VariableString("xDir")));
  154. VariableFloat.Subtract("y", VariableFloat(VariableString("yDir")));
  155. VariableFloat.Subtract("z", VariableFloat(VariableString("zDir")));
  156. VariableFloat.Set("vx", VariableFloat("x"));
  157. VariableFloat.Set("vy", VariableFloat("y"));
  158. VariableFloat.Set("vz", VariableFloat("z"));
  159. VariableFloat.Set("x", VariablePlayer("player").GetPositionX());
  160. VariableFloat.Set("y", VariablePlayer("player").GetPositionY());
  161. VariableFloat.Set("z", VariablePlayer("player").GetPositionZ());
  162. VariableString.Concat("oldSpeedDir","oldSpeed",VariableInt("counter").ConvertToString());
  163. VariableString.Concat("eoldSpeedDir","eoldSpeed",VariableInt("counter").ConvertToString());
  164.  
  165. VariableFloat.Set("speedCompareTemp", VariablePlayer("player").GetSpeed());
  166. VariableFloat.Add("speedCompareTemp", VariableFloat("speedThreshold"))
  167. If(Float.GreaterThan(VariableFloat(VariableString("oldSpeedDir")), VariableFloat("speedCompareTemp")))
  168. {
  169.  
  170. If(Float.GreaterThan(VariableFloat(VariableString("vxDir")), VariableFloat("xThreshold")))
  171. {
  172. If(Float.GreaterThan(VariableFloat(VariableString("evxDir")), 0.0))
  173. {
  174. If(Float.LessThan(VariableFloat("vx"), VariableFloat("clearance")))
  175. {
  176. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  177. }
  178. }
  179. If(Float.LessThan(VariableFloat(VariableString("evxDir")), 0.0))
  180. {
  181. If(Float.GreaterThan(VariableFloat("vx"), VariableFloat("nclearance")))
  182. {
  183. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  184. }
  185. }
  186. }
  187. If(Float.LessThan(VariableFloat(VariableString("vxDir")), VariableFloat("nxThreshold")))
  188. {
  189. If(Float.GreaterThan(VariableFloat(VariableString("evxDir")), 0.0))
  190. {
  191. If(Float.LessThan(VariableFloat("vx"), VariableFloat("clearance")))
  192. {
  193. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  194. }
  195. }
  196. If(Float.LessThan(VariableFloat(VariableString("evxDir")), 0.0))
  197. {
  198. If(Float.GreaterThan(VariableFloat("vx"), VariableFloat("nclearance")))
  199. {
  200. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  201. }
  202. }
  203. }
  204.  
  205. If(Float.GreaterThan(VariableFloat(VariableString("vzDir")), VariableFloat("zThreshold")))
  206. {
  207. If(Float.GreaterThan(VariableFloat(VariableString("evzDir")), 0.0))
  208. {
  209. If(Float.LessThan(VariableFloat("vz"), VariableFloat("clearance")))
  210. {
  211. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  212. }
  213. }
  214. If(Float.LessThan(VariableFloat(VariableString("evzDir")), 0.0))
  215. {
  216. If(Float.GreaterThan(VariableFloat("vz"), VariableFloat("nclearance")))
  217. {
  218. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  219. }
  220. }
  221. }
  222. If(Float.LessThan(VariableFloat(VariableString("vzDir")), VariableFloat("nzThreshold")))
  223. {
  224. If(Float.GreaterThan(VariableFloat(VariableString("evzDir")), 0.0))
  225. {
  226. If(Float.LessThan(VariableFloat("vz"), VariableFloat("clearance")))
  227. {
  228. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  229. }
  230. }
  231. If(Float.LessThan(VariableFloat(VariableString("evzDir")), 0.0))
  232. {
  233. If(Float.GreaterThan(VariableFloat("vz"), VariableFloat("nclearance")))
  234. {
  235. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  236. }
  237. }
  238. }
  239.  
  240. If(Float.GreaterThan(VariableFloat(VariableString("vyDir")), VariableFloat("yThreshold")))
  241. {
  242. If(Float.GreaterThan(VariableFloat(VariableString("evyDir")), 0.0))
  243. {
  244. If(Float.LessThan(VariableFloat("vy"), VariableFloat("clearance")))
  245. {
  246. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  247. }
  248. }
  249. If(Float.LessThan(VariableFloat(VariableString("evyDir")), 0.0))
  250. {
  251. If(Float.GreaterThan(VariableFloat("vy"), VariableFloat("nclearance")))
  252. {
  253. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  254. }
  255. }
  256. }
  257. If(Float.LessThan(VariableFloat(VariableString("vyDir")), VariableFloat("nyThreshold")))
  258. {
  259. If(Float.GreaterThan(VariableFloat(VariableString("evyDir")), 0.0))
  260. {
  261. If(Float.LessThan(VariableFloat("vy"), VariableFloat("clearance")))
  262. {
  263. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  264. }
  265. }
  266. If(Float.LessThan(VariableFloat(VariableString("evyDir")), 0.0))
  267. {
  268. If(Float.GreaterThan(VariableFloat("vy"), VariableFloat("nclearance")))
  269. {
  270. Player.KillPlayer(VariablePlayer("player"),"Ouch")
  271. }
  272. }
  273. }
  274.  
  275. }
  276.  
  277.  
  278.  
  279. VariableFloat.Set(VariableString("xDir"), VariableFloat("x"));
  280. VariableFloat.Set(VariableString("yDir"), VariableFloat("y"));
  281. VariableFloat.Set(VariableString("zDir"), VariableFloat("z"));
  282. VariableFloat.Set(VariableString("evxDir"), VariableFloat(VariableString("vxDir")));
  283. VariableFloat.Set(VariableString("evyDir"), VariableFloat(VariableString("vyDir")));
  284. VariableFloat.Set(VariableString("evzDir"), VariableFloat(VariableString("vzDir")));
  285. VariableFloat.Set(VariableString("vxDir"), VariableFloat("vx"));
  286. VariableFloat.Set(VariableString("vyDir"), VariableFloat("vy"));
  287. VariableFloat.Set(VariableString("vzDir"), VariableFloat("vz"));
  288. VariableFloat.Set("playerSpeed", VariablePlayer("player").GetSpeed());
  289. VariableFloat.Set(VariableString("eoldSpeedDir"), VariableFloat(VariableString("oldSpeedDir")));
  290. VariableFloat.Set(VariableString("oldSpeedDir"), VariableFloat("playerSpeed"));
  291. VariableInt.Add("counter", 1);
  292. }
  293. }
Advertisement
Add Comment
Please, Sign In to add comment