View Single Post
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-19-2013 , 18:36   Re: [TF2Items] Give Weapon (v3.14, 01/23/2013)
Reply With Quote #1006

Question about some of the coding, mainly this stuff in the GiveWeaponOfIndex stock:

PHP Code:
SetEntProp(entityProp_Send"m_iEntityLevel", (-128+11));
GetClientAuthString(clientstrSteamIDsizeof(strSteamID));
if (
StrEqual(strSteamID"STEAM_0:0:00000000"))
{
    
SetEntProp(entityProp_Send"m_iEntityQuality"8);

How would one go about adding in more details for the weapon such as attributes?

I was kind of reading along in the tf2items.inc file, and I saw this stuff:
PHP Code:
native TF2Items_SetLevel(Handle:hItemiEntityLevel);

native TF2Items_SetNumAttributes(Handle:hItemiNumAttributes);

native TF2Items_SetAttribute(Handle:hItemiSlotIndexiAttribDefIndexFloat:flValue); 
So I thought I'd try by myself to add in an attribute to this weapon, for example a particle effect. I tried this:

PHP Code:
GetClientAuthString(clientstrSteamIDsizeof(strSteamID));
if (
StrEqual(strSteamID"STEAM_0:0:00000000"))
{
    
SetEntProp(entityProp_Send"m_iEntityLevel"100);
    
SetEntProp(entityProp_Send"m_iSlotIndex"0); //I assume slot index refers to "this is the <1st/2nd/3rd/4th/5th/etc> attribute"
    
SetEntProp(entityProp_Send"m_iAttribDefIndex"134);
    
SetEntProp(entityProp_Send"m_flValue"1);

That obviously didn't work ingame, it just made me lose the weapon in the slot where this weapon was supposed to be. Obviously, the flValue isn't meant to go in the SetEntProp, I guess.

Any help on adding in an attribute/many attributes, on a "case" basis, based on a players Steam ID, would be great, and you could also apply it to the plugin (i.e. adding the Community Sparkle effect to Reag's Jar of Ants, or the Self-Made Khopesh Climber that I see has been coded in).
404UserNotFound is offline