Skip to content

Instantly share code, notes, and snippets.

@sigsegv-mvm
Created August 2, 2015 07:10
Show Gist options
  • Save sigsegv-mvm/fd1b4f09c3bfb438dab6 to your computer and use it in GitHub Desktop.
Save sigsegv-mvm/fd1b4f09c3bfb438dab6 to your computer and use it in GitHub Desktop.
SourceMod plugin for detecting when players have conditions added/removed
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2>
public OnPluginStart()
{
PrintToServer("sigsegv's addcond/removecond detector");
}
public TF2_OnConditionAdded(client, TFCond:condition)
{
decl String:name[MAX_NAME_LENGTH];
GetClientName(client, name, sizeof(name));
// if (strcmp(name, "sigsegv") != 0) {
// return;
// }
PrintToChatAll("[%.3f] %s (#%d): ADDCOND %d", GetGameTime(), name, client, condition);
}
public TF2_OnConditionRemoved(client, TFCond:condition)
{
decl String:name[MAX_NAME_LENGTH];
GetClientName(client, name, sizeof(name));
// if (strcmp(name, "sigsegv") != 0) {
// return;
// }
PrintToChatAll("[%.3f] %s (#%d): REMOVECOND %d", GetGameTime(), name, client, condition);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment