added forward from connect announce to log in live chat the connect message with steamID
This commit is contained in:
parent
b527ce5473
commit
8ef2f2f2cc
@ -5,6 +5,7 @@
|
||||
#include <multicolors>
|
||||
#include <sourcemod>
|
||||
#include <Discord_UNLOZE>
|
||||
#include <connect_announce>
|
||||
|
||||
#define API_URL ""
|
||||
#define BOT_TOKEN ""
|
||||
@ -17,7 +18,7 @@ public Plugin myinfo =
|
||||
name = "livechat stoat",
|
||||
author = "jenz",
|
||||
description = "",
|
||||
version = "1.1.0",
|
||||
version = "1.2.0",
|
||||
url = "www.unloze.com"
|
||||
}
|
||||
|
||||
@ -192,6 +193,49 @@ public Action Command_PrintToAdminChat_stoat(int args)
|
||||
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)
|
||||
{
|
||||
//type = 1. ADMINLOGS
|
||||
|
||||
Loading…
Reference in New Issue
Block a user