Note that Klaus Veen's Treason is NOT fully supported by SourceMod as of 7/21/2026, and so has no official extension or wrapper. This is my way of centralizing all of my KVT plugins' most important functions (fetching data from KVT) to make my life easier.
The first goal of this project is to condense the amount of code required to interact with Treason-exclusive data, which improves readability. An example of this is fetching a client's Treason role using a single function "GetClientRole()".
The second goal of this project is to remove the need to patch every KVT plugin in the future, replacing it with a single plugin update.
The third (more recent) goal of this project is to expand the modding capabilities of Klaus Veen's Treason in a helpful direction. Hopefully, this API and its companion plugins will make Treason modding more accessible and open up new possibilities to those who create SourceMod plugins for Treason.
This project was originally made for my own personal use, but I hope people find use in it!
tapi_deathmatchmusic
- "Enables the 'carend.wav' sound that plays at the end of carnage rounds if not set to 0. Disabling this has minor visual downsides, such as the winner name being '[REDACTED]'. To remedy this, the winner is placed in chat."
tapi
- Displays the current version of TAPI in the console.
tapi_int
- Displays the current integer version of TAPI in the console.
tapi_cr_debug
- "Displays debugging messages in the server console when set to 1. Primarily intended for custom role development."
tapi_keybind1
- "The key used to forcebind console command 'tapi_action1' for all clients."
tapi_cr_min_traitor
- "The minimum amount of custom traitor-roles to consider assigning to traitors at round start, when possible."
tapi_cr_min_innocent
- "The minimum amount of custom innocent-roles to consider assigning to innocents at round start, when possible."
tapi_cr_min_solo
- "The minimum amount of custom solo-roles to consider assigning to innocents at round start, when possible."
tapi_cr_max_traitor
- "The maximum amount of custom traitor-roles to consider assigning to traitors at round start, when possible."
tapi_cr_max_innocent
- "The maximum amount of custom innocent-roles to consider assigning to innocents at round start, when possible."
tapi_cr_max_solo
- "The maximum amount of custom solo-roles to consider assigning to innocents at round start, when possible. In any normal game, you likely don't want this to be greater than 1."
tapi_action1
- Intended to be registered by custom role plugins that wish to automatically bind an action to a player's keyboard.
- List all the currently registered custom roles.
- Semantic clone of
tapi_listcr
- Semantic clone of
tapi_listcr
- Prints the current custom role index of the player.
- Semantic clone of
tcr_get
- Sets the current custom role index of the player.
- Semantic clone of
tcr_set