Raised This Month: $ Target: $400
 0% 

how do i get attribute value?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sglee241
Junior Member
Join Date: Mar 2009
Old 06-08-2014 , 09:39   how do i get attribute value?
Reply With Quote #1

I want to change attribute according to original value.

if item already have damage buff like direct hit, make more powerful.

i tried code below, but all weapon damage stuck in 150%..


Code:
public Action:TF2Items_OnGiveNamedItem(client, String:classname[], iItemDefinitionIndex, &Handle:hItem)
{
 static Handle:item = INVALID_HANDLE;
 if( item != INVALID_HANDLE )
 {
  CloseHandle(item);
  item = INVALID_HANDLE;
 }
 
 item = TF2Items_CreateItem(OVERRIDE_ATTRIBUTES|PRESERVE_ATTRIBUTES);
 TF2Items_SetAttribute(item, 2, 1.5) // 150% damage.
 TF2Items_SetNumAttributes(item, 1);
 
 if( item != INVALID_HANDLE )
 {
  hItem = item;
  return Plugin_Changed;
 }
 
 return Plugin_Continue;
}
sglee241 is offline
 



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


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