Raised This Month: $32 Target: $400
 8% 

Logs say kick when user have been banned


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
checkster
BANNED
Join Date: Apr 2007
Location: Norway
Old 12-23-2011 , 09:25   Logs say kick when user have been banned
Reply With Quote #1

To start of this is not my code, and I do not take any credit for it, I simply made it into ban instead of the original that kicks.
But like my topic says, the sm logs says kicked, but the temp ban is written to the banned_user.cfg, And i cant figure out why.
So if anyone would be so kind as to point out what I am missing Id greatly appreciate it.
I only changed the bottom lines to make it ban.

Original plugin.
http://forums.alliedmods.net/showthread.php?t=159582

PHP Code:
#pragma semicolon 1

#include <sourcemod>

public Plugin:myinfo =
{
    
name "Thirdpersonshoulder Block",
    
author "Don",
    
description "Kicks clients who enable the thirdpersonshoulder mode on L4D1/2 to prevent them from looking around corners, through walls etc.",
    
version "1.3",
    
url "http://forums.alliedmods.net/showthread.php?t=159582"
}

public 
APLRes:AskPluginLoad2(Handle:myselfbool:lateString:error[], err_max)
{
    
decl String:sGame[12];
    
GetGameFolderName(sGamesizeof(sGame));
    if (
StrEqual(sGame"left4dead") || StrEqual(sGame"left4dead2"))    /* Only load the plugin if the server is running Left 4 Dead or Left 4 Dead 2.
                                         * Loading the plugin on Counter-Strike: Source or Team Fortress 2 would cause all clients to get kicked,
                                         * because the thirdpersonshoulder mode and the corresponding ConVar that we check do not exist there.
                                         */
    
{
        return 
APLRes_Success;
    }
    else
    {
        
strcopy(errorerr_max"Plugin only supports L4D1/2");
        return 
APLRes_Failure;
    }
}

public 
OnPluginStart()
{
    
CreateConVar("l4d_tpsblock_version""1.3""Version of the Thirdpersonshoulder Block plugin"FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
CreateTimer(GetRandomFloat(2.53.5), CheckClients_TIMER_REPEAT);
}

public 
Action:CheckClients(Handle:timer)
{
    for (new 
iClientIndex 1iClientIndex <= MaxClientsiClientIndex++)
    {
        if (
IsClientInGame(iClientIndex) && !IsFakeClient(iClientIndex))
        {
            if (
GetClientTeam(iClientIndex) == || GetClientTeam(iClientIndex) == 3)    // Only query clients on survivor or infected team, ignore spectators.
            
{
                
QueryClientConVar(iClientIndex"c_thirdpersonshoulder"QueryClientConVarCallback);
            }
        }
    }    
}

public 
QueryClientConVarCallback(QueryCookie:cookieclientConVarQueryResult:result, const String:cvarName[], const String:cvarValue[])
{
    if (
IsClientInGame(client) && !IsClientInKickQueue(client))
    {
        if (
result != ConVarQuery_Okay)        /* If the ConVar was somehow not found on the client, is not valid or is protected, kick the client.
                             * The ConVar should always be readable unless the client is trying to prevent it from being read out.
                             */
        
{
            new 
String:sName[MAX_NAME_LENGTH];
            
GetClientName(clientsNamesizeof(sName));
            
BanClient(client,5,BANFLAG_AUTHID,"Banned for potentially using thirdpersonshoulder mode.\nConVar c_thirdpersonshoulder not found, not valid or protected");
            
LogAction(0client"Banned \"%L\" for potentially using thirdpersonshoulder mode, ConVar c_thirdpersonshoulder not found, not valid or protected"client);
            
PrintToChatAll("[SM] Banned %s for potentially using thirdpersonshoulder mode, ConVar c_thirdpersonshoulder not found, not valid or protected"sName);
        }
        else if (!
StrEqual(cvarValue"false") && !StrEqual(cvarValue"0"))    /* If the ConVar was found on the client, but is not set to either "false" or "0",
                                             * kick the client as well, as he might be using thirdpersonshoulder.
                                             */
        
{
            new 
String:sName[MAX_NAME_LENGTH];
            
GetClientName(clientsNamesizeof(sName));
            
BanClient(client,5,BANFLAG_AUTHID,"Banned for potentially using thirdpersonshoulder mode.\nEnter \"c_thirdpersonshoulder 0\" (without the \"\") in your console before rejoining the server");
            
LogAction(0client"Banned \"%L\" for potentially using thirdpersonshoulder mode"client);
            
PrintToChatAll("[SM] Banned %s for potentially using thirdpersonshoulder mode"sName);
        }
    }

checkster is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 12-23-2011 , 12:18   Re: Logs say kick when user have been banned
Reply With Quote #2

You may want to post in the sourcemod section instead of the SuperHero section for AMX Mod X.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode