Raised This Month: $32 Target: $400
 8% 

[CS:GO] Automatically mute all players with free CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ahmed_Nakadi
Member
Join Date: Oct 2018
Old 04-22-2022 , 16:37   [CS:GO] Automatically mute all players with free CS:GO
Reply With Quote #1

Hello guys,

I am looking for someone that can make me a very simple plugin, that would automatically mute (voice chat) all players with free CS:GO / non-prime account (whatever do you guys think is a better way) to the rest of the server.

If the player with a free CS:GO tries to talk, warn him in chat that he needs to buy a CS:GO.
If the player has a flag "b", allow him to talk even if he has free CS:GO.

This would be very useful for people that evade bans and come back to the servers to spam the voice chat. There is basically no protection at all against this kind of behavior when the player changes IP (that even looks like a residential IP address) and makes a new account.

If someone thinks that he could do this plugin privately (or publish the plugin here publicly), contact me please on Discord SMiLE#8375.
Ahmed_Nakadi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-22-2022 , 21:52   Re: [CS:GO] Automatically mute all players with free CS:GO
Reply With Quote #2

There are maybe already plugin like this...


I made this quick one. Don't know how well it work.

Require
[ANY] SteamWorks
http://users.alliedmods.net/~kyles/builds/SteamWorks/


- Admins who have flag "b" bypass check.
This can be override to another flag(s) using word "sm_haslicenseforapp" or using same word to grant access to admin group without give admin flag itself.
Can be also remove all flags, then it would be public access.



PHP Code:

/*
    k_EUserHasLicenseResultHasLicense = 0,                    // User has a license for specified app
    k_EUserHasLicenseResultDoesNotHaveLicense = 1,            // User does not have a license for the specified app
    k_EUserHasLicenseResultNoAuth = 2,                        // User has not been authenticated
*/




#include <SteamWorks>
#include <basecomm>

bool HasLicenseForApp[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    for(
int i 1<= MaxClientsi++)
        if(
IsClientInGame(i)) OnClientPostAdminCheck(i);
}

public 
void OnClientPostAdminCheck(int client)
{
    if(
IsFakeClient(client))
    {
        
HasLicenseForApp[client] = true;
    }
    else if(
CheckCommandAccess(client"sm_haslicenseforapp"ADMFLAG_GENERIC))
    {
        
HasLicenseForApp[client] = true;
    }
    else
    {
        
HasLicenseForApp[client] = SteamWorks_HasLicenseForApp(client624820) == k_EUserHasLicenseResultHasLicense;
    }

    
BaseComm_SetClientMute(client, !HasLicenseForApp[client]); // true is false and false is true
}



public 
Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
{
    if(
client == || HasLicenseForApp[client])
        return 
Plugin_Continue;

    if(
IsClientInGame(client))
    {
        
PrintToChat(client" \x02[SM] Free 2 Play accounts are muted. To able to communicate on server, buy a game.");
    }
    
    return 
Plugin_Handled;

__________________
Do not Private Message @me
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 15:33.


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