View Single Post
q1085909155
Member
Join Date: Oct 2021
Old 07-07-2023 , 03:23   Re: I'm looking for a plugin
Reply With Quote #3

Quote:
Originally Posted by Austin View Post
I don't know what a "trade server" is and you didn't mention the game you need this for,
but writing a plugin to handle making your server private and only for certain players is very simple.

I don't know what features SM has built in for this but it probably has this feature built in.

Here is an example plugin that would only allow my two players onto my server.

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{

}

public 
bool OnClientConnect(int clientchar[] rejectmsgint maxlen)
{
    
strcopy(rejectmsg100"This server is limited to Private  players.");
    
    
char steamId[64];
    
GetClientAuthId(clientAuthId_Steam2steamId128);

    
// only the clients with these ids will be allowed on the server
    
if (strcmp(steamId"STEAM_1:0:xxxx")    == 0        ||    // Austin - Server Owner
        
strcmp(steamId"STEAM_1:0:xxxx")    == 0)             // austinbots2
    
{
        return 
true;
    }
    else
    {
        return 
false;        //client not found will be rejected and see the reject message
    
}

oh, thanks for your answer, I'm running the TF2 server, which is a trading server where players trade, or go to do something, stay there, and get boxes.
My main point is not to make the server private. What I mean by this is that if a player's Steam profile is set to be private, then denying him access to the server is generally blocking new Steam accounts.

Last edited by q1085909155; 07-07-2023 at 03:24.
q1085909155 is offline