Raised This Month: $ Target: $400
 0% 

TF2 Getting weapon's attributes?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 12-28-2010 , 02:47   TF2 Getting weapon's attributes?
Reply With Quote #1

is there any ways to normal read all 15 m_iAttributeDefinitionIndex?

and how the hell read 32bit integer in sp?
__________________

Last edited by Leonardo; 12-29-2010 at 00:45.
Leonardo is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 12-28-2010 , 07:45   Re: TF2 Getting weapon's attributes?
Reply With Quote #2

Quote:
Originally Posted by Leonardo View Post
is there any ways to normal read all 15 m_iAttributeDefinitionIndex?

and how the hell read 32bit integer in sp? -.-
All Pawn integers are 32bit, so just read it like any int.

Not sure what the hell you're talking about in your first question though.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 12-28-2010 , 09:58   Re: TF2 Getting weapon's attributes?
Reply With Quote #3

Code:
        Sub-Class Table (8 Deep): DT_AttributeList
         Sub-Class Table (9 Deep): _ST_m_Attributes_15
          Sub-Class Table (10 Deep): _LPT_m_Attributes_15
          -Member: lengthprop15 (offset 0) (type integer) (bits 4)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
          Sub-Class Table (10 Deep): DT_ScriptCreatedAttribute
          -Member: m_iAttributeDefinitionIndex (offset 4) (type integer) (bits 32)
          -Member: m_flValue (offset 8) (type float) (bits 0)
with GetEntProp(iEntity, Prop_Send, "m_iAttributeDefinitionIndex", 32); it said "wrong integer".

my idea to check if weapon have same attribute.

Last edited by Leonardo; 01-09-2011 at 06:45.
Leonardo is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 12-28-2010 , 11:00   Re: TF2 Getting weapon's attributes?
Reply With Quote #4

You're reading 32 bytes, not bits, if you use GetEntProp(iEntity, Prop_Send, "m_iAttributeDefinitionIndex", 32);
Byte = 8 bit.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 12-28-2010 , 12:55   Re: TF2 Getting weapon's attributes?
Reply With Quote #5

oh, I was blind.

but anyway
I've got only one strange value.

EDIT:
for example
Southern Hospitality
m_iAttributeDefinitionIndex = 510281320
m_flValue = 0.000000
attributes:
crit mod disabled (15) - 0.0
bleeding duration (149) - 5.0
dmg taken from fire increased (61) - 1.20
__________________

Last edited by Leonardo; 12-28-2010 at 13:18.
Leonardo is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-06-2011 , 16:14   Re: TF2 Getting weapon's attributes?
Reply With Quote #6

anyone?
__________________
Leonardo is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 01-08-2011 , 03:33   Re: TF2 Getting weapon's attributes?
Reply With Quote #7

Since it's a...table... you might have to use... GetEntData and offsets?
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-09-2011 , 06:43   Re: TF2 Getting weapon's attributes?
Reply With Quote #8

trying to get first attribute
PHP Code:
public Action:Event_PlayerDeath(Handle:hEventString:sName[], bool:bDontBroadcast)
{
    new 
iVictim GetClientOfUserId(GetEventInt(hEvent"userid"));
    new 
iAttacker GetClientOfUserId(GetEventInt(hEvent"attacker"));
    
    if(
iVictim<=|| iVictim>MaxClients || !IsClientConnected(iVictim) || !IsClientAuthorized(iVictim))
        return 
Plugin_Continue;
    
    if(
iAttacker<=|| iAttacker>MaxClients || iAttacker==iVictim || !IsClientConnected(iAttacker) || !IsClientAuthorized(iAttacker))
        return 
Plugin_Continue;
    
    if(
GetEventInt(hEvent"death_flags") & (1<<5))
        return 
Plugin_Continue;
    
    new 
iAttackerWeapon GetPlayerWeaponSlot(iAttacker2);
    if(
IsValidEntity(iAttackerWeapon))
    {
        
decl String:sWeaponClass[128];
        
decl iOffset;
        
decl String:sResult[32];
        
        
iOffset FindSendPropOffs(sWeaponClass"DT_AttributeList")+9*2+10;
        
GetEntityNetClass(iAttackerWeaponsWeaponClasssizeof(sWeaponClass));
        
GetEntDataString(iAttackerWeaponiOffsetsResultsizeof(sResult));
        
        
PrintToChatAll("%s"sWeaponClass);
        
PrintToChatAll("%i | %f | %s"GetEntData(iAttackerWeaponiOffset), GetEntDataFloat(iAttackerWeaponiOffset), sResult);
    }
    
    return 
Plugin_Continue;

PHP Code:
CTFRobotArm
16 
0.000000 |  
but it must be #26

where I'm wrong now?
__________________
Leonardo is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 01-09-2011 , 14:51   Re: TF2 Getting weapon's attributes?
Reply With Quote #9

On the same topic, is it possible to read a Weapon (or any item for that matter) custom_name or custom_desc that is set by a name tag, etc? Not change them, but just read them.

Scuzzy
Scuzzy is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-10-2011 , 04:30   Re: TF2 Getting weapon's attributes?
Reply With Quote #10

boo. need some help with offsets =\ too hard for me at this moment.
__________________
Leonardo 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 08:45.


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