Thread: Show bans
View Single Post
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 05-03-2019 , 05:57   Re: Show SMAC BAN to non admins
Reply With Quote #39

Quote:
Originally Posted by allienaded View Post
This is what I use and it works without problems:

smac.sp starting line 327

PHP Code:
// native SMAC_Ban(client, const String:reason[], any:...);
public Native_Ban(Handle:pluginnumParams)
{
    
decl String:sVersion[16], String:sReason[256];
    new 
client GetNativeCell(1);
    new 
duration GetConVarInt(g_hCvarBanDuration);
    
    
GetPluginInfo(pluginPlInfo_VersionsVersionsizeof(sVersion));
    
FormatNativeString(023sizeof(sReason), _sReason);
    
Format(sReasonsizeof(sReason), "SMAC %s: %s"sVersionsReason);
    
    
decl String:sAuthID[MAX_AUTHID_LENGTH];
    if (!
GetClientAuthString(clientsAuthIDsizeof(sAuthID), true))
    {
        if (
GetClientAuthString(clientsAuthIDsizeof(sAuthID), false))
        {
            
Format(sAuthIDsizeof(sAuthID), "%s (Not Validated)"sAuthID);
        }
        else
        {
            
strcopy(sAuthIDsizeof(sAuthID), "Unknown");
        }
    }
    
    
decl String:sIP[17];
    if (!
GetClientIP(clientsIPsizeof(sIP)))
    {
        
strcopy(sIPsizeof(sIP), "Unknown");
    }
    
    if (
SOURCEBANS_AVAILABLE())
    {
        
PrintToChatAll("\x01 \x07[SMAC] %N (ID: %s | IP: %s) has been permanently banned for a cheating infraction."clientsAuthIDsIP);
        
        
SBBanPlayer(0clientdurationsReason);
    }
    else
    {
        
PrintToChatAll("\x01 \x07[SMAC] %N (ID: %s | IP: %s) has been permanently banned for a cheating infraction."clientsAuthIDsIP);
        
        
decl String:sKickMsg[256];
        
FormatEx(sKickMsgsizeof(sKickMsg), "%T""SMAC_Banned"client);
        
BanClient(clientdurationBANFLAG_AUTOsReasonsKickMsg"SMAC");
    }
    
    
KickClient(clientsReason);

Do i need to recompile the modification into a new plugin to replace the old one? It doesn't seem to work if i only modify the sp file.
JLmelenchon is offline