Skip to content

Mentrillum/tf2attributes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf2attributes

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.

Installing or updating to 1.7

All plugins compiled for previous versions should continue to work with this one. The installation instructions remain the same as before

  1. Download all the non-source code files in the latest release.
  2. Copy tf2attributes.smx to addons/sourcemod/plugins/.
  3. Copy tf2.attributes.txt to addons/sourcemod/gamedata/.
  4. If you're a developer, copy tf2attributes.inc to addons/sourcemod/scripting/include/ (or the appropriate path for your compiler toolchain / project).

About

TF2Attributes SourceMod plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SourcePawn 100.0%