Now more importantly I'm using a bullet trace to find scripted entities, and I'm able to display and change the origin of the entities etc so the bullet trace is working correctly, I just want to know if there's a way to display the name of the entity?
Eg.
Code: Select all
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
self iprintlnbold(trace["entity"].origin);
self iprintlnbold(trace["entity"].name);//this is the line I need help with
If I use trace["entity"].classname I get script_brushmodel printed, however this doesn't really help as I need to work out the names of entities, such as platform_1 etc.
EDIT: Nvm got it, thanks to IzNoGod. It's trace["entity"].targetname, can't believe I didn't think of that