Raised This Month: $ Target: $400
 0% 

What's the best way to detect entity type?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 12-22-2006 , 05:57   Re: What's the best way to detect entity type?
Reply With Quote #7

There is an array of weapon model strings. Each index corresponds to weapon id. I have an entity id. By classname i detected that it's a weapon ("weaponbox").Then i need to detect a weapon id. Sequental comparison of strings is a shitty method, but 100% workable.

I thought i can do like this:
1) first time detect a weapon id by sequantal comparison of model strings
2) make an association of modelindex -> weapon_id into modelindex2wid array assuming max model index is (for example) 255; so, next time i can get a weapon id immediately: weapon_id = modelindex2wid[entity.modelindex]

But that's not working (see my previous post)!

Is there any other common pev value for weapons of the same type/model, but unique for different types of weapons?
Simon Logic is offline
Send a message via Skype™ to Simon Logic
 



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 22:29.


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