new plugin: SourceTV (join msg and chat)
This commit is contained in:
parent
795c329f16
commit
37c292a8da
38
SourceTV/scripting/SourceTV.sp
Normal file
38
SourceTV/scripting/SourceTV.sp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user