Create file in sourcemod configs
...addons\sourcemod\configs\ListOfsuspicions. txt
Code:
[U:1:XXXXXXXX]
[U:1:XXXXXXXX]
[U:1:XXXXXXXX]
STEAM_1:1:XXXX
STEAM_1:1:XXXX
STEAM_1:1:XXXX
STEAM_X:X:XXXX
STEAM_X:X:XXXX
- This plugin is simple and only match correct given SteamID.
It depends what game you are running, plugin would look SteamID type of that (STEAM_0:1:11, STEAM_1:1:111, [U:1:1111])
You should re-check steamid type by looking from SRCDS console with command
status, while there are players on server.
- Doesn't hurt if you add all types of same steamid in ListOfsuspicions.txt :)
But correct one can find from behind
status
Here code, I was lazy.
You get green chat message of player, once connected and every 5 minutes.
Admins who have access to word "
sm_suspicions_announce" or have admin flag RCON see messages.
- You can override admin access to that word from admin_overrides.cfg
- You can manage specific admins to see messages, with that word + admin_groups.cfg configuration.
Ask, if you want see that configure.
*edit, every map change update watch list from file.
PHP Code:
StringMap List;
Handle timers[MAXPLAYERS+1];
public void OnPluginStart()
{
RegAdminCmd("sm_suspicions_announce_debug", test, ADMFLAG_RCON, "Print output values of current 'StringMap List'");
}
public void OnClientPostAdminCheck(int client)
{
// timer is running
if(timers[client] != null)
{
// trigger timer now!
TriggerTimer(timers[client], true);
// Does timer still continue ??
if(timers[client] != null) return;
}
if(List == null) return;
char buffer[30];
if(!GetClientAuthId(client, AuthId_Engine, buffer, sizeof(buffer)))
{
LogError("Something were wrong, GetClientAuthId fail");
return;
}
// not in suspicions list
int value;
if(!List.GetValue(buffer, value)) return;
timers[client] = CreateTimer(300.0, repeat, GetClientUserId(client), TIMER_REPEAT);
CreateTimer(10.0, delay, client);
}
public Action delay(Handle timer, client)
{
if(timers[client] != null)
{
TriggerTimer(timers[client], false);
}
}
public Action repeat(Handle timer, any userid)
{
int client = GetClientOfUserId(userid);
if(client == 0)
{
// loop array of timers, clear all with this timer handle
for(int x = 1; x <= MaxClients; x++)
{
if(timers[x] == timer) timers[x] = null;
}
// stop timer
return Plugin_Stop;
}
// player connect or re-connecting, skip
if(!IsClientInGame(client)) return Plugin_Continue;
UserMessageType msgtype = GetUserMessageType();
// send chat message to admins
for(int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i)) continue;
if(!CheckCommandAccess(i, "sm_suspicions_announce", ADMFLAG_RCON)) continue;
if(msgtype == UM_Protobuf) //csgo
{
PrintToChat(i, " \x04Player %L connected. he's on your watch list !!! ", client);
}
else
{
PrintToChat(i, "\x01\x04Player %L connected. he's on your watch list !!! ", client);
}
}
return Plugin_Continue;
}
public Action test(int client, int args)
{
StringMapSnapshot map = List.Snapshot();
char buffer[30];
for(int x = 0; x < map.Length; x++)
{
map.GetKey(x, buffer, sizeof(buffer));
ReplyToCommand(client, "getkey '%s' %i", buffer, strlen(buffer));
}
return Plugin_Handled;
}
public void OnConfigsExecuted()
{
// delete all running timers, make new ones when players connect
for(int x = 1; x <= MaxClients; x++)
{
if(timers[x] != null) delete timers[x];
}
if(List != null)
{
delete List;
}
char buffer[PLATFORM_MAX_PATH];
BuildPath(Path_SM, buffer, sizeof(buffer), "configs/ListOfsuspicions.txt");
if(!FileExists(buffer))
{
LogError("Couldn't find file '%s'", buffer);
return;
}
File FileOfSuspicions = OpenFile(buffer, "r");
if(FileOfSuspicions == null)
{
SetFailState("Tried to OpenFile '%s', fail. Can't open file or it's corrupt.", buffer);
}
List = new StringMap();
int index;
while(!FileOfSuspicions.EndOfFile())
{
FileOfSuspicions.ReadLine(buffer, sizeof(buffer));
if(strlen(buffer) < 3) continue;
// remove new line char
if( (index = FindCharInString(buffer, '\n', true)) != -1)
{
buffer[index] = '\0'
}
// remove pair of "quotes"
StripQuotes(buffer);
SetTrieValue(List, buffer, 0, true);
}
delete FileOfSuspicions;
}
__________________