AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get name of entity (https://forums.alliedmods.net/showthread.php?t=117411)

Max! 01-31-2010 21:08

Get name of entity
 
Is there a way to get the name of an entity?.

I dont mean info_target or func_wall or something, I mean the name you can set in valve hammer. I made a map and I placed the entity func_wall around the map so I know where to place things in my code, but I need to get their name so i can distinguish them.

Exolent[jNr] 01-31-2010 21:10

Re: Get name of entity
 
These are your string constants:
Code:
enum {     EV_SZ_classname = 0,     EV_SZ_globalname,     EV_SZ_model,     EV_SZ_target,     EV_SZ_targetname,     EV_SZ_netname,     EV_SZ_message,     EV_SZ_noise,     EV_SZ_noise1,     EV_SZ_noise2,     EV_SZ_noise3,     EV_SZ_viewmodel,     EV_SZ_weaponmodel, }

Try each one and see the results.

Arkshine 02-01-2010 08:29

Re: Get name of entity
 
Quote:

Originally Posted by Max! (Post 1074633)
Is there a way to get the name of an entity?.

I dont mean info_target or func_wall or something, I mean the name you can set in valve hammer. I made a map and I placed the entity func_wall around the map so I know where to place things in my code, but I need to get their name so i can distinguish them.

Usually such entity have an unique model name. ( pev_model or EV_SZ_model )

Max! 02-04-2010 21:53

Re: Get name of entity
 
I changed the type of the entity to info_target, so now i just need to get the unique name of it. Im going to go try globalname now, ill let you know the results when im done, but assume they were negative until then ;D

Edit: Just wondering how to get all entitys of a specific type at the plugins init

Arkshine 02-05-2010 05:56

Re: Get name of entity
 
There is no unique name for such entity, except if you set in its pev a specific classname or something like.

"specific type" is quite vague.


All times are GMT -4. The time now is 07:26.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.