Raised This Month: $32 Target: $400
 8% 

[HELP] Any other way ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 09-17-2013 , 08:56   [HELP] Any other way ?
Reply With Quote #1

Anyway to set attributs without using TF2Items_OnGiveNamedItem ?
__________________
Want to check my plugins ?
Arkarr is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-17-2013 , 09:21   Re: [HELP] Any other way ?
Reply With Quote #2

Quote:
Originally Posted by Arkarr View Post
Anyway to set attributs without using TF2Items_OnGiveNamedItem ?
Use the TF2Attributes plugin instead.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 09-17-2013 , 09:26   Re: [HELP] Any other way ?
Reply With Quote #3

thanks, will take a look.

EDIT: How I'm supposed to give the weapon just after editing is attributs ?
__________________
Want to check my plugins ?

Last edited by Arkarr; 09-17-2013 at 09:31.
Arkarr is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-17-2013 , 09:45   Re: [HELP] Any other way ?
Reply With Quote #4

Quote:
Originally Posted by Arkarr View Post
thanks, will take a look.

EDIT: How I'm supposed to give the weapon just after editing is attributs ?
TF2Attributes is meant to operate on items a player already has, and you'd usually use it with GetPlayerWeaponSlot when the post_inventory_application event happens.

tf2_stocks defines this enumeration:
Code:
enum
{
    TFWeaponSlot_Primary,
    TFWeaponSlot_Secondary,
    TFWeaponSlot_Melee,
    TFWeaponSlot_Grenade, // Engineer Construction Tool / Spy Disguise Kit
    TFWeaponSlot_Building, // Engineer Destruction Tool / Spy Cloaking Device
    TFWeaponSlot_PDA, // Engineer builder (without this, Engineer can't build)
    TFWeaponSlot_Item1, // Hat, can't be used with GetPlayerWeaponSlot
    TFWeaponSlot_Item2    // Misc, can't be used with GetPlayerWeaponSlot
};
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-17-2013 at 09:49.
Powerlord is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 09-17-2013 , 09:49   Re: [HELP] Any other way ?
Reply With Quote #5

So, this should work ?

PHP Code:
//Will increase my dammage by 800% only for my secondary weapon.
TF2Attrib_SetByDefIndex(12800.0
Assuming i'm using my secondary weapon.
__________________
Want to check my plugins ?

Last edited by Arkarr; 09-17-2013 at 09:49.
Arkarr is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-17-2013 , 10:43   Re: [HELP] Any other way ?
Reply With Quote #6

Quote:
Originally Posted by Arkarr View Post
So, this should work ?

PHP Code:
//Will increase my dammage by 800% only for my secondary weapon.
TF2Attrib_SetByDefIndex(12800.0
Assuming i'm using my secondary weapon.
More like...

PHP Code:
#include <tf2attributes>
#include <tf2_stocks>

public OnPluginStart()
{
    
HookEvent("post_inventory_application"Event_Inventory);
}

public 
Event_Inventory(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client 1)
        return;
    
    new 
secondary GetPlayerWeaponSlot(clientTFWeaponSlot_Secondary);
    if (
secondary != -1)
    {
        
TF2Attrib_SetByDefIndex(secondary28.0);
    }

__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 09-17-2013 , 12:06   Re: [HELP] Any other way ?
Reply With Quote #7

damm... okay, let's test it !
__________________
Want to check my plugins ?
Arkarr is offline
Reply


Thread Tools
Display Modes

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:51.


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