TF2Attributes SourceMod plugin
https://forums.alliedmods.net/showthread.php?t=210221
Now featuring the following functionality from nosoop/tf2attributes
Add / remove temporary attributes on the player (using the game's own time-based expiry mechanism for it).
// replicates the temporary health bonus granted by the Dalokohs Bar:
TF2Attrib_AddCustomPlayerAttribute(client, "hidden maxhealth non buffed", 50.0, 30.0);
Adds the game's "attribute hook" mechanism that collates values using an attribute class:
// computes the final damage multiplier based on the given item and owner's attributes:
float damageBonus = TF2Attrib_HookValueFloat(1.0, "mult_dmg", weapon);
Support for setting / getting attribute values via strings:
// set an entity's custom projectile model:
TF2Attrib_SetFromStringValue(entity, "custom projectile model", "models/weapons/c_models/c_grenadelauncher/c_grenadelauncher.mdl");
// get the name from an item:
TF2Attrib_HookValueString("NO NAME", "custom_name_attr", entity, buffer, sizeof(buffer));
Setting custom names / descriptions is not possible. String values that are set by this plugin are not replicated to the client — this is fine for attributes that are only accessed on the server, but if you set any that the client will read, the client will crash on access.
All plugins compiled for previous versions should continue to work with this one. The installation instructions remain the same as before
- Download all the non-source code files in the latest release.
- Copy
tf2attributes.smx
toaddons/sourcemod/plugins/
. - Copy
tf2.attributes.txt
toaddons/sourcemod/gamedata/
. - If you're a developer, copy
tf2attributes.inc
toaddons/sourcemod/scripting/include/
(or the appropriate path for your compiler toolchain / project).