Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. @name SKY-MiniMap-V1
  2. @inputs Egp:wirelink
  3. @outputs
  4. @persist SizeChange SizePlus
  5. @trigger
  6. interval(2000)
  7. User = Egp["User",entity]
  8. if(first()){
  9.  
  10. Egp:egpClear()
  11. Egp:egpBox(1000,vec2(255,255),vec2(515,515))
  12. Egp:egpColor(1000,vec(0,155,255))
  13. Egp:egpMaterial(1000, "gui/gradient_up")
  14. Egp:egpAlpha(1000,150)
  15. Egp:egpBox(200,vec2(255,450),vec2(515,390))
  16. Egp:egpColor(200,vec(0,180,20))
  17. Egp:egpMaterial(200,"gui/gradient_up")
  18. Egp:egpAlpha(200,150)
  19.  
  20. function vector2 getPos(Player:entity,Size:number){
  21. local Middle = vec2(255,255)
  22. return (Middle+vec2(round(Player:pos()):x()/Size,round(Player:pos()):y()/Size))
  23. }
  24. function number touch(Index:number){
  25. return inrange(Egp:egpCursor(User),Egp:egpPos(Index)-Egp:egpSize(Index),Egp:egpPos(Index)+Egp:egpSize(Index))
  26. }
  27. function number generateBox(Num1:number,Num2:number,Num3:number,Position:vector2,Size:vector2,Text:string,TextSize:number){
  28. Egp:egpRoundedBox(Num1,Position,Size)
  29. Egp:egpRoundedBoxOutline(Num2,Position,Size+vec2(0.3))
  30. Egp:egpText(Num3,Text,vec2(0,-7))
  31. Egp:egpParent(Num3,Num1)
  32. Egp:egpAlign(Num3,1)
  33. Egp:egpColor(Num2,vec(0))
  34. Egp:egpColor(Num1,vec4(255,125,25,250))
  35. Egp:egpColor(Num3,vec(255))
  36. Egp:egpSize(Num3,vec2(TextSize))
  37. }
  38. SizeChange = 30
  39. Egp:egpRoundedBoxOutline(1,vec2(255,255),vec2(500,500))
  40. Egp:egpColor(1,vec(0))
  41. generateBox(2,3,4,vec2(50,490),vec2(40,40),"+",60)
  42. generateBox(5,6,7,vec2(95,490),vec2(40,40),"-",60)
  43. }
  44. if(Egp:entity()){
  45.  
  46. if(touch(2)){
  47. if(User:keyUse()){
  48.  
  49. SizeChange++
  50. }
  51. }
  52. if(touch(5)){
  53. if(User:keyUse()){
  54. SizeChange--
  55. }
  56. }
  57. if(changed(SizeChange)){
  58. Egp:egpText(8,"Current zoom "+SizeChange,vec2(140,480))
  59. }
  60. for(P = 1,players():count()){
  61. local Ply = players()[P,entity]
  62.  
  63. Egp:egpPos(P+20,getPos(players()[P,entity],SizeChange))
  64.  
  65. if((changed(Egp:entity())|changed(Ply:isAlive())|first()|duped()|clk("reset")) & Ply:isAlive()){
  66. Egp:egpColor(P+20+players():count(),teamColor(Ply:team()))
  67. }
  68. if(!Ply:isAlive()){
  69. Egp:egpColor(P+20+players():count(),vec(255,0,0))
  70. }
  71. if((changed(Ply:isAlive()))|first()|duped()){
  72. timer("reset",500)
  73. Egp:egpCircle(P+20,getPos(players()[P,entity],SizeChange),vec2(5,5))
  74. Egp:egpText(P+20+players():count(),Ply:name()+" ("+teamName(Ply:team())+")",vec2())
  75. Egp:egpParent(P+20+players():count(),P+20)
  76. Egp:egpSize(P+20+players():count(),15)
  77. Egp:egpColor(P+20,vec(20))
  78. }
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement