From 37c292a8da10050c8a88d8c6059c6fd4edb67aed Mon Sep 17 00:00:00 2001 From: BotoX Date: Wed, 21 Aug 2019 15:04:51 +0200 Subject: [PATCH] new plugin: SourceTV (join msg and chat) --- SourceTV/scripting/SourceTV.sp | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 SourceTV/scripting/SourceTV.sp diff --git a/SourceTV/scripting/SourceTV.sp b/SourceTV/scripting/SourceTV.sp new file mode 100644 index 00000000..4da2ff63 --- /dev/null +++ b/SourceTV/scripting/SourceTV.sp @@ -0,0 +1,38 @@ +#include +#include +#include + +#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; +}