View Single Post
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 04-09-2015 , 18:24   Re: How to ban players that enter my server with no steam id?
Reply With Quote #13

PHP Code:
char chRestrictedIds[][] = 
{
    
"",
    
"STEAM_ID_LAN",
    
"STEAM_ID_VALVE",
    
"VALVE_ID_LAN",
    
"STEAM_1:0:0",
    
"STEAM_0:0:0",
    
"[I:0:0]",
    
};

public 
Plugin:myinfo 
{
    
name "Null Auth Ban",
    
author "SM9 (xCoderx)",
}

public 
void OnClientAuthorized(int iClient, const char[] chAuthId)
{
    
char chAuthId2[30], chAuthId3[30]
    
    
GetClientAuthId(iClientAuthId_Steam2chAuthId2sizeof(chAuthId2))
    
GetClientAuthId(iClientAuthId_Steam3chAuthId3sizeof(chAuthId3))
    
    for(
int isizeof(chRestrictedIds); i++)
    {
        if(
StrEqual(chAuthId2chRestrictedIds[i], false) || StrEqual(chAuthId3chRestrictedIds[i], false) || StrEqual(chAuthIdchRestrictedIds[i], false))
        {
            
BanClient(iClient0BANFLAG_IP"Null / Invalid AuthId (%s)""Null / Invalid AuthId");
            if(
IsClientInGame(iClient)) KickClient(iClient"Null / Invalid AuthId");
            break;
        }
        
        continue;
    }
    
    if(!
IsClientAuthorized(iClient)) KickClient(iClient"Authorize failure, please retry.");

Try this, you can add your own ids to the top aswell.
Attached Files
File Type: sp Get Plugin or Get Source (NullAuthBan.sp - 115 views - 1,008 Bytes)
SM9 is offline