2016-01-19 23:57:32 +01:00
|
|
|
#pragma semicolon 1
|
|
|
|
|
|
|
|
#include <sourcemod>
|
2018-03-23 14:18:30 +01:00
|
|
|
#include <connect>
|
2016-01-19 23:57:32 +01:00
|
|
|
#include <geoip>
|
|
|
|
|
|
|
|
#pragma newdecls required
|
|
|
|
|
|
|
|
public Plugin myinfo = {
|
|
|
|
name = "Connect Announce",
|
|
|
|
author = "BotoX",
|
|
|
|
description = "Simple connect announcer",
|
2018-03-23 14:18:30 +01:00
|
|
|
version = "1.1",
|
2016-01-19 23:57:32 +01:00
|
|
|
url = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnClientPostAdminCheck(int client)
|
|
|
|
{
|
|
|
|
if(IsFakeClient(client))
|
|
|
|
return;
|
|
|
|
|
|
|
|
static char sIP[16];
|
2018-03-23 14:18:30 +01:00
|
|
|
static char sAuth[32];
|
2016-01-19 23:57:32 +01:00
|
|
|
static char sCountry[32];
|
|
|
|
|
|
|
|
GetClientAuthId(client, AuthId_Steam2, sAuth, sizeof(sAuth));
|
|
|
|
|
2018-03-23 14:18:30 +01:00
|
|
|
char sNoSteam[16];
|
|
|
|
if(!SteamClientAuthenticated(sAuth))
|
|
|
|
strcopy(sNoSteam, sizeof(sNoSteam), " [\x03NoSteam\x04]");
|
|
|
|
|
2016-01-19 23:57:32 +01:00
|
|
|
if(GetClientIP(client, sIP, sizeof(sIP)) && GeoipCountry(sIP, sCountry, sizeof(sCountry)))
|
2018-03-23 14:18:30 +01:00
|
|
|
PrintToChatAll("\x04%N [\x03%s\x04] connected from %s%s", client, sAuth, sCountry, sNoSteam);
|
2016-01-19 23:57:32 +01:00
|
|
|
else
|
2018-03-23 14:18:30 +01:00
|
|
|
PrintToChatAll("\x04%N [\x03%s\x04] connected%s", client, sAuth, sNoSteam);
|
2016-01-19 23:57:32 +01:00
|
|
|
}
|