Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name SKY-MiniMap-V1
- @inputs Egp:wirelink
- @outputs
- @persist SizeChange SizePlus
- @trigger
- interval(2000)
- User = Egp["User",entity]
- if(first()){
- Egp:egpClear()
- Egp:egpBox(1000,vec2(255,255),vec2(515,515))
- Egp:egpColor(1000,vec(0,155,255))
- Egp:egpMaterial(1000, "gui/gradient_up")
- Egp:egpAlpha(1000,150)
- Egp:egpBox(200,vec2(255,450),vec2(515,390))
- Egp:egpColor(200,vec(0,180,20))
- Egp:egpMaterial(200,"gui/gradient_up")
- Egp:egpAlpha(200,150)
- function vector2 getPos(Player:entity,Size:number){
- local Middle = vec2(255,255)
- return (Middle+vec2(round(Player:pos()):x()/Size,round(Player:pos()):y()/Size))
- }
- function number touch(Index:number){
- return inrange(Egp:egpCursor(User),Egp:egpPos(Index)-Egp:egpSize(Index),Egp:egpPos(Index)+Egp:egpSize(Index))
- }
- function number generateBox(Num1:number,Num2:number,Num3:number,Position:vector2,Size:vector2,Text:string,TextSize:number){
- Egp:egpRoundedBox(Num1,Position,Size)
- Egp:egpRoundedBoxOutline(Num2,Position,Size+vec2(0.3))
- Egp:egpText(Num3,Text,vec2(0,-7))
- Egp:egpParent(Num3,Num1)
- Egp:egpAlign(Num3,1)
- Egp:egpColor(Num2,vec(0))
- Egp:egpColor(Num1,vec4(255,125,25,250))
- Egp:egpColor(Num3,vec(255))
- Egp:egpSize(Num3,vec2(TextSize))
- }
- SizeChange = 30
- Egp:egpRoundedBoxOutline(1,vec2(255,255),vec2(500,500))
- Egp:egpColor(1,vec(0))
- generateBox(2,3,4,vec2(50,490),vec2(40,40),"+",60)
- generateBox(5,6,7,vec2(95,490),vec2(40,40),"-",60)
- }
- if(Egp:entity()){
- if(touch(2)){
- if(User:keyUse()){
- SizeChange++
- }
- }
- if(touch(5)){
- if(User:keyUse()){
- SizeChange--
- }
- }
- if(changed(SizeChange)){
- Egp:egpText(8,"Current zoom "+SizeChange,vec2(140,480))
- }
- for(P = 1,players():count()){
- local Ply = players()[P,entity]
- Egp:egpPos(P+20,getPos(players()[P,entity],SizeChange))
- if((changed(Egp:entity())|changed(Ply:isAlive())|first()|duped()|clk("reset")) & Ply:isAlive()){
- Egp:egpColor(P+20+players():count(),teamColor(Ply:team()))
- }
- if(!Ply:isAlive()){
- Egp:egpColor(P+20+players():count(),vec(255,0,0))
- }
- if((changed(Ply:isAlive()))|first()|duped()){
- timer("reset",500)
- Egp:egpCircle(P+20,getPos(players()[P,entity],SizeChange),vec2(5,5))
- Egp:egpText(P+20+players():count(),Ply:name()+" ("+teamName(Ply:team())+")",vec2())
- Egp:egpParent(P+20+players():count(),P+20)
- Egp:egpSize(P+20+players():count(),15)
- Egp:egpColor(P+20,vec(20))
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement