Darkwater

Turret Control

Aug 31st, 2011
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. @name Turret control
  2. @inputs Next Screen:wirelink
  3. @outputs X Y Z On Target:string
  4. @persist Trg:entity List:array N Max
  5.  
  6. if(first()) {
  7. N = 1
  8. Trg = players()[N, entity]
  9. Max = players():count()
  10. }
  11.  
  12. if(first() | clk("update")) {
  13. List = players()
  14. timer("update", 2000)
  15. }
  16.  
  17. if(~Next & Next) {
  18. N += 1
  19. if(N > Max) {
  20. N = 1
  21. }
  22. Trg = Trg = players()[N, entity]
  23. } else {
  24. interval(100)
  25.  
  26. On = 1
  27.  
  28. X = Trg:pos():x()
  29. Y = Trg:pos():y()
  30. Z = Trg:pos():z() + 50
  31.  
  32. Target = Trg:name() + "\n" + teamName(Trg:team()) + "\n" + Trg:health()
  33.  
  34. Screen[2041] = 1
  35.  
  36. Screen:writeString("Turret Control", 0, 0)
  37. Screen:writeString("By Darkwater", 1, 1)
  38. Screen:writeString(Trg:name(), 1, 3)
  39. Screen:writeString("+ " + Trg:health(), 1, 4)
  40. Screen:writeString(teamName(Trg:team()), 1, 5)
  41.  
  42. for(I=1, players():count()) {
  43. P = " "
  44. if(I==N) {
  45. P = ">"
  46. }
  47. Screen:writeString(P + " " + players()[I,entity]:name(), 1, I + 6)
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment