[SM Plugin] NoCommExtendVote

Discussion in 'Coding' started by Neoony, Mar 26, 2017.

  1. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    No Comm Extend Vote
    [NCEV]

    v0.8 Colored
    Created by Neoony

    Thanks to
    Mr. X. - helping testing and reporting bugs + tons of good suggestions
    Lazylizard - helping testing and reporting bugs
    Wired_4fun - helping testing and reporting bugs


    My first plugin ever, or first attempt.

    Main project site: https://git.empiresmod.com/sourcemod/no_commander_extend_vote
    Releases: https://git.empiresmod.com/sourcemod/no_commander_extend_vote/tags
    Direct link to the latest release v0.8(GET THIS): https://git.empiresmod.com/sourcemo...1e7da618d09f36e8022/NoCommExtendVote_v0.8.rar
    Dont forget to set your config!

    Report issues:
    Best to report issues here: https://git.empiresmod.com/sourcemod/no_commander_extend_vote/issues
    Or in this thread.
    Or message me :)

    -----
    Description:
    Takes control over commander vote time and adds a lot of features around it for server owners to set up.
    See features.
    --

    Features:
    - Extending vote time if no comms.
    - You can set minimum players needed for each feature to work.
    - Regular info message about comms and votes.
    - Customize almost everything.
    - Skipping to another map if CV stays empty after round starts, set your custom time. (CV with no comm will die)
    - Locking spectators and enabling at custom time after round starts.
    - Ability to limit how many times can the vote be extended.
    - Enable alltalk while both teams have no comms.
    - Config file.
    - And much more!


    Commands:
    Code:
    "sm_nce"
    "Enable extending of comm vote. In chat: !nce"
    
    "sm_ncd"
    "Disable extending of comm vote. In chat: !ncd"
    
    "nc_nce"
    "Enable extending of comm vote. Server command"
    
    "nc_ncd"
    "Disable extending of comm vote. Server command"
    

    Cvars:

    Code:
    "nc_addvotetime" "def. 30"
    "How much to add to the current detected value of (emp_sv_vote_commander_time), when extending vote time."
    
    "nc_minplayers" "def. 8"
    "How many players needed to enable this plugin. (Players who selected a team)"
    
    "nc_msgtimer" "def. 30"
    "How often to display the informational messages. (Seconds)"
    
    "nc_marktime" "def. 60"
    "At what time of the commander vote to extend the time. (Seconds)"
    
    "nc_commcheck" "def. 1"
    "Enable(1)/Disable(0) checking for somebody in the command vehicle 10 seconds after the round starts."
    
    "nc_commcheckmp" "def. 6"
    "Minumum players needed for commcheck to happen."
    
    "nc_commchecktime" "def. 90"
    "How long to wait for somebody to enter the command vehicle after the vote, or it will explode. (Seconds)"
    
    "nc_lockspec" "def. 0"
    "Enable(1)/Disable(0) locking of spectators and unlocking on timer."
    
    "nc_lockspecmp" "def. 6"
    "Minumum players needed for lockspec to happen.(Clients on the server + connecting clients.)"
    
    "nc_lockspechide" "def. 0"
    "Enable(1)/Disable(0) Hide messages about spectators being unlocked."
    
    "nc_lockspectime" "def. 300"
    "How long to keep spec locked after the round starts. (Seconds)"
    
    "nc_howmanytimese" "def. 1"
    "Enable(1)/Disable(0) limited number of possible extending of the vote."
    
    "nc_howmanytimes" "def. 6"
    "How many times to allow extending of the vote. After that it will start the round and if nobody enters the cv in set time it will do nextmap."
    
    "nc_alltalkm" "def. 1"
    "Enable(1)/Disable(0) managing alltalk by NCEV."
    
    "nc_alltalkmmp" "def. 8"
    "How many players needed to enable managing alltalk by NCEV. (Clients on the server + connecting clients.)"
    
    "nc_vt" "def. 1"
    "Enable(1)/Disable(0) If this is enabled and you use VoteTime pause, NCEV will stop extending."
    
    "nc_pugc" "def. 1"
    "Enable(1)/Disable(0) compatibility with ScardyBobs PUG plugin." 
    --

    More detailed description:
    To enable or disable extending as admin use "sm_nce" to enable and "sm_ncd" to disable.
    In chat "!nce" "!ncd"
    Server commands "nc_nce" or "nc_ncd"
    If the commander vote time is below "nc_marktime" it will add extra time if no team has yet voted for a commander.
    It will keep extending the vote time by adding "nc_addvotetime" to the current detected vote time.
    It will also display info status message about comms and votes at interval you set by "nc_msgtimer"
    You can set at what time should the vote be extended with "nc_marktime"
    You can enable checking if any commanders entered the CV after the round starts "nc_commcheck"
    Or only enable it at certain number of players "nc_commcheckmp"
    The cv will explode if there are no comms after the custom time limit which you can set by "nc_commchecktime"
    You can set this plugin to lock spectators from start of the map "nc_lockspec"
    Or set minimum clients on the server needed for it by "nc_lockspecmp"
    And customize the time after start of the round of when spectators should be enabled "nc_lockspectime"
    Or hide the message about unlocking spectators "nc_lockspechide"
    Or set the limit of how many times can the vote be extended "nc_howmanytimese" to enable, "nc_howmanytimes" to set how many times.
    Or enable alltalk while both teams have no commander candidates with "nc_alltalkm"
    Set at how many clients should the alltalk managing be enabled by "nc_alltalkmmp"
    Or enable plugin compatibility by "nc_vt" or "nc_pugc"
    Plugin disables on infantry maps, except locking spectators.
    Player must join a team for the plugin to activate.
    Player cant vote for themselves in a comm vote.

    --

    Issues:
    Addition of minimum players setting for lockspec and alltalkm introduced an issue
    where if admin changes the setting of alltalk or allowing spectators, it might get overridden in the next few seconds.

    --

    Planned features
    Need to test it now and work on issues.
    Iam open to suggestions and ideas.

    I intend to keep surrender or comm lock as a separate plugins.

    --

    Changelog:
    Code:
    v0.1
    - First pre-release
    
    v0.2
    - Added new console commands
    - Added config
    - Better messages handling
    - Few bugfixes
    
    v0.2.1 Quickfix
    - Fixed infantry map spam
    - Added message about plugin on "OnClientPutInServer"
    - Few small message changes
    
    v0.2.2 Quickadd
    - Disabled "comm received vote" and added status of commanders into Timer Info message
    
    v0.3
    - New command
    - Few bugfixes
    - Player cant vote for themselves and be counted as comm ready
    - Some other things ( Gotta write down changes as I do them xD )
    - Plugin starts when at least one team has a player
    - Overall improved plugin handling
    
    v0.4
    - Many bugfixes
    - Quite a lot of polishing
    
    v0.4l
    - License changes
    
    v0.5
    - Lots of new features and changes!
    - Added nc_commcheck
    - Added nc_commchecktime
    - Added nc_lockspec
    - Added nc_lockspechide
    - Added nc_lockspectime
    - Added nc_howmanytimese
    - Added nc_howmanytimes
    - Many bugfixes
    - More...
    
    v0.5.1
    - Fixed nc_howmanytimes messages on wrong place
    - Fixed cv exploding at wrong times
    - Few other small bugfixes
    - Fixed spectator lock
    
    v0.5.2
    - Fixed cv exploding at wrong times with some maps, by first detecting the vehicleid of the cvs
    
    v0.6
    - Improved efficiency of messages
    - Commcheck will now end at the moment when both teams have a commander, less spam
    - Fix speclock sometimes unlocking before the round starts
    - Disable speclock message about unlocking spec, if it was already unlocked by admin
    - Fixed comm exploding if setting both nc_commcheck and nc_commchecktime to 0
    - Fixed some odd things about plugin behaving differently after update or load, than after mapchange
    - Little cleanup, plugin should work more consistently
    - Adjusted some default values (its advised to replace the config file and set it again)
    - Better way of making the plugin start only after somebody joins a team
    - Hidden the console message of emp_sv_vote_commander_time
    - Added separate minimum players settings for comm vote and commcheck
    - Made things more efficient
    - Commcheck now starts 10 seconds after the round started
    
    v0.6.1
    - Added compatibility with Mikleos Votetime Plugin. NCEV will stop extending if !pausevote was used
    - Added admin chat/commands sm_nce and sm_ncd. Or in chat !nce and !ncd. Enables/Disables extending of votes
    
    v0.7
    - Added nc_lockspecmp to set how many minimum clients needed on the server for lockspec to work
    - Added nc_alltalkm If enabled, it will enable alltalk at start of the map and disable when both teams have comms
    
    v0.8 Colored
    - Added colors and adjusted formatting of messages a bit 
    - Added nc_vt to enable or disable VoteTime plugin compatibility (default 1) 
    - Added amount of seconds to the message about extending the vote 
    - Added nc_alltalkmmp minimum players needed for alltalk managing 
    - Added PUG plugin compatibility, (ScardyBob needs to add pug_active 1 to his plugin) 
    - Added 10 seconds timer for turning off AllTalk after both teams have a comm along with announcing it 
    - !nce now resets the status of "Disable extending when PauseVote used", NCEV will continue extending 
    - Added nc_pugc to enable or disable compatibility with PUG plugin (default 1) 
    - Added server commands nc_nce and nc_ncd, which basically do the same thing as sm_nce/sm_ncd but server side
      
     
    Last edited: Apr 17, 2017
    Awpolt, Xyaminou and D.D.D. Destroyer like this.
  2. Sgt.Security

    Sgt.Security Member

    Messages:
    3,135
    Likes Received:
    139
    Trophy Points:
    0
    GOOD JOB
     
    D.D.D. Destroyer and Neoony like this.
  3. !@zy(!z@r!) = Lazylizard

    !@zy(!z@r!) = Lazylizard Member

    Messages:
    25
    Likes Received:
    5
    Trophy Points:
    0
    YES Well made plugin i made.... just to check nc_commchecktime "60" will actully casue a team to win if there is no com? right :P
     
    Neoony likes this.
  4. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    yeah,
    if you enable nc_commcheck "1"
    and set nc_commchecktime "60"

    After the round starts (after end of comm vote) it will be announcing the status of anyone in the cv and at one minute after, if nobody entered the cv at least once, it will explode and the team loses.

    :)
     
  5. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.5.1
    - Fixed nc_howmanytimes messages on wrong place
    - Fixed cv exploding at wrong times
    - Few other small bugfixes
    - Fixed spectator lock

    Link to the latest version v0.5.1: https://git.empiresmod.com/sourcemo...8d6fa247a8db5687d/NoCommExtendVote_v0.5.1.rar

    Issue:
    I noticed if the lockspec is on, the message about unlocking the spec will continue to appear after round starts.
    Will fix in next release

    HOTFIX HERE (latest version):
    http://sourcemod.docs.empiresmod.com/no_commander_extend_vote/NoCommExtendVote.smx
     
    Last edited: Mar 30, 2017
  6. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.5.2
    - Fixed cv exploding at wrong times with some maps, by first detecting the vehicleid of the cvs.

    Hopefully fixed for good :D

    Link to the latest version v0.5.2: https://git.empiresmod.com/sourcemo...7b0364740bf1af7e8/NoCommExtendVote_v0.5.2.rar
    IF you are updating: It might be the best to replace the config file as well and set your settings again. (few "def" fixes and typos and such...)
    It doesnt seem to replace the cfg on plugin update if one cfg already exists.
    So just use the one you download in the above link.
    Or just delete the cfg from server and the plugin will autocreate updated one at start.
    And then set your own settings.

    Main post updated
     
    Last edited: Mar 30, 2017
  7. Kidpaler

    Kidpaler Member

    Messages:
    738
    Likes Received:
    58
    Trophy Points:
    0
    Perhaps some ideas for this plugin, make it the "Definitive Commander Plugin", make the circle so you can't steal the CV, incorporate what MrX said where you can !kick NFcommander (message to team) etc to allow better management of commanders.
     
  8. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    I was thinking to keep that for a separate plugin. As this one is already messy enough as it is ( my first plugin xD )

    But considering that my initial (easier to do) idea of detecting when certain player gets out of cv, kinda wont work because one of the cvs seems to miss the vehicle_exit event for some reason.
    (at least when I tested with net_showevents 2)
    So I will need to figure out all the stuff about how to get entity properties, and which property actually means that somebody is in and who is in...and similar stuff...
    Its all a bit deeper than just detecting stuff from game events xD
    So I need to figure stuff out. xD

    CV locking was definitely on my planned to do list.
    Still thanks for the suggestion.

    Not yet sure about the !kick message thing, I would rather want to first figure out the basic plugins like surrender or cv lock.

    I just wanna get to the point where this comm vote extend plugin is more or less issue-less and usable as it is now (event based). And then I look at the other ones like surrender or cv lock. And then maybe later redo this plugin so that it more properly detects stuff (events arent too good way to detect things).
     
    Last edited: Mar 30, 2017
  9. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.6 Clean
    - Improved efficiency of messages and reduced them to minimum
    - Commcheck will now end at the moment when both teams have a commander, less spam
    - Fix speclock sometimes unlocking before the round starts
    - Disable speclock message about unlocking spec, if it was already unlocked by admin
    - Fixed comm exploding if setting both nc_commcheck and nc_commchecktime to 0
    - Fixed some odd things about plugin behaving differently after update or load, than after mapchange
    - Little cleanup, plugin should work more consistently
    - Adjusted some default values (its advised to replace the config file and set it again if you are updating)
    - Better way of making the plugin start only after somebody joins a team
    - Hidden the console message of emp_sv_vote_commander_time
    - Added separate minimum players settings for comm vote and commcheck
    - Made things more efficient
    - Commcheck now starts 10 seconds after the round started


    Link to the latest version v0.6: https://git.empiresmod.com/sourcemo...04388d312da45e52eab/NoCommExtendVote_v0.6.rar

    This version is A LOT cleaner.
    Completely minimized the spam and made a lot of changes and fixes.
    Also new command "nc_commcheckmp" to set minimum players required for commcheck.

    Replace your config if you are updating from older version and set your settings again!
    Or you might be left with confusing descriptions in your config file. Or commands missing.

    Main post updated.
     
    Last edited: Apr 2, 2017
    D.D.D. Destroyer and Xyaminou like this.
  10. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.6.1 Clean
    - Added compatibility with Mikleos Votetime Plugin. NCEV will stop extending if !pausevote was used
    - Added admin chat/commands sm_nce and sm_ncd. Or in chat !nce and !ncd. Enables/Disables extending of votes

    Link to the latest version v0.6.1: https://git.empiresmod.com/sourcemo...f7db96fde3b2fa417/NoCommExtendVote_v0.6.1.rar

    Pushed out compatibility patch for Mikleos Votetime Plugin, so that people are not discouraged to use both plugins.
    And added chat commands for admins to disable or enable extending of comm vote: !nce or !ncd

    Only need to replace your config if you are updating from lower than v0.6
     
    Last edited: Apr 4, 2017
  11. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.7
    - Added nc_lockspecmp to set how many minimum clients needed on the server for lockspec to work
    - Added nc_alltalkm If enabled, it will enable alltalk at start of the map and disable when both teams have comms


    Link to the latest version v0.7: https://git.empiresmod.com/sourcemo...b9b2d76461b08d3a9ac/NoCommExtendVote_v0.7.rar

    Added nc_lockspecmp so you are able to set how many clients on the server + clients connecting needed for lockspec to work.
    Added nc_alltalkm Alltalk managing at start of the round. If this is enabled, it will enable alltalk until both teams have comms, or until the round starts.

    Best if you replace your config file and set your settings again.
    Or just add new commands into the config.

    Main post updated
     
    Last edited: Apr 9, 2017
  12. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    Hi, I'm working on my draftpick plugin and I'm trying to find a way to deactivate your comm vote extension dynamically during the captain vote and pick phases. It seems like you precache all of your cvars so changing them doesn't help. Is there any way I can achieve this?

    Otherwise there's going to be a plugin war.

     
    Last edited: Apr 17, 2017
  13. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    I guess you could use commands
    sm_nce - vote extending enabled
    sm_ncd - vote extending disabled

    But I could simply add a cvar or server commands for you, if it detects your plugin.
    Best if you give me a cvar which changes in your plugin when its active.

    This could all be even easier if you participated on the gitlab and hipchat xD
    Iam totally open for compatibilities xD
     
    Last edited: Apr 17, 2017
  14. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    I will be adding Server Commands
    nc_nce
    - vote extending enabled
    nc_ncd - vote extending disabled

    https://git.empiresmod.com/sourcemo...mmit/afee36659fef1dab9efaa6a77b302f315715dc27

    Which will do the same thing as the admin commands sm_nce / sm_ncd (!nce / !ncd)
    Which is disabling extending.

    Should be better for this than admin commands.

    It will also print the message about enabling/disabling it only to server console if used over server command.
    Only at marktime it will say that extending was disabled by admin.

    You can freely enable or disable it at any time.
     
    Last edited: Apr 17, 2017
  15. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    OK that's good I can use the commands to disable during the draft and enable at the end.
     
  16. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    Update
    v0.8 Colored
    - Added
    Colors and adjusted formatting of messages a bit
    - Added nc_vt to enable or disable VoteTime plugin compatibility (default 1)
    - Added amount of seconds to the message about extending the vote
    - Added nc_alltalkmmp minimum players needed for alltalk managing
    - Added PUG plugin compatibility, (ScardyBob needs to add pug_active 1 to his plugin)
    - Added 10 seconds timer for turning off AllTalk after both teams have a comm along with announcing it

    - !nce now resets the status of "Disable extending when PauseVote used", NCEV will continue extending
    - Added nc_pugc to enable or disable compatibility with PUG plugin (default 1)
    - Added server commands nc_nce and nc_ncd, which basically do the same thing as sm_nce/sm_ncd but server side


    Link to the latest version v0.8 Colored: https://git.empiresmod.com/sourcemo...1e7da618d09f36e8022/NoCommExtendVote_v0.8.rar
    ----------------------------
    New Server Commands:
    Code:
    "nc_nce"
    "Enable extending of comm vote. Server command"
    
    "nc_ncd"
    "Disable extending of comm vote. Server command"
    New Cvars: (add this to config, if you are updating from older version)
    Code:
    "nc_alltalkmmp" "def. 8"
    "How many players needed to enable managing alltalk by NCEV. (Clients on the server + connecting clients.)"
    
    "nc_vt" "def. 1"
    "Enable(1)/Disable(0) If this is enabled and you use VoteTime pause, NCEV will stop extending."
    
    "nc_pugc" "def. 1"
    "Enable(1)/Disable(0) compatibility with ScardyBobs PUG plugin." 
    Added my color standards to wiki: https://wiki.empiresmod.com/Sourcemod_Plugins#Plugin-Making_tips

    Main post updated
     

Share This Page