@name Type
@inputs EGP:wirelink 
@outputs User:entity 
@persist Target:string AdminCommandIgnore:array BannedCommand:string CanPrint FromTo:array ToFrom:array FromToLast
@persist Down Cur Z X
interval(100)
runOnChat(1)

Cursor = EGP:egpCursor(User)

if (first()) {
    FromToLast = FromTo:count()-1
    function number newLine(String:string){
        local NewWord = String
        local Cur = 300
        if(NewWord != ""& FromToLast<FromTo:count()){
            FromToLast = FromTo:count()
            FromTo[FromTo:count()+1,string] = NewWord
            Down = Down + 5
            Cur = Cur + 1
            print(Down)
            #return Down, Cur
        
        }
        for(Z=300,Cur){
            for(X=1,FromTo:count()){
                EGP:egpText(Z,"<  "+FromTo[X,string],vec2(36,Down+5))
                X = X
                return Z, X, Down
            }
        }

    }
    function void createNew(){
        
    }
    AdminCommandIgnore = array("!goto","!tp","!jail","!ban","!kick","@")
    holoCreate(1)
    holoPos(1,entity():toWorld(vec(0,0,20)))
    holoColor(1,vec(255,255,255),0)
    
    EGP:egpClear()
    
    EGP:egpBox(1,vec2(256,256),vec2(512,512))
    EGP:egpColor(1,vec(65,65,65))
    EGP:egpAlign(1,1,1)
    
    EGP:egpBox(2,vec2(256,466),vec2(512,62))
    EGP:egpColor(2,vec(85,85,85))
    EGP:egpAlign(2,1,1)
    
    EGP:egpBox(3,vec2(56,466),vec2(92,42))
    EGP:egpColor(3,vec(35,35,35))
    EGP:egpAlign(3,1,1)
    
    EGP:egpBox(4,vec2(306,466),vec2(382,42))
    EGP:egpColor(4,vec(100,100,100))
    EGP:egpAlign(4,1,1)
    
    EGP:egpText(5,"Send",vec2(56,466))
    EGP:egpAlign(5,1,1)
}

findByClass("player")
User = findClosest(holoEntity(1):pos())

if (chatClk(User)) {
    UserLast = User:lastSaid()
    UserSaid = UserLast:explode(" ")
    for(I=1,AdminCommandIgnore:count()){
        BannedCommand = AdminCommandIgnore[I,string]
        if(UserSaid[1,string] == BannedCommand){
            print("Admin command ignored!") # Tells you if you sent a ignored command
            CanPrint = 0
            break
        }
        if(UserSaid[1,string] != BannedCommand){
            CanPrint = 1
        }
    }
    
    if(CanPrint==1){
        hideChat(1)
        newLine(UserLast)
        Target = UserSaid[1,string]:replace("!","")
        EGP:egpText(100,Target,vec2(306,466))
        EGP:egpAlign(100,1,1)
    }
}

if(inrange(Cursor,EGP:egpPos(3)-EGP:egpSize(3)/2,EGP:egpPos(3)+EGP:egpSize(3)/2) & User:keyUse()){
    EGP:egpRemove(100)
    #[EGP:egpColor(3,vec(120,120,120))]#
    EGP:egpText(Z,"<  "+ToFrom[X,string],vec2(36,Down+25))
} else { #[EGP:egpColor(3,vec(35,35,35))]# }

if(EGP:entity():pos():distance(User:pos()) > 100) {EGP}

EGP:egpCircle(111,vec2(0,0),vec2(8,8))
EGP:egpMaterial(111,"vgui/cursors/arrow")
EGP:egpParentToCursor(111)
