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

[Any] Self-Ban (v1.3, 2023-June-03)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
TestieTendie
New Member
Join Date: Jun 2023
Plugin ID:
8486
Plugin Version:
1.3
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Self-Ban allows users to permanently ban themselves from a server using the chat command '!banme'.
    Old 06-06-2023 , 16:58   [Any] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #1

    [Any] Self-Ban (v1.3, 2023-June-03)


    Description
    I stumbled upon this functionality on a server I joined a couple weeks ago but couldn't find the plugin they were using so I decided to make one and open source it.
    • Self-Ban is a Sourcemod plugin that allows users to permanently ban themselves from a server using the chat command '!banme'.

    Source Code on Github

    Features
    • Ban yourself permanently with the '!banme' chat command.
    • Ban info is displayed in the server console and chat box of all clients.
    • Automatic logging of the ban to SourceMod's log with date and time.

    Commands
    • '!banme' - bans user permanently.

    Configurations
    • None.

    Plans
    • This plugin registers its command directly as a chat command '!banme', and not 'sm_banme' (I was unaware of sm_ commands creating '!' chat variants, but once I learned it, it didn't seem necessary (who is gonna ban themselves from console?). In any case, if this goes against any rules, I will consider changing it. But Other than that, none at the moment, though feel free to raise issues/pull requests in the Github repository.

    Changelog
    • 2023-06-02 (v1.0)
      - Initial release.
    • 2023-06-03 (v1.1)
      - Add input checks, user validation, logging, and printing to console.
    • 2023-06-03 (v1.2)
      - Add a couple of delays so the banned user isn't immediately kicked.
    • 2023-06-03 (v1.3)
      - Fixed a couple of typos.

    Enjoy the plugin, and if you encounter any issues or have any suggestions, feel free to submit an issue on the Github repository.
    Attached Files
    File Type: sp Get Plugin or Get Source (self_ban.sp - 138 views - 3.3 KB)
    __________________
    💉 I'm too old for this shit

    Last edited by TestieTendie; 06-07-2023 at 23:49.
    TestieTendie is offline
    tiphong
    Member
    Join Date: Aug 2022
    Location: Taiwan
    Old 06-06-2023 , 18:41   Re: [L4D2] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #2

    when you have exam next week..
    tiphong is offline
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 06-07-2023 , 01:07   Re: [L4D2] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #3

    I assume this works with SourceBans natively?
    __________________

    Last edited by Mr. Man; 06-07-2023 at 01:07.
    Mr. Man is offline
    TestieTendie
    New Member
    Join Date: Jun 2023
    Old 06-07-2023 , 10:18   Re: [L4D2] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #4

    Quote:
    Originally Posted by Mr. Man View Post
    I assume this works with SourceBans natively?
    At the moment the code is super simple and only works on the server it's running on. I'll look into adding sourcebans integration.
    __________________
    💉 I'm too old for this shit
    TestieTendie is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-07-2023 , 22:51   Re: [L4D2] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #5

    - Should be RegConsoleCmd with "sm_banme" as the command, not "say" or "say_team" commands.
    - Should be marked as "ANY" not "L4D2" since there is nothing L4D2 specific.
    - PrintToClient should be passing userid not client index.
    - ChatCommand is pulling client name/steam ID without ever using it, can be deleted here.
    - "public" can be removed from custom named callbacks, only required for SM forwards or 3rd party plugin forwards.
    - The text for "char reason[]" could be moved into the BanClient part, but maybe better this way if you support other banning plugins.
    __________________
    Silvers is offline
    TestieTendie
    New Member
    Join Date: Jun 2023
    Old 06-07-2023 , 23:46   Re: [L4D2] Self-Ban (v1.3, 2023-June-03)
    Reply With Quote #6

    Quote:
    Originally Posted by Silvers View Post
    - Should be RegConsoleCmd with "sm_banme" as the command, not "say" or "say_team" commands.
    - Should be marked as "ANY" not "L4D2" since there is nothing L4D2 specific.
    - PrintToClient should be passing userid not client index.
    - ChatCommand is pulling client name/steam ID without ever using it, can be deleted here.
    - "public" can be removed from custom named callbacks, only required for SM forwards or 3rd party plugin forwards.
    - The text for "char reason[]" could be moved into the BanClient part, but maybe better this way if you support other banning plugins.
    Thanks, I appreciate the insight to improve the code. I will make the necessary adjustments based on your suggestions in the next coming days.
    __________________
    💉 I'm too old for this shit
    TestieTendie is offline
    Reply



    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:00.


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