new plugin: SourceTV (join msg and chat)

This commit is contained in:
BotoX 2019-08-21 15:04:51 +02:00
parent 795c329f16
commit 37c292a8da

View File

@ -0,0 +1,38 @@
#include <sourcemod>
#include <sourcetvmanager>
#include <geoip>
#pragma newdecls required
public Plugin myinfo = {
name = "SourceTV",
author = "BotoX",
description = "SourceTV",
version = "1.0",
url = ""
}
public void OnPluginStart()
{
}
public void SourceTV_OnSpectatorPutInServer(int client)
{
static char sName[64];
static char sIP[16];
static char sCountry[32];
SourceTV_GetClientName(client, sName, sizeof(sName));
if(SourceTV_GetClientIP(client, sIP, sizeof(sIP)) && GeoipCountry(sIP, sCountry, sizeof(sCountry)))
PrintToChatAll("\x04[\x03SourceTV\x04] %s connected from %s", sName, sCountry);
else
PrintToChatAll("\x04[\x03SourceTV\x04] %s connected", sName);
}
public Action SourceTV_OnSpectatorChatMessage(int client, char message[255], char chatgroup[255])
{
PrintToChatAll("\x04[\x03SourceTV\x04]\x01 %s", message);
return Plugin_Handled;
}