added forward for the connect message so stoat can log it to livechat

This commit is contained in:
jenz 2026-07-26 13:18:28 +02:00
parent 921ae4e136
commit b527ce5473
2 changed files with 34 additions and 0 deletions

View File

@ -17,6 +17,8 @@ Database g_hDatabase;
Handle g_hCustomMessageFile; Handle g_hCustomMessageFile;
Handle g_hCustomMessageFile2; Handle g_hCustomMessageFile2;
static Handle g_hForwardConnectMessage;
bool g_bHideCsays[MAXPLAYERS + 1] = { false, ... }; bool g_bHideCsays[MAXPLAYERS + 1] = { false, ... };
Handle g_hCookieHideCsays = null; Handle g_hCookieHideCsays = null;
@ -72,6 +74,17 @@ public void OnDatabaseConnect(Database db, const char[] error, any data)
g_hDatabase = db; g_hDatabase = db;
} }
public APLRes AskPluginLoad2(Handle myself, bool late, char [] error, int err_max)
{
g_hForwardConnectMessage = CreateGlobalForward("GetPlayerConnectMessage", ET_Ignore, Param_String);
return APLRes_Success;
}
public void OnPluginEnd()
{
CloseHandle(g_hForwardConnectMessage);
}
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
// Purpose: // Purpose:
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -176,6 +189,7 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
delete menu; delete menu;
} }
} }
return 0;
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
@ -390,6 +404,9 @@ public void GetPlayerTier(int client, int tier)
if (!CheckCommandAccess(client, "sm_joinmsg", ADMFLAG_CUSTOM1)) if (!CheckCommandAccess(client, "sm_joinmsg", ADMFLAG_CUSTOM1))
{ {
CPrintToChatAll(sRawMsg); CPrintToChatAll(sRawMsg);
Call_StartForward(g_hForwardConnectMessage);
Call_PushString(sRawMsg);
Call_Finish();
return; return;
} }
@ -416,6 +433,10 @@ public void GetPlayerTier(int client, int tier)
if(StrEqual(sCustomMessage, "reset") || StrEqual(sBanned, "true")) if(StrEqual(sCustomMessage, "reset") || StrEqual(sBanned, "true"))
{ {
CPrintToChatAll(sRawMsg); CPrintToChatAll(sRawMsg);
Call_StartForward(g_hForwardConnectMessage);
Call_PushString(sRawMsg);
Call_Finish();
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(IsClientInGame(i)) if(IsClientInGame(i))
@ -431,6 +452,10 @@ public void GetPlayerTier(int client, int tier)
{ {
Format(sFinalMessage, sizeof(sFinalMessage), "%s %s", sRawMsg, sCustomMessage); Format(sFinalMessage, sizeof(sFinalMessage), "%s %s", sRawMsg, sCustomMessage);
CPrintToChatAll(sFinalMessage); CPrintToChatAll(sFinalMessage);
Call_StartForward(g_hForwardConnectMessage);
Call_PushString(sRawMsg);
Call_Finish();
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(IsClientInGame(i)) if(IsClientInGame(i))
@ -447,6 +472,9 @@ public void GetPlayerTier(int client, int tier)
else else
{ {
CPrintToChatAll(sRawMsg); CPrintToChatAll(sRawMsg);
Call_StartForward(g_hForwardConnectMessage);
Call_PushString(sRawMsg);
Call_Finish();
for(int i = 1; i <= MaxClients; i++) for(int i = 1; i <= MaxClients; i++)
{ {
if(IsClientInGame(i)) if(IsClientInGame(i))

View File

@ -0,0 +1,6 @@
#if defined _connect_announce_included_
#endinput
#endif
#define _connect_announce_included_
forward void GetPlayerConnectMessage(char[] message);