Senior Member
|
11-14-2019
, 20:02
Re: Entity real name
|
#9
|
Quote:
Originally Posted by OciXCrom
No. Each entity can be assigned a name in VHE.
It should indeed be targetname. Take a look at this BaseBuilder mod - https://forums.alliedmods.net/showthread.php?t=144287
It uses entities named "barrier" to do stuff.
PHP Code:
g_iEntBarrier = find_ent_by_tname( -1, "barrier" );
And entities named "ignore" for other things. Here the guy got the name like this:
PHP Code:
new szClass[10], szTarget[7]; entity_get_string(ent, EV_SZ_classname, szClass, 9); entity_get_string(ent, EV_SZ_targetname, szTarget, 6); if (!equal(szClass, "func_wall") || equal(szTarget, "ignore")) return PLUGIN_HANDLED;
|
It didnt work aswell, im trying to get the entity name and print it in chat after it gets destroyed/killed
Correct me if i was mistaken
PHP Code:
new szTargetname[7], szName[32] get_user_name( killer, szName, charsmax(szName)) entity_get_string(ent, EV_SZ_targetname, szTargetname, 6)
client_print(0, print_chat, "*%s* was broken by *%s*", szTargetname , szName)
BTW, im not sure if targetname gets the entity name after it gets destroyed/killed, i think it gets the name when you aim on the entity
Quote:
Originally Posted by JocAnis
i have been fighting with these names from VHE for 2man kz maps, and how i remember it was a little confusing, like target in .sma was name in VHE or something like that, try these things:
Code:
1)
entity_get_string( ent, EV_SZ_target, target, charsmax( target ) )
entity_get_string( ent, EV_SZ_targetname, target2, charsmax( target2 ) )
and i had this also:
2)
new targetent = FM_NULLENT;
//this below was done in plugin_init, cant remember if it must be there, but just to let you know:
while(( targetent = engfunc(EngFunc_FindEntityByString, targetent, "name", target ) != 0))
{
//your code
}
i dont have time to test it again, but i think second one is more accurate, you can test it
|
I have tried both of these, not working
PHP Code:
entity_get_string( ent, EV_SZ_target, target, charsmax( target ) ) entity_get_string( ent, EV_SZ_targetname, target2, charsmax( target2 ) )
Whats the 'target'? the 4th arg in engfunc
PHP Code:
while(( targetent = engfunc(EngFunc_FindEntityByString, targetent, "name", target ) != 0))
Quote:
Originally Posted by DJEarthQuake
Pizza Hut's Entity Info.
TO DO: Find_sphere_class_highlighting.
Secret Door from Crossfire
Entity 258
EV_INT_movetype = 7
EV_INT_solid = 4
EV_INT_modelindex = 64
EV_INT_spawnflags = 768
EV_INT_rendermode = 1
EV_FL_ltime = 2.940000
EV_FL_nextthink = -1.000000
EV_FL_speed = 200.000000
EV_FL_renderamt = 150.000000
EV_VEC_movedir = (-0.000000,0.000000,-1.000000)
EV_VEC_absmin = (638.000000,1438.000000,-1858.000000)
EV_VEC_absmax = (658.000000,1522.000000,-1758.000000)
EV_VEC_mins = (639.000000,1439.000000,-1857.000000)
EV_VEC_maxs = (657.000000,1521.000000,-1759.000000)
EV_VEC_size = (18.000000,82.000000,98.000000)
EV_VEC_rendercolor = (0.000000,255.000000,0.000000)
EV_ENT_pContainingEntity = 258
EV_SZ_classname = func_door
EV_SZ_model = *63
EV_SZ_targetname = secret_door
EV_SZ_noise1 = common/null.wav
EV_SZ_noise2 = doors/doorstop4.wav
Others:
Entity Network Monitor.
Entity Lab (Engine based) [Final]
Entity Tool
Ent Fun: unlock door!
Code:
new entlist[513];
find_sphere_class(0,"classname_to_find",radius_float,entlist,512,origin_vector);
https://developer.valvesoftware.com/...-Life_entities
https://wiki.alliedmods.net/Finding_Entities_(AMX_Mod_X)
|
Im not sure if I understood all of it, but it seems your method shows the name when you aim on it
Quote:
Originally Posted by JocAnis
It is possible to do, what exactly do you need?
|
Print the entity name after it gets killed/destroyed
Last edited by ZaX; 11-14-2019 at 20:03.
|
|