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

[TF2] Targe/Resistance checking


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DPErny
Junior Member
Join Date: Jun 2009
Old 12-19-2009 , 18:59   [TF2] Targe/Resistance checking
Reply With Quote #1

Hello again, Allied Modders forums!

I am the author of a plugin that you may remember known as Medieval Fortress. I've decided to completely recode Medieval Fortress! There is only one problem...

Medieval Fortress used a (to my knowledge) fairly common method of checking for the weapons I wanted to restrict to: I checked "m_iEntityQuality" to see it the weapon is an unlock. Unfortunately, both the Targe and Scottish Resistance are slot 0 unlocks, and I need to stop people from using the Resistance. Is there any other value I could check to see if the person is wielding the Targe or not?

I thank you all in advance for your help!
DPErny is offline
Regis
Member
Join Date: Sep 2009
Old 12-19-2009 , 22:10   Re: [TF2] Targe/Resistance checking
Reply With Quote #2

Use this method, targe is index 131.

PHP Code:
if (GetEntProp(WeaponProp_Send"m_iItemDefinitionIndex") != 131
Regis is offline
DPErny
Junior Member
Join Date: Jun 2009
Old 12-21-2009 , 00:19   Re: [TF2] Targe/Resistance checking
Reply With Quote #3

Quote:
Originally Posted by Regis View Post
Use this method, targe is index 131.

PHP Code:
if (GetEntProp(WeaponProp_Send"m_iItemDefinitionIndex") != 131

Thank you very much.

I don't want to be a bother, so if nobody feels like answering this part of the question don't worry about it, but what exactly is "m_iItemDefinitionIndex"? I like to know what it is that I'm coding, not just copy and paste.
DPErny is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 12-21-2009 , 01:04   Re: [TF2] Targe/Resistance checking
Reply With Quote #4

Quote:
Originally Posted by DPErny View Post
Thank you very much.

I don't want to be a bother, so if nobody feels like answering this part of the question don't worry about it, but what exactly is "m_iItemDefinitionIndex"? I like to know what it is that I'm coding, not just copy and paste.
It's the item index, each weapon has its own unique index. Read more here.
noodleboy347 is offline
DPErny
Junior Member
Join Date: Jun 2009
Old 12-21-2009 , 01:07   Re: [TF2] Targe/Resistance checking
Reply With Quote #5

Quote:
Originally Posted by noodleboy347 View Post
It's the item index, each weapon has its own unique index. Read more here.
Oh, thanks. That knowledge will come in handy in the future.
DPErny 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 20:15.


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