Replace STEAM_XXXXXXX with someone's SteamID. You can get a list of all the players' ID's by typing "status" in console. Replace Red,Green,and Blue with the color values of your choice, where 0,0,0 is black, 255,255,255 is white, 255,0,0 is red, etc etc.
Also, this particular chip only runs a find on its first execution. If players join or leave the game, you'll need to either re-place or re-upload the e2 chip for it to properly update its player list.
Code:
@name Hologram Radar
@persist Players:array Scale
if(first())
{
#find all players
findByClass("player")
Players = findToArray()
#spawn holograms for each player
for(Index=1,Players:count())
{
holoCreate(Index)
holoModel(Index,"hqicosphere")
holoScale(Index,vec(0.5,0.5,0.5))
holoMaterial(Index,"models/debug/debugwhite")
#check for custom colors
#owner
if(Players[Index,entity]:steamID() == owner():steamID())
{holoColor(Index,vec(Red,Green,Blue))}
#player name
if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
{holoColor(Index,vec(Red,Green,Blue))}
}
#black background
holoCreate(0)
holoModel(0,"plane")
holoScale(0,vec(40,40,1))
holoColor(0,vec())
holoAlpha(0,100)
holoMaterial(0,"models/debug/debugwhite")
runOnTick(1)
}
#move holograms
holoPos(0,entity():pos() + vec(0,0,5))
for(Index=1,Players:count())
{
holoPos(Index,entity():pos() + entity():toLocal(Players[Index,entity]:pos()) / vec(60,60,20) + vec(0,0,10))
}
It's pretty easy to add more players to your list; just copy/paste these two lines:
Code:
#player name
if(Players[Index,entity]:steamID() == "STEAM_XXXXXXXXX")
{holoColor(Index,vec(Red,Green,Blue))}
Make sure you place it inside the
block, though; you only need to set each holos' color once, rather than every tick.