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

[TF2] Player Pitch


Post New Thread Reply   
 
Thread Tools Display Modes
Author
mrphil2105
New Member
Join Date: May 2015
Location: Denmark
Plugin ID:
6084
Plugin Version:
1.1.1
Plugin Category:
Admin Commands
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Changes the voice command pitch of players.
    Old 04-11-2018 , 14:24   [TF2] Player Pitch
    Reply With Quote #1

    [TF2] Player Pitch v1.1.1

    Description
    This is a very simple plugin that enables you to change the pitch of voice commands. It's ideal for a rank like Donor/VIP, as it offers two low/high commands which changes the pitch to a configurable low/high value.
    It also has a command for setting a custom value, this one is root only by default. The ability to target other players is controlled by an override, which allows it to be customizable.

    ConVars
    • sm_playerpitch_low (Min: 30, Max: 100, Default: 50) - The value for the sm_lowpitch command.
    • sm_playerpitch_high (Min: 100, Max: 250, Default: 200) - The value for the sm_highpitch command.

    Commands
    • sm_lowpitch (Generic Admin) - Sets the pitch to the value of sm_playerpitch_low.
    • sm_highpitch (Generic Admin) - Sets the pitch to the value of sm_playerpitch_high.
    • sm_pitch (Root Admin) - Sets the pitch to a custom value.
    • sm_resetpitch (Generic Admin) - Resets the pitch back to normal.

    Overrides
    • sm_playerpitch_target (Generic Admin) - The required flag(s) to target other players.

    When a user has the flag(s) specified in sm_playerpitch_target, the above commands will also require a target.

    Changelog
    Quote:
    2018-04-18 (v1.1.1)
    * Added a color to the [SM] prefix.
    * Changed a bit of the code to satisfy my code OCD.
    2018-04-12 (v1.1)
    * Replaced the sm_playerpitch_target_flags convar with the sm_playerpitch_target override.
    2018-04-11 (v1.0)
    * Initial release.
    Installation
    1. Use "Get Plugin" below and put it in your /addons/sourcemod/plugins folder.
    2. (Optional) Change the convars in the autogenerated /cfg/sourcemod/plugin.playerpitch.cfg file.
    3. (Optional) Add the sm_playerpitch_target override to the /cfg/sourcemod/configs/admin_overrides.cfg file.

    Note: This is my first plugin! I am an experienced C# developer, but SourcePawn is still fairly new to me.
    Attached Files
    File Type: sp Get Plugin or Get Source (playerpitch.sp - 1293 views - 8.1 KB)

    Last edited by mrphil2105; 04-19-2018 at 09:34. Reason: Fixed a typo
    mrphil2105 is offline
    Send a message via Skype™ to mrphil2105
    Nanochip
    Senior Member
    Join Date: Jan 2014
    Old 04-11-2018 , 17:14   Re: [TF2] Player Pitch
    Reply With Quote #2

    Neato.

    Using a convar to pass an admin flag is bad practice. I would suggest changing the sm_playerpitch_target_flags to a command override by using the CheckCommandAccess() function.
    __________________
    Nanochip is offline
    mrphil2105
    New Member
    Join Date: May 2015
    Location: Denmark
    Old 04-11-2018 , 17:43   Re: [TF2] Player Pitch
    Reply With Quote #3

    Quote:
    Originally Posted by Nanochip View Post
    Neato.

    Using a convar to pass an admin flag is bad practice. I would suggest changing the sm_playerpitch_target_flags to a command override by using the CheckCommandAccess() function.
    I thought about doing it with CheckCommandAccess, and I know this way is not the best, but I like it like this.
    But if there is a good reason not to do it this way, let me know, and I'll change it.
    mrphil2105 is offline
    Send a message via Skype™ to mrphil2105
    Nanochip
    Senior Member
    Join Date: Jan 2014
    Old 04-11-2018 , 18:52   Re: [TF2] Player Pitch
    Reply With Quote #4

    Anything that passes a flag is nice to be overridden all in the admin_overrides.cfg so that it's altogether. For simplicity reasons really.
    __________________

    Last edited by Nanochip; 04-11-2018 at 19:05.
    Nanochip 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 09:16.


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