Getting the name or ID of the person you're looking at.

Is there any way to do this in the console without using lua?

There was a dude who came on my server and crashed it out with adv dupe… but kind of warned me ahead of time before he did it… I had a small frame of time to respond but didn’t get to ban him. (I later looked at the log and banned him) but I was curious if there was any way to get the name of the player I am looking at? If so. I can bind a key to ban the player I am looking at.

Thanks.

Err… to get the steamID you type status in console, but that shows ALL steamIDs. I’m pretty sure their name pops up above their head.

Sounds like it can’t be done then? Atleast the way I want it done. I can get the steam ID of a person in the console. I just need a faster way to ban them… to get the ID of a single person. The person I am looking at. I would like to combine this. Example: ulx banuser %target person’s id%. If I could combine these command parameters. I would have a simple 1 key ban system.

Thanks for the reply.

well, what are you running, i know in SM there’s an argument like @all but it’s where you’re looking, so you could just bind a key to “sm_ban @look “i looked at you” 99999” but idk that actual argument, if you are running vanilla, you can’t do it

If you’re on a server without scriptenforcer, you could run this:


lua_run_cl local t=LocalPlayer():GetEyeTrace() if ValidEntity(t.Entity) and t.Entity:IsPlayer() then RunConsoleCommand("youradminmodsidbancommand", t.Entity:SteamID(), "100", "I looked at you") end

You will need to replace the command and arguments there with your admin mod’s ban ID command and parameters.

OR
you could make a facer turret that has a ranger that outputs steam ID.
Then displays that information onto a HUD.

@inputs EGP:wirelink SteamID

runOnTick(1)

#FACER TURRET CODE HERE…
#HAVE IT HOVER ABOVE YOUR HEAD…

EGP:egpText(1, SteamID, vec2(100,256))
EGP:egpAlign(1,1,1)
EGP:egpSize(1,40)

Wow, these are some really good ideas, thanks to all of you who posted.