Raised This Month: $12 Target: $400
 3% 

[CS:GO] !knife !ws !gloves Prevention


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Aaronpierce
Junior Member
Join Date: Aug 2017
Plugin ID:
5781
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    !knife in chat types out a message to the user.
    Old 08-24-2017 , 18:50   [CS:GO] !knife !ws !gloves Prevention
    Reply With Quote #1

    Description

    Hey there. I run about 3 servers and constantly have people coming in and typing !knife. It annoys me because it's not in the title of my server they just assume it's there and don't realize Valve's set rules. In response to all this, I made a simple chat message plugin when people type !knife it says the phrase:

    We do not have this plugin because it's against Valve's TOS. We are children of Jesus.


    This plugin is specifically for CS:GO

    P.S. I'm fairly new to making plugins so go easy on me. I usually only mess around with HTML.

    Commands
    • sm_knife
    Installation
    1. Drag knife.sp into your scripting folder
    2. Drag knife.smx into your plugins folder

    Code

    PHP Code:
    #pragma semicolon 1 
    #pragma newdecls required 

    #include <sourcemod> 

     
    public Plugin myinfo =
    {
        
    name "Prevent !knife !ws !gloves",
        
    author "Fig Newtons (Aaronpierce)",
        
    description "Any player that executes commands: !knife !ws etc are greeted with a message saying those plugins aren't allowed.",
        
    version "1.1",
        
    url ""
    };

    public 
    void OnPluginStart() 

        
    RegConsoleCmd("sm_knife"Command_Print);
        
    RegConsoleCmd("sm_ws"Command_Print);  
        
    RegConsoleCmd("sm_gloves"Command_Print);  


    public 
    Action Command_Print(int clientint args
    {
        if (
    IsClientInGame(client))
        {
            
    PrintToChat(client"We do not have this plugin because it's against Valve's TOS. We are children of Jesus."); 
        }
        return 
    Plugin_Handled

    Changelog
    1.1 - Added !ws and !gloves to message output.

    Extra Notes
    I will probably be adding a sound to this and add !gloves and !ws to it as well. Currently, !ws and !gloves plugins I've just recently made after this one, will eventually be merged into this one.
    If there are any bugs I will do my best to figure out how to fix them but keep in mind I am new.

    Thanks for reading and hopefully this ends some of your frustrations too!
    Attached Files
    File Type: sp Get Plugin or Get Source (knife.sp - 7736 views - 806 Bytes)

    Last edited by Aaronpierce; 12-07-2018 at 14:21.
    Aaronpierce is offline
    shanapu
    Veteran Member
    Join Date: Apr 2015
    Location: .de
    Old 08-24-2017 , 19:52   Re: !knife Troll
    Reply With Quote #2

    great idea, simple & clean code!
    __________________
    coding & free software
    shanapu is offline
    Russian85
    Junior Member
    Join Date: Aug 2017
    Old 08-24-2017 , 21:27   Re: !knife Troll
    Reply With Quote #3

    I think this is better:

    Hide !knife, !ws and etc messages and print info.

    Source:
    PHP Code:
    public Plugin myinfo =
    {
        
    name        =     "Hide Messages",
        
    author      =     "Someone (AM Russian85)",
        
    version     =     "1.0",
        
    url         =     "http://hlmod.ru"
    };

    ArrayList g_hArray;

    public 
    void OnPluginStart()
    {
        
    g_hArray = new ArrayList(ByteCountToCells(32));
        
        
    RegAdminCmd("sm_hm_reload"CMD_RELOADADMFLAG_ROOT);
        
        
    LoadConfig();
    }

    public 
    Action CMD_RELOAD(int iClientint iArgs)
    {
        
    LoadConfig();
        return 
    Plugin_Handled;
    }

    void LoadConfig()
    {
        
    g_hArray.Clear();
        
    KeyValues Kv = new KeyValues("Messages");
        
        
    char sBuffer[PLATFORM_MAX_PATH];
        
    BuildPath(Path_SMsBuffersizeof(sBuffer), "configs/hide_messages.ini");
        if (!
    FileToKeyValues(KvsBuffer)) SetFailState("Unable to find config file %s"sBuffer);
        
        if (
    Kv.GotoFirstSubKey())
        {
            do
            {
                if (
    Kv.GetSectionName(sBuffersizeof(sBuffer)))
                {
                    
    g_hArray.PushString(sBuffer);
                }
            } 
            while (
    Kv.GotoNextKey());
        }
        
    delete Kv;
    }

    public 
    Action OnClientSayCommand(int iClient, const char[] sCommand, const char[] sArgs)
    {
        if(
    IsClientInGame(iClient) && !IsFakeClient(iClient) && g_hArray.FindString(sArgs) != -1)
        {
            
    PrintToChat(iClient"We do not have this plugin because it's against Valve's TOS. We are children of Jesus.");
            return 
    Plugin_Handled;
        }
        return 
    Plugin_Continue;

    Config:
    PHP Code:
    "Messages"
    {
        
    "!knife"{}
        
    "!ws"{}

    Attached Files
    File Type: zip HideMessages.zip (6.5 KB, 826 views)

    Last edited by Russian85; 08-24-2017 at 21:28.
    Russian85 is offline
    vortex.
    AlliedModders Donor
    Join Date: Jan 2017
    Location: OnGameFrame()
    Old 08-25-2017 , 08:35   Re: !knife Troll
    Reply With Quote #4

    Wonderful.
    __________________
    vortex. is offline
    Aaronpierce
    Junior Member
    Join Date: Aug 2017
    Old 08-26-2017 , 14:38   Re: !knife Troll
    Reply With Quote #5

    Quote:
    Originally Posted by Russian85 View Post
    I think this is better:

    Hide !knife, !ws and etc messages and print info.

    Source:
    PHP Code:
    public Plugin myinfo =
    {
        
    name        =     "Hide Messages",
        
    author      =     "Someone (AM Russian85)",
        
    version     =     "1.0",
        
    url         =     "http://hlmod.ru"
    };

    ArrayList g_hArray;

    public 
    void OnPluginStart()
    {
        
    g_hArray = new ArrayList(ByteCountToCells(32));
        
        
    RegAdminCmd("sm_hm_reload"CMD_RELOADADMFLAG_ROOT);
        
        
    LoadConfig();
    }

    public 
    Action CMD_RELOAD(int iClientint iArgs)
    {
        
    LoadConfig();
        return 
    Plugin_Handled;
    }

    void LoadConfig()
    {
        
    g_hArray.Clear();
        
    KeyValues Kv = new KeyValues("Messages");
        
        
    char sBuffer[PLATFORM_MAX_PATH];
        
    BuildPath(Path_SMsBuffersizeof(sBuffer), "configs/hide_messages.ini");
        if (!
    FileToKeyValues(KvsBuffer)) SetFailState("Unable to find config file %s"sBuffer);
        
        if (
    Kv.GotoFirstSubKey())
        {
            do
            {
                if (
    Kv.GetSectionName(sBuffersizeof(sBuffer)))
                {
                    
    g_hArray.PushString(sBuffer);
                }
            } 
            while (
    Kv.GotoNextKey());
        }
        
    delete Kv;
    }

    public 
    Action OnClientSayCommand(int iClient, const char[] sCommand, const char[] sArgs)
    {
        if(
    IsClientInGame(iClient) && !IsFakeClient(iClient) && g_hArray.FindString(sArgs) != -1)
        {
            
    PrintToChat(iClient"We do not have this plugin because it's against Valve's TOS. We are children of Jesus.");
            return 
    Plugin_Handled;
        }
        return 
    Plugin_Continue;

    Config:
    PHP Code:
    "Messages"
    {
        
    "!knife"{}
        
    "!ws"{}

    So what does this specifically do? It just hides the !knife and !ws messages in chat?
    Aaronpierce is offline
    Russian85
    Junior Member
    Join Date: Aug 2017
    Old 08-28-2017 , 12:51   Re: !knife Troll
    Reply With Quote #6

    Quote:
    Originally Posted by Aaronpierce View Post
    So what does this specifically do? It just hides the !knife and !ws messages in chat?
    Hides what you want.
    Russian85 is offline
    QuatZp
    New Member
    Join Date: Aug 2017
    Old 08-29-2017 , 01:31   Re: !knife Troll
    Reply With Quote #7

    Quote:
    Originally Posted by Aaronpierce View Post
    PHP Code:
    public void OnPluginStart() 

        
    RegConsoleCmd("sm_knife"Command_Print); 

    I will probably be adding [...] !gloves and !ws to it as well. Currently, !ws and !gloves plugins I've just recently made after this one, will eventually be merged into this one.

    Just add (if sm_ws and sm_glove are correct)
    PHP Code:
    RegConsoleCmd("sm_ws"Command_Print);  
    RegConsoleCmd("sm_glove"Command_Print); 
    P.S. I have the same problem with these 'players'.

    Last edited by QuatZp; 08-29-2017 at 01:41.
    QuatZp is offline
    Aaronpierce
    Junior Member
    Join Date: Aug 2017
    Old 12-07-2018 , 14:36   Re: [CS:GO] !knife !ws !gloves Prevention
    Reply With Quote #8

    Update:

    Decided to add some new additions to this plugin. I basically made it to when !knife !ws or !gloves is typed it displays the message. So in other words, I added two other commands !ws and !gloves.

    Extra Notes:

    Haven't decided whether I'm going to hide the commands in chat because I like seeing them type it knowing that they're seeing the message.

    That's it! Thanks for checking in,

    ~ Aaron
    Aaronpierce is offline
    _GamerX
    AlliedModders Donor
    Join Date: Jun 2011
    Location: Fun Server
    Old 12-07-2018 , 14:47   Re: [CS:GO] !knife !ws !gloves Prevention
    Reply With Quote #9

    best plugin of the year
    __________________
    _GamerX is offline
    Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
    Aaronpierce
    Junior Member
    Join Date: Aug 2017
    Old 12-07-2018 , 14:49   Re: [CS:GO] !knife !ws !gloves Prevention
    Reply With Quote #10

    Quote:
    Originally Posted by _GamerX View Post
    best plugin of the year
    Let me know what I should wear to accept the award. Beginning to rehearse my speech.
    Aaronpierce is offline
    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 08:50.


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