added forward from connect announce to log in live chat the connect message with steamID

This commit is contained in:
jenz 2026-07-26 13:35:32 +02:00
parent b527ce5473
commit 8ef2f2f2cc

View File

@ -5,6 +5,7 @@
#include <multicolors> #include <multicolors>
#include <sourcemod> #include <sourcemod>
#include <Discord_UNLOZE> #include <Discord_UNLOZE>
#include <connect_announce>
#define API_URL "" #define API_URL ""
#define BOT_TOKEN "" #define BOT_TOKEN ""
@ -17,7 +18,7 @@ public Plugin myinfo =
name = "livechat stoat", name = "livechat stoat",
author = "jenz", author = "jenz",
description = "", description = "",
version = "1.1.0", version = "1.2.0",
url = "www.unloze.com" url = "www.unloze.com"
} }
@ -192,6 +193,49 @@ public Action Command_PrintToAdminChat_stoat(int args)
return Plugin_Handled; return Plugin_Handled;
} }
//ai SLOP
void StripColorTags(char[] buffer, int maxlen)
{
int len = strlen(buffer);
int writeIndex = 0;
bool inside = false;
for (int i = 0; i < len; i++)
{
if (buffer[i] == '{')
{
inside = true;
continue;
}
else if (buffer[i] == '}')
{
inside = false;
continue;
}
if (!inside && writeIndex < maxlen - 1)
{
buffer[writeIndex] = buffer[i];
writeIndex++;
}
}
buffer[writeIndex] = '\0';
}
public void GetPlayerConnectMessage(char[] message)
{
StripColorTags(message, strlen(message));
if (i_port == 27015)
{
SendToStoat("", message, "");
}
else if (i_port == 27017)
{
SendToStoat("", message, "");
}
}
public void GetDiscordToStoat(const char[] username, const char[] message, int type) public void GetDiscordToStoat(const char[] username, const char[] message, int type)
{ {
//type = 1. ADMINLOGS //type = 1. ADMINLOGS