AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Set Client Attribute (https://forums.alliedmods.net/showthread.php?t=281152)

StormishJustice 04-03-2016 16:26

[TF2] Set Client Attribute
 
2 Attachment(s)
This plugin makes the player (you or anyone) have attributes on their class, just like "CharacterAttributes" on MvM Popfiles or Class Upgrades in MvM but you set the attribute yourself

The commands to this plugin are:
  • sm_setattribclient "target" "attribute name" "value"
  • sm_removeattribclient "target" "attribute name"
  • sm_removeallattribsclient "target"
For the attributes, go to http://optf2.com/440/attributes and search the attribute you want to add into yourself (typing attribute indexes will not work, only attribute names and value after the name)

Note this plugin requires TF2Attributes to work, if not then the plugin will not even work.

Changelog
Version 1.0.0 - Initial Release
Version 1.0.1 - Added sm_removeallattribsclient to remove all the attributes from client
Version 1.0.2 - Updated details of the plugin, removed filter alive players only since attributes doesn't remove when dead.

Credits
The credits are on the plugin's code.

If there's any problem with the plugin, please reply, i would be glad to help.

FlaminSarge 04-07-2016 17:31

Re: [TF2] Set Client Attribute
 
Out of curiousity, what's the purpose of "COMMAND_FILTER_ALIVE|args < 1" in the ProcessTargetString call?

Also, is there any functionality this provides that isn't currently in the tf2attributes_example plugin attached to TF2Attributes? If so, it'd be cool to highlight that in the plugin description.

Lastly, you should add TF2Attributes' plugin ID (on the plugin page) to this plugin's "Requirements" field. If you edit your post with a full edit (not a quick edit), you should see a field for dependencies/requirements.

StormishJustice 04-10-2016 16:32

Re: [TF2] Set Client Attribute
 
Quote:

Originally Posted by FlaminSarge (Post 2408919)
Out of curiousity, what's the purpose of "COMMAND_FILTER_ALIVE|args < 1" in the ProcessTargetString call?

Also, is there any functionality this provides that isn't currently in the tf2attributes_example plugin attached to TF2Attributes? If so, it'd be cool to highlight that in the plugin description.

Lastly, you should add TF2Attributes' plugin ID (on the plugin page) to this plugin's "Requirements" field. If you edit your post with a full edit (not a quick edit), you should see a field for dependencies/requirements.

1. Because attributes works even if player is dead (unlike addconds) and the reason why i did this because i don't think i should use other filters for that (taking off "|args < 1" will just need the player to type the command when is alive)
2. I just noticed the TF2Attributes example plugin, i did not know it can add attributes like this one but the one i made, was just to make people easily get that just incase some don't know the example does this, and this one i made only adds attributes to the client and not the weapons, and easier to use (a little bit), so yeah, it's not that functionable since some attributes can't seem to work well with my plugin (recharge bar attribute for example)
3. I did, it just doesn't show up sometimes, but i will try again.

cheddar 04-13-2016 06:35

Re: [TF2] Set Client Attribute
 
I've thought about doing something like this. Nice job!

Mayor Gamer 05-11-2016 19:16

Re: [TF2] Set Client Attribute
 
Wow! Incredible! Amazing job man!

May i ask you where did you begin learning SourcePawn @StormishJustice ?

Also, have you ever tought of implementing a MySQL database for the plugin so it saves the attributes on player even after disconnect?

StormishJustice 05-12-2016 15:02

Re: [TF2] Set Client Attribute
 
Quote:

Originally Posted by Mayor Gamer (Post 2418414)
Wow! Incredible! Amazing job man!

May i ask you where did you begin learning SourcePawn @StormishJustice ?

Also, have you ever tought of implementing a MySQL database for the plugin so it saves the attributes on player even after disconnect?

1. Back when i did something special with Red2Robot and maybe every other private giant plugins, i had fun with that i had to make some plugins with sourcepawn

2. No, i don't even know how to use a MySQL database plus i don't think applying attributes to the player even after disconnect will make it work a ton, it's that there's alot of plugins that use attributes on client and that's the worst part.

alexde5 05-17-2016 18:43

Re: [TF2] Set Client Attribute
 
So... How does one do this correctly? I kept doing something like
!sm_setattribclient @me "damage bonus" "600"

But it keeps giving me the help message on how to do it.
Help please, thanks.

FlaminSarge 05-18-2016 23:33

Re: [TF2] Set Client Attribute
 
Double quote marks don't work properly in chat. You'll have to use this command through console.

StormishJustice 05-19-2016 16:38

Re: [TF2] Set Client Attribute
 
Quote:

Originally Posted by alexde5 (Post 2419807)
So... How does one do this correctly? I kept doing something like
!sm_setattribclient @me "damage bonus" "600"

But it keeps giving me the help message on how to do it.
Help please, thanks.

Just like what FlaminSarge said, you need to type this in the console without the ! or / because an update on TF2 broke that function (or maybe sourcemod removed that method, either that or an update broke it)

Mayor Gamer 05-26-2016 13:27

Re: [TF2] Set Client Attribute
 
Interesting! I'm willing to learn SourcePawn when i get enough free time.
A small but worthy feature you should add is a message that confirms the Attribute Add on the client was sucessfully made. Also goes for removing attributes from the client. So we know it suceed on doing it!


All times are GMT -4. The time now is 21:11.

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