p2svox

AoTTG_Fall_Damage_v1.0.0

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