@name ChatterBox
@inputs Player:entity EGP:wirelink
@outputs Text:string
@persist 
@trigger 


runOnTick(20)
#Misc Functions and Variables
Owner = owner()
Ent = entity()
CMD= Owner:lastSaid():explode(" ")

Player = lastSpoke()
Text = Player:lastSaid()
if(chatClk(Player)){
if(Player:lastSaid()=="/advert Raid" | Player:lastSaid()=="/advert raid"){
    hint("Careful out there trooper", 4)
    }
}
#shortcut colors
Blue = vec(0,0,255)
Red  = vec(255,0,0)
Green= vec(0,255,0)
White= vec(255,255,255)
Yellow= vec(255,255,0)
#reader


#name

EGP:egpText(1,"Name: ",vec2(10,10))
EGP:egpColor(1,White)
EGP:egpText(2,Player:name(),vec2(60,10))
EGP:egpColor(2,White)
EGP:egpSize(2,20)
#admin?

EGP:egpText(3,"Admin: ",vec2(10,40))
EGP:egpColor(3,White)
if(Player:isAdmin()==1){
    EGP:egpText(4,"Yes",vec2(70,40))
    }
    else{
        EGP:egpText(4,"No",vec2(70,40))
        }
EGP:egpSize(3,20)
EGP:egpSize(4,20)
#job

EGP:egpText(5,"Job: ",vec2(10,70))
EGP:egpText(6,Player:team():teamName(),vec2(60,70))
#lastSaid

EGP:egpText(7,"Last Said: ",vec2(10,120))
EGP:egpSize(7,30)
EGP:egpText(8,Text,vec2(150,120))
EGP:egpSize(8,30)
EGP:egpColor(8,Red)

#distance
TX = Ent:pos():x()
TY = Ent:pos():y()
TZ = Ent:pos():z()

PX = Player:pos():x()
PY = Player:pos():y()
PZ = Player:pos():z()

DX = TX-PX
DY = TY-PY
DZ = TZ-PZ

TD1 = DX*DX + DY*DY
TDF = round(sqrt(DZ*DZ + TD1))

EGP:egpText(9,"Distance: ",vec2(10,200))
EGP:egpText(10,TDF:toString(),vec2(100,200))







