View Single Post
Austin
Senior Member
Join Date: Oct 2005
Old 07-06-2023 , 15:33   Re: I'm looking for a plugin
Reply With Quote #2

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
    
}

Attached Thumbnails
Click image for larger version

Name:	PrivateServer.jpg
Views:	60
Size:	60.9 KB
ID:	201112  
Austin is offline