Raised This Month: $51 Target: $400
 12% 

Get ent model name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 08-20-2008 , 17:24   Get ent model name
Reply With Quote #1

Would it be possible to get an already created models name?

I already have the entity model index but I need to check the name somehow. The only way I could think to do this would be getting the entities key/value but I'm not sure how to do this on Source either.

Note: I went through all of the datamaps and netprops and found nothing except the model index.
hlstriker is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-20-2008 , 18:40   Re: Get ent model name
Reply With Quote #2

Here's how I check if the prop_dynamic animation I've hooked is a resupply locker in TF2:

Code:
        GetEntPropString(caller, Prop_Data, "m_ModelName", modelname, 128);
        if (StrEqual(modelname, "models/props_gameplay/resupply_locker.mdl"))
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 08-20-2008 , 18:49   Re: Get ent model name
Reply With Quote #3

Thanks that works perfectly!

I actually tried something similar but it just returned a bunch of jibberish...
PHP Code:
GetEntDataString(iEntFindDataMapOffs(iEnt"m_ModelName"), szModelsizeof(szModel)-1); 
hlstriker is offline
Muridias
Member
Join Date: Feb 2008
Old 08-21-2008 , 01:24   Re: Get ent model name
Reply With Quote #4

there no m_modelName
Muridias is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-21-2008 , 10:23   Re: Get ent model name
Reply With Quote #5

Quote:
Originally Posted by Muridias View Post
there no m_modelName
You can see in pred's dump that there is: http://users.alliedmods.net/~pred/tfdatamaps.txt

In my TF2NADES plugin I hook the play animation output on prop_dynamics and then do the check above to see if the model matches the respawn locker. If it does, they receive grenades. Since I get grenades, I know that it works.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Muridias
Member
Join Date: Feb 2008
Old 08-22-2008 , 14:06   Re: Get ent model name
Reply With Quote #6

Couldn't you just get distance from the resupply locker and if they are within distance give them grenades?

What do you mean you hooked play animation.

I tired looping all entities and get model names but the code breaks and errors out.
Muridias is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-24-2008 , 14:01   Re: Get ent model name
Reply With Quote #7

Quote:
Originally Posted by Muridias View Post
Couldn't you just get distance from the resupply locker and if they are within distance give them grenades?

What do you mean you hooked play animation.
I don't want to loop through all the entities, or even all the supply lockers, that often and then loop through all the players to see who's close by. It would cause too much lag. Instead I hooked the entity output when an animations starts and then check for players nearby to have their ammo restocked.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Muridias
Member
Join Date: Feb 2008
Old 08-24-2008 , 17:06   Re: Get ent model name
Reply With Quote #8

Quote:
Originally Posted by L. Duke View Post
I don't want to loop through all the entities, or even all the supply lockers, that often and then loop through all the players to see who's close by. It would cause too much lag. Instead I hooked the entity output when an animations starts and then check for players nearby to have their ammo restocked.

Good point.
Muridias is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:47.


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