Raised This Month: $ Target: $400
 0% 

[REQ] steamid alert.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KALASH NICOLE
Member
Join Date: Feb 2016
Old 04-29-2020 , 09:32   [REQ] steamid alert.
Reply With Quote #1

Hi, I would need a plugin able to check connecting players with a particular steam id (and print a message in chat ONLY VISIBLE BY ADMINS.) this is to be alerted when suspicious players previously playing on the server are connecting, so we can check them in spectator quickly.

a system working with a list (.cfg ?) where i can add a list of steam id that need to be monitored and an admin steam id list able to see the message.

example of how the chat message would be :

[Steam ID Checker] Player [X] with Steam ID [x.x.xxxxxxx] connected. he's on your watch list !!! (maybe colorize the phrase ? to be more vsible)

repeating the chat message every 5 minutes until the player disconnect.

Last edited by KALASH NICOLE; 04-29-2020 at 09:44.
KALASH NICOLE is offline
Zarvan13
Junior Member
Join Date: Apr 2020
Location: Hungary
Old 04-29-2020 , 11:52   Re: [REQ] steamid alert.
Reply With Quote #2

Hey Kalash Nicole! If the plugin is still required, I can write ot for you.(Obviously for free) Contact me somehow.
Zarvan13 is offline
KALASH NICOLE
Member
Join Date: Feb 2016
Old 04-29-2020 , 15:38   Re: [REQ] steamid alert.
Reply With Quote #3

feel free to post the .smx or the .sp here
KALASH NICOLE is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-30-2020 , 10:13   Re: [REQ] steamid alert.
Reply With Quote #4

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"testADMFLAG_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(clientAuthId_Enginebuffersizeof(buffer)))
    {
        
LogError("Something were wrong, GetClientAuthId fail");
        return;
    }

    
// not in suspicions list
    
int value;
    if(!List.
GetValue(buffervalue)) return;


    
timers[client] = CreateTimer(300.0repeatGetClientUserId(client), TIMER_REPEAT);
    
CreateTimer(10.0delayclient);
}

public 
Action delay(Handle timerclient)
{
    if(
timers[client] != null)
    {
        
TriggerTimer(timers[client], false);
    }
}

public 
Action repeat(Handle timerany userid)
{

    
int client GetClientOfUserId(userid);

    if(
client == 0)
    {
        
// loop array of timers, clear all with this timer handle
        
for(int x 1<= MaxClientsx++)
        {
            if(
timers[x] == timertimers[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<= MaxClientsi++)
    {
        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 clientint args)
{
    
StringMapSnapshot map = List.Snapshot();
    
char buffer[30];

    for(
int x 0map.Lengthx++)
    {
        
map.GetKey(xbuffersizeof(buffer));
        
ReplyToCommand(client"getkey '%s' %i"bufferstrlen(buffer));
    }

    return 
Plugin_Handled;
}

public 
void OnConfigsExecuted()
{
    
// delete all running timers, make new ones when players connect
    
for(int x 1<= MaxClientsx++)
    {
        if(
timers[x] != nulldelete timers[x];
    }

    if(List != 
null)
    {
        
delete List;
    }


    
char buffer[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMbuffersizeof(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(buffersizeof(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, buffer0true);
    }

    
delete FileOfSuspicions;

__________________
Do not Private Message @me

Last edited by Bacardi; 04-30-2020 at 10:16.
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode