-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/nosoop/tf2attributes
- Loading branch information
Showing
5 changed files
with
1,359 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,49 @@ | ||
# tf2attributes | ||
|
||
TF2Attributes SourceMod plugin | ||
|
||
https://forums.alliedmods.net/showthread.php?t=210221 | ||
|
||
## Now featuring the following functionality from [nosoop/tf2attributes](https://github.com/nosoop/tf2attributes) | ||
|
||
Add / remove temporary attributes on the player (using the game's own time-based expiry | ||
mechanism for it). | ||
|
||
```sourcepawn | ||
// 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: | ||
|
||
```sourcepawn | ||
// 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: | ||
|
||
```sourcepawn | ||
// 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). | ||
|
||
[the latest release]: https://github.com/flaminsarge/tf2attributes/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.