Raised This Month: $51 Target: $400
 12% 

[TF2] Set Client Attribute


Post New Thread Reply   
 
Thread Tools Display Modes
Author
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Plugin ID:
5108
Plugin Version:
1.0.2
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Gives a player an attribute to it's client.
Old 04-03-2016 , 16:26   [TF2] Set Client Attribute
Reply With Quote #1

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.
Attached Files
File Type: sp Get Plugin or Get Source (SetAttribute.sp - 544 views - 3.6 KB)
File Type: smx SetAttribute.smx (5.7 KB, 707 views)
__________________

Last edited by StormishJustice; 04-10-2016 at 16:48. Reason: Version 1.0.2
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 04-07-2016 , 17:31   Re: [TF2] Set Client Attribute
Reply With Quote #2

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.
__________________
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
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 04-10-2016 , 16:32   Re: [TF2] Set Client Attribute
Reply With Quote #3

Quote:
Originally Posted by FlaminSarge View Post
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.
__________________

Last edited by StormishJustice; 04-10-2016 at 16:52.
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
cheddar
Member
Join Date: Sep 2015
Old 04-13-2016 , 06:35   Re: [TF2] Set Client Attribute
Reply With Quote #4

I've thought about doing something like this. Nice job!
cheddar is offline
Mayor Gamer
Senior Member
Join Date: Nov 2012
Location: GetLocationOfUser(me);
Old 05-11-2016 , 19:16   Re: [TF2] Set Client Attribute
Reply With Quote #5

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?
__________________

Last edited by Mayor Gamer; 05-11-2016 at 19:17.
Mayor Gamer is offline
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 05-12-2016 , 15:02   Re: [TF2] Set Client Attribute
Reply With Quote #6

Quote:
Originally Posted by Mayor Gamer View Post
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.
__________________
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
alexde5
Junior Member
Join Date: Nov 2014
Location: Florida
Old 05-17-2016 , 18:43   Re: [TF2] Set Client Attribute
Reply With Quote #7

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.
alexde5 is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 05-18-2016 , 23:33   Re: [TF2] Set Client Attribute
Reply With Quote #8

Double quote marks don't work properly in chat. You'll have to use this command through console.
__________________
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.

Last edited by FlaminSarge; 05-18-2016 at 23:33.
FlaminSarge is offline
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 05-19-2016 , 16:38   Re: [TF2] Set Client Attribute
Reply With Quote #9

Quote:
Originally Posted by alexde5 View Post
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)
__________________
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
Mayor Gamer
Senior Member
Join Date: Nov 2012
Location: GetLocationOfUser(me);
Old 05-26-2016 , 13:27   Re: [TF2] Set Client Attribute
Reply With Quote #10

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!
__________________
Mayor Gamer 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 04:30.


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