Raised This Month: $51 Target: $400
 12% 

[CS:GO Request] Record a demo when specific Steam ID joins the server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lannister
Veteran Member
Join Date: Apr 2015
Old 06-06-2019 , 15:21   [CS:GO Request] Record a demo when specific Steam ID joins the server
Reply With Quote #1

Hello AM Community!

I want to ask you guys a request that may be helpful for some server operators out there too. The request is the next one.

Is it possible to create a plugin that will auto-record a demo (using GOTV) when specific Steam ID (added through a cfg file or something) joins the server? the idea behind this is that sometimes X users are suspected to have bad behavior on the server, or also suspected of using cheats, and, instead of record a demo 24/7 (which takes a lot of space) i would love to have a plugin that will record a demo ONLY after that specific user joined the server.

Hope i explained myself correctly, thanks in advance!
Lannister is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 06-06-2019 , 16:50   Re: [CS:GO Request] Record a demo when specific Steam ID joins the server
Reply With Quote #2

PHP Code:
#include <sourcemod>

public void OnClientPutInServer(int client)
{
    if (!
IsFakeClient(client))
    {
        
char szAuth[128];
        
GetClientAuthId(clientAuthId_Steam2szAuthsizeof(szAuth));
        
        if (
StrEqual(szAuth"STEAM_0:1:91750774"))
        {
            
ServerCommand("record hacker");
        }
        else if(
StrEqual(szAuth"STEAM_0:1:91750771"))
        {
            
ServerCommand("record hacker");
        }
    }
}

public 
void OnClientDisconnect(int client)
{
    if (!
IsFakeClient(client))
    {
        
char szAuth[128];
        
GetClientAuthId(clientAuthId_Steam2szAuthsizeof(szAuth));
        
        if (
StrEqual(szAuth"STEAM_0:1:91750774"))
        {
            
ServerCommand("stop");
        }
        else if(
StrEqual(szAuth"STEAM_0:1:91750771"))
        {
            
ServerCommand("stop");
        }
    }

I did something really quick because I don't have much time now, if you need help please contact me on discord : Pilo#8253
Btw not sure if it's gonna work but give it a chance.
(Untested)
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
Lannister
Veteran Member
Join Date: Apr 2015
Old 06-07-2019 , 11:18   Re: [CS:GO Request] Record a demo when specific Steam ID joins the server
Reply With Quote #3

Thanks! question for you, if the demo has the same name as previous one, will it be replaced? or it will create a demo called hacker(1) on CS:GO folder?
Lannister 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 20:30.


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