Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. @name Donate
  2. @inputs EGP:wirelink User:entity
  3. @outputs
  4. @persist Places:array Amounts:array PlacesNum SaveUser:entity DonationAmount
  5. @persist TopAmount TopPlayer:entity SecAmount SecPlayer:entity ThAmount ThPlayer:entity
  6. @trigger
  7.  
  8.  
  9. Cursor = EGP:egpCursor(User) #Defines Cursor
  10.  
  11. function number button(Num){
  12. return inrange(Cursor,EGP:egpPos(Num),EGP:egpPos(Num) + EGP:egpSize(Num)) #Function for buttons.
  13. }
  14.  
  15. if(first() || dupefinished()){
  16.  
  17.  
  18.  
  19. #background
  20. EGP:egpDrawTopLeft(1)
  21. EGP:egpBox(1,vec2(0,0),vec2(10,10))
  22. EGP:egpSize(1,vec2(550,550))
  23. EGP:egpColor(1,vec(32,32,32))
  24.  
  25. #frame
  26. EGP:egpDrawTopLeft(2)
  27. EGP:egpRoundedBox(2,vec2(30,330),vec2(10,10))
  28. EGP:egpSize(2,vec2(450,140))
  29. EGP:egpColor(2,vec(96,220,60))
  30.  
  31. EGP:egpDrawTopLeft(3)
  32. EGP:egpRoundedBox(3,vec2(30,40),vec2(10,10))
  33. EGP:egpSize(3,vec2(450,270))
  34. EGP:egpColor(3,vec(96,220,60))
  35.  
  36. EGP:egpText(4,"Donate",vec2(100,345))
  37. EGP:egpSize(4,100)
  38.  
  39. EGP:egpText(5,"1st :",vec2(40,40))
  40. EGP:egpSize(5,55)
  41.  
  42. EGP:egpText(6,"2nd : ",vec2(96,130))
  43. EGP:egpSize(6,40)
  44.  
  45. EGP:egpText(7,"3rd : ",vec2(139,230))
  46. EGP:egpSize(7,30)
  47.  
  48. }
  49.  
  50. interval(100)
  51.  
  52. if(button(2) || button(4)){
  53.  
  54. SaveUser=User
  55. moneyRequest(User,User:money())
  56.  
  57. }
  58.  
  59.  
  60. if(moneyClk()){
  61. AcountFound = 0
  62. for(I = 1,Places:count()){
  63. if(Places[I,entity] == SaveUser){PlacesNum = I AcountFound = 1}
  64. }
  65.  
  66.  
  67. if(AcountFound == 1){
  68. Amounts[PlacesNum,number] = Amounts[PlacesNum,number] + 1000
  69. }else{
  70. Places:pushEntity(SaveUser)
  71. Amounts:pushNumber(1000)
  72. }
  73.  
  74.  
  75.  
  76. for (I = 1,Amounts:count()){
  77. if(Amounts[I,number] > TopAmount){TopAmount = Amounts[I,number] TopPlayer = Places[I,entity]}
  78. }
  79.  
  80. for (I = 1,Amounts:count()){
  81. if(Amounts[I,number] > SecAmount && Amounts[I,number] < TopAmount){SecAmount = Amounts[I,number] SecPlayer = Places[I,entity]}
  82. }
  83.  
  84. for (I = 1,Amounts:count()){
  85. if(Amounts[I,number] > ThAmount && Amounts[I,number] < SecAmount){ThAmount = Amounts[I,number] ThPlayer = Places[I,entity]}
  86. }
  87.  
  88.  
  89. EGP:egpText(5,"1st :" + TopPlayer:name() ,vec2(40,40))
  90. EGP:egpSize(5,55)
  91.  
  92. EGP:egpText(6,"2nd : " + SecPlayer:name(),vec2(96,130))
  93. EGP:egpSize(6,40)
  94.  
  95. EGP:egpText(7,"3rd : " + ThPlayer:name(),vec2(139,230))
  96. EGP:egpSize(7,20)
  97.  
  98.  
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement