Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Donate
- @inputs EGP:wirelink User:entity
- @outputs
- @persist Places:array Amounts:array PlacesNum SaveUser:entity DonationAmount
- @persist TopAmount TopPlayer:entity SecAmount SecPlayer:entity ThAmount ThPlayer:entity
- @trigger
- Cursor = EGP:egpCursor(User) #Defines Cursor
- function number button(Num){
- return inrange(Cursor,EGP:egpPos(Num),EGP:egpPos(Num) + EGP:egpSize(Num)) #Function for buttons.
- }
- if(first() || dupefinished()){
- #background
- EGP:egpDrawTopLeft(1)
- EGP:egpBox(1,vec2(0,0),vec2(10,10))
- EGP:egpSize(1,vec2(550,550))
- EGP:egpColor(1,vec(32,32,32))
- #frame
- EGP:egpDrawTopLeft(2)
- EGP:egpRoundedBox(2,vec2(30,330),vec2(10,10))
- EGP:egpSize(2,vec2(450,140))
- EGP:egpColor(2,vec(96,220,60))
- EGP:egpDrawTopLeft(3)
- EGP:egpRoundedBox(3,vec2(30,40),vec2(10,10))
- EGP:egpSize(3,vec2(450,270))
- EGP:egpColor(3,vec(96,220,60))
- EGP:egpText(4,"Donate",vec2(100,345))
- EGP:egpSize(4,100)
- EGP:egpText(5,"1st :",vec2(40,40))
- EGP:egpSize(5,55)
- EGP:egpText(6,"2nd : ",vec2(96,130))
- EGP:egpSize(6,40)
- EGP:egpText(7,"3rd : ",vec2(139,230))
- EGP:egpSize(7,30)
- }
- interval(100)
- if(button(2) || button(4)){
- SaveUser=User
- moneyRequest(User,User:money())
- }
- if(moneyClk()){
- AcountFound = 0
- for(I = 1,Places:count()){
- if(Places[I,entity] == SaveUser){PlacesNum = I AcountFound = 1}
- }
- if(AcountFound == 1){
- Amounts[PlacesNum,number] = Amounts[PlacesNum,number] + 1000
- }else{
- Places:pushEntity(SaveUser)
- Amounts:pushNumber(1000)
- }
- for (I = 1,Amounts:count()){
- if(Amounts[I,number] > TopAmount){TopAmount = Amounts[I,number] TopPlayer = Places[I,entity]}
- }
- for (I = 1,Amounts:count()){
- if(Amounts[I,number] > SecAmount && Amounts[I,number] < TopAmount){SecAmount = Amounts[I,number] SecPlayer = Places[I,entity]}
- }
- for (I = 1,Amounts:count()){
- if(Amounts[I,number] > ThAmount && Amounts[I,number] < SecAmount){ThAmount = Amounts[I,number] ThPlayer = Places[I,entity]}
- }
- EGP:egpText(5,"1st :" + TopPlayer:name() ,vec2(40,40))
- EGP:egpSize(5,55)
- EGP:egpText(6,"2nd : " + SecPlayer:name(),vec2(96,130))
- EGP:egpSize(6,40)
- EGP:egpText(7,"3rd : " + ThPlayer:name(),vec2(139,230))
- EGP:egpSize(7,20)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement