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:plugin, numParams)
{
decl String:sVersion[16], String:sReason[256];
new client = GetNativeCell(1);
new duration = GetConVarInt(g_hCvarBanDuration);
GetPluginInfo(plugin, PlInfo_Version, sVersion, sizeof(sVersion));
FormatNativeString(0, 2, 3, sizeof(sReason), _, sReason);
Format(sReason, sizeof(sReason), "SMAC %s: %s", sVersion, sReason);
decl String:sAuthID[MAX_AUTHID_LENGTH];
if (!GetClientAuthString(client, sAuthID, sizeof(sAuthID), true))
{
if (GetClientAuthString(client, sAuthID, sizeof(sAuthID), false))
{
Format(sAuthID, sizeof(sAuthID), "%s (Not Validated)", sAuthID);
}
else
{
strcopy(sAuthID, sizeof(sAuthID), "Unknown");
}
}
decl String:sIP[17];
if (!GetClientIP(client, sIP, sizeof(sIP)))
{
strcopy(sIP, sizeof(sIP), "Unknown");
}
if (SOURCEBANS_AVAILABLE())
{
PrintToChatAll("\x01 \x07[SMAC] %N (ID: %s | IP: %s) has been permanently banned for a cheating infraction.", client, sAuthID, sIP);
SBBanPlayer(0, client, duration, sReason);
}
else
{
PrintToChatAll("\x01 \x07[SMAC] %N (ID: %s | IP: %s) has been permanently banned for a cheating infraction.", client, sAuthID, sIP);
decl String:sKickMsg[256];
FormatEx(sKickMsg, sizeof(sKickMsg), "%T", "SMAC_Banned", client);
BanClient(client, duration, BANFLAG_AUTO, sReason, sKickMsg, "SMAC");
}
KickClient(client, sReason);
}