Couch/EventNotifier changes

This commit is contained in:
2026-10-08 16:28:13 +01:00
parent 54a921c1a5
commit 82d16c163a
3 changed files with 53 additions and 12 deletions
+7 -6
View File
@@ -40,7 +40,7 @@ public void OnPluginStart()
RegAdminCmd("sm_gotocouch", Command_GotoCouch, ADMFLAG_CHANGEMAP, "Teleports you to the couch");
RegAdminCmd("sm_removecouch", Command_RemoveCouch, ADMFLAG_CHANGEMAP, "Removes the couch");
RegAdminCmd("sm_couchpistolonly", Command_PistolOnly, ADMFLAG_CHANGEMAP, "sm_couchpistolonly [0|1] - only pistols and knives move the couch; no argument toggles");
RegAdminCmd("sm_couchlog", Command_Log, ADMFLAG_CHANGEMAP, "sm_couchlog [0|1] - show who moves the couch and how in your console, grenades in chat too; no argument toggles");
RegAdminCmd("sm_couchlog", Command_Log, ADMFLAG_CHANGEMAP, "sm_couchlog [0|1] - show who moves the couch and how in your console; no argument toggles");
}
// Game time restarts with the map.
@@ -314,7 +314,7 @@ void DoSetLogging(int client, bool bEnable)
g_bLogging[client] = bEnable;
if (bEnable)
PrintToChat(client, PREFIX ... "\x01Couch log \x04on\x01, see your console for who moves the couch and how. Grenades also show here.");
PrintToChat(client, PREFIX ... "\x01Couch log \x04on\x01, see your console for who moves the couch and how.");
else
PrintToChat(client, PREFIX ... "\x01Couch log \x04off\x01.");
}
@@ -325,6 +325,11 @@ void DoSetLogging(int client, bool bEnable)
public void Couch_OnCouchInteraction(int couch, int client, CouchMethod method, const char[] weapon)
{
// Grenades are rare and knock the couch far, so everyone is told. One blast is one report, so no
// rate limit is needed. The userid is there so an admin can put it straight into sm_couchban.
if (method == CouchMethod_Grenade)
PrintToChatAll("\x01[Couch] \x04%N\x01 (#%d) hit the couch with a \x04grenade", client, GetClientUserId(client));
if (!AnyoneLogging())
return;
@@ -354,7 +359,6 @@ public void Couch_OnCouchInteraction(int couch, int client, CouchMethod method,
default: FormatEx(sHow, sizeof(sHow), "moved the couch with %s", weapon[0] != '\0' ? weapon : "something");
}
// Everything goes to the console; grenades are rare and knock the couch far, so they go to chat too.
// The userid is there so it can go straight into sm_couchban.
int userid = GetClientUserId(client);
for (int i = 1; i <= MaxClients; i++)
@@ -363,9 +367,6 @@ public void Couch_OnCouchInteraction(int couch, int client, CouchMethod method,
continue;
PrintToConsole(i, "[Couch] %N (#%d) %s", client, userid, sHow);
if (method == CouchMethod_Grenade)
PrintToChat(i, "\x01[Couch] \x04%N\x01 (#%d) hit the couch with a \x04grenade", client, userid);
}
}