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

[TF2/ANY] VIP (weighted) Mapvotes - Updated 19 Sept 2014


Post New Thread Reply   
 
Thread Tools Display Modes
Author
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Plugin ID:
4221
Plugin Version:
1.0.0.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    VIP Mapvotes - Allows you to setup admin flags and maps to have a weighted votes added to them. Like VIP can stand for 3 votes instead of 1. Maps can add to votes also.
    Old 05-27-2014 , 02:07   [TF2/ANY] VIP (weighted) Mapvotes - Updated 19 Sept 2014
    Reply With Quote #1

    VIP Mapvotes

    I was going to call this, Weighted Map Votes, but decided the main use we use this for on our servers is for VIP players, I decided to call it VIP Map Votes.

    This is work in progress and is not a final product. I just created this within the last 2 days and only tested it for 1 day with our server full of VIPs. At this time, there does not seem to be any known quirks.

    I'm also sorry there isn't many CVARs for customizations, and you will have to modify some numbers on the top of the source and compile it for better customization. I added comments where you can modify the code, and explained in best detail what they are used for. I will be adding more CVARS as I work on this, so please don't down me for that yet.

    Only the Admin Flag you assign can see the Time Remaining and the Vote Numbers, everyone else just sees the menu. I decided not to let our VIP see the voting progress in the center screen for obvious reasons.




    By the default vip_mapvotes.ini file, VIP can type !mapvote or /mapvote in chat to trigger the map voting menu. They can only call for this vote during the last 10 minutes of the map.



    Add to your server.cfg:

    ** 19 sept 2014 NEW ** On our server the location ends up being:
    tf2/tf/addons/sourcemod/configs/vip_mapvotes.ini

    vip_matvote_location "configs/vip_mapvotes.ini"

    ** 19 sept 2014 Updated ** Use Admins flag(s) or "anyone" to assign players whom can see the voting progress:
    mapvote_admin_can_see_vote_progress c

    The amount of minutes left on map when the map vote command can be triggered. (0 = disabled) (default 10):

    vip_mapvotes_voting_allowed_time 10

    The Number of minutes to set a map for when the map is changed to the map voted by VIP MAPVOTES. (0 = disabled) (default 20):

    vip_mapvotes_map_timelimit 20

    The number of warnings that will let a vip know they can place a map vote (0 = disabled) (default 2):

    vip_mapvotes_vote_timer_warning 2

    Keep logs of specific important things that happen in vip_mapvotes. Like, who started the vip mapvotes command and what map was choosen. (default 1 = on)
    vip_mapvotes_logs 1


    NOW The Fun customization part!

    vip_mapvotes.ini

    This is the customization file.

    ** 19 sept 2014 Updated ** The CanTriggerMapVote section is the section you setup for who can trigger the map votes. The program looks thru the code from top to bottom. So the order is best to start from top to bottom. Yes means the person with that admin flag or flags is allowed to type vipmapvote or what ever you assign your command in the sourcecode. You can use combonations. Like "ab" would mean they must have both "a" and "b" flags in order to be able to use this command. ** You can now use "anyone" as a flag so that anyone can trigger the map vote.

    ** 19 sept 2014 NEW ** The MapVotingCommands section is the section where you can setup the chat commands that trigger the map voting.

    The AdminFlags section is order of top to bottom for flag searches. If the player has the cbt flag, that player will only receive bonus points for the "c" flag only. The Bonus points are applied to that player's vote. A player with "c" would gain +3 votes to what ever they choose. You can put negative numbers on this section if you want certain flags to have a negative weight.

    ** 19 sept 2014 NEW ** The NamesBeginWith section is the section what you can use to add bonus points to certain players that begin with certain words or clan tags.

    NamesContain is a section that are going to be added soon and have not yet been added. Some of the sourcecode has been already added.

    The MapPool is the section that holds all the maps that a voter can choose from for this plugin. The numbers beside the maps are how much bonus each player will gain for picking that map on a map vote. You can add negative numbers too, if for instance you only want your VIP to vote for a certain map.. just make it like -2 if the VIP has a positive 3.

    The MapPool contains the TF2 Quickplay list of maps, but you can customize this how you see fit for your game.


    IF your VIP only has the "a" flag, please be sure to modify the file "vip_mapvotes.ini" and change "no" to "yes". Our trial VIP have "a", and our real VIP has "ab".

    ** 19 sept 2014 Updated vip_mapvotes.ini text below**
    Code:
    "AwesomeSettings" 
    { 
        "CanTriggerMapVote" 
        { 
        // "Admin Flag"                "Can trigger !mapvote? yes or no" // comment on default admin flags 
        // Can do Mixes being required instead of just checking for singles, 
        // but if you do require ab, then they MUST have both a and b or 
        // any other combonation 
     
        // The order of choice is from top to bottom: 
            "anyone"                        "no" // anyone can trigger map vote 
     
        // Combonations: 
            "ab"                            "no" //requires both a and b flags 
        // Singles: 
            "a"                            "yes" //Reserved slot access. 
            "b"                            "yes" //Generic admin; required for admins. 
            "c"                            "yes" //Kick other players. 
            "d"                            "yes" //Ban other players. 
            "e"                            "yes" //Remove bans. 
            "f"                            "yes" //Slay/harm other players. 
            "g"                            "yes" //Change the map or major gameplay features. 
            "h"                            "yes" //Change most cvars. 
            "i"                            "yes" //Execute config files. 
            "j"                            "yes" //Special chat privileges. 
            "k"                            "yes" //Start or create votes. 
            "l"                            "yes" //Set a password on the server. 
            "m"                            "yes" //Use RCON commands. 
            "n"                            "yes" //Change sv_cheats or use cheating commands. 
            "o"                            "no" //Custom 
            "p"                            "no" //Custom 
            "q"                            "no" //Custom 
            "r"                            "no" //Custom 
            "s"                            "no" //Custom 
            "t"                            "no" //Custom 
            "z"                            "yes" //Magically enables all flags and ignores immunity values. 
        } 
     
        "MapVotingCommands" 
        { 
        // yes enables command and no disables command 
            "!mapvote"                        "yes" 
            "/mapvote"                        "yes" 
        } 
     
        "AdminFlags" 
        { 
        // ORDER MATTERS! 
        // The order of choice is from top to bottom: 
     
        // "Admin Flag(s)"                "Points for vote (can be negative)" 
            "c"                            "1" // admin 
            "b"                            "1" // real vip 
            "t"                            "1" // custom member 
        } 
     
        "NamesBeginWith" 
        { 
        //    "Name Begins with"            "Points for vote (can be negative)" 
            "-W3E-"                            "1" 
        } 
     
        // NamesContain isn't implemented yet 
        "NamesContain" 
        { 
        //    "Names Contain"            "Points for vote" 
            "none"                    "0" 
        } 
     
        "MapPool" 
        { 
            // Map                Points (Added to vote when picked) 
            "cp_dustbowl"                "0" 
            "cp_egypt_final"            "0" 
            "cp_gorge"                "0" 
            "cp_gravelpit"                "0" 
            "cp_junction_final"            "0" 
            "cp_mountainlab"            "0" 
            "cp_steel"                "0" 
            "cp_5gorge"                "0" 
            "cp_badlands"                "0" 
            "cp_coldfront"                "0" 
            "cp_fastlane"                "0" 
            "cp_freight_final1"            "0" 
            "cp_granary"                "0" 
            "cp_well"                "0" 
            "cp_yukon_final"            "0" 
            "cp_foundry"                "0" 
            "cp_gullywash_final1"            "0" 
            "cp_process_final"            "0" 
            "cp_standin_final"            "0" 
            "cp_snakewater_final1"            "0" 
            "ctf_2fort"                "0" 
            "ctf_doublecross"            "0" 
            "ctf_sawmill"                "0" 
            "ctf_turbine"                "0" 
            "ctf_well"                "0" 
            "koth_badlands"                "0" 
            "koth_harvest_final"            "0" 
            "koth_lakeside_final"            "0" 
            "koth_nucleus"                "0" 
            "koth_sawmill"                "0" 
            "koth_viaduct"                "0" 
            "koth_king"                "0" 
            "pl_badwater"                "0" 
            "pl_frontier_final"            "0" 
            "pl_goldrush"                "0" 
            "pl_hoodoo_final"            "0" 
            "pl_thundermountain"            "0" 
            "pl_upward"                "0" 
            "pl_barnblitz"                "0" 
            "plr_hightower"                "0" 
            "plr_pipeline"                "0" 
            "plr_nightfall_final"            "0" 
            "sd_doomsday"                "0" 
        } 
    }
    As ROOT admin, you can cancel any voting (untested) and issue this comand in your console: sm_rcon sm_cancelvoting

    As ROOT admin you can also Initialize the data, just in cause you need it after doing a cancel vote... sm_init

    As ROOT admin you can also Reload the vip_mapvotes.ini file by typing sm_reloadconfig in the console menu or /reloadconfig in chat.

    Players can type !revote anytime during the voting progress to change their votes.

    You can compile the sourcecode at http://www.sourcemod.net/compiler.php

    Code:
    Change Log:
    
    19 Sept 2014 - version 1.0.0.2 - Added new vip_matvote_location convar, updated CanTriggerMapVote to allow the use of "anyone" flag, added new MapVotingCommands to the vip_mapvotes.ini configuration file to allow server owners to change the map voting command, added sm_reloadconfig, added NamesBeginWith so that you can give bonus points to players whom have names that begin with some text, updated mapvote_admin_can_see_vote_progress to be able to use the new "anyone" flag
    
    31 May 2014 - version 1.0.0.1 - Added Cvars, adding a logging feature to keep track of which VIP uses the command, and which map is set for nextmap.
    
    1.0.0.0 - Initial Commit
    TO DO LIST:

    -- Add translations support
    -- Convert more internal stuff into CVARS
    -- Add bypass support for Ultimate Mapchooser and Extended Mapchooser

    Try it out, let me know of any improvements you'd like to see.
    Attached Files
    File Type: ini vip_mapvotes.ini (3.1 KB, 486 views)
    File Type: sp Get Plugin or Get Source (vip_mapvotes.sp - 1178 views - 26.1 KB)
    __________________

    Last edited by El Diablo War3Evo; 09-19-2014 at 21:38. Reason: updated vip_mapvotes.sp and vip_mapvotes.ini
    El Diablo War3Evo is offline
    Rd1981
    Senior Member
    Join Date: Apr 2011
    Old 05-29-2014 , 05:24   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #2

    does this work in conjunction with a mapchooser plugin ?
    Rd1981 is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 05-29-2014 , 17:52   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #3

    Quote:
    Originally Posted by Rd1981 View Post
    does this work in conjunction with a mapchooser plugin ?

    Depends.

    We have our servers on a rotation setup via the nextmap plugin. If no VIP are in game to use this plugin via vipmapvote command, then it will continue on normal rotation.

    If you plan to use this with a custom mapchooser plugin, you will need to specify which one and then I can work around it.

    After a vote, is setup, this plugin will set the next map using native bool:SetNextMap(const String:map[]);

    If another plugin modifies this command, it may mess with VIP (weighted) Mapvotes.


    It is possible to create work arounds, just need details on what other mapchoosers do you use? If they are private custom plugins, then how do they work?

    Last edited by El Diablo War3Evo; 05-29-2014 at 17:53.
    El Diablo War3Evo is offline
    Rd1981
    Senior Member
    Join Date: Apr 2011
    Old 05-31-2014 , 07:37   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #4

    mapchooser extended is what I use on all the servers except one I use ultimate map chooser.
    Rd1981 is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 05-31-2014 , 15:15   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #5

    Quote:
    Originally Posted by Rd1981 View Post
    mapchooser extended is what I use on all the servers except one I use ultimate map chooser.
    I will look into these plugins and create a optional way for anyone to bypass these plugins and force the "vip's" vote over them as a optional CVAR.

    So, if the VIP sets a map, the optional CVAR if set to 1, would prevent the other plugins from taking over.

    Last edited by El Diablo War3Evo; 05-31-2014 at 15:16.
    El Diablo War3Evo is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 06-08-2014 , 12:24   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #6

    All the MapChoosers, including the stock one that comes with SourceMod, use SetNextMap. Which makes sense since setting the next map is their goal.

    As for the way this plugin is coded (these are the things a plugin approver would normally tell you):
    • Consider using the Overrides system and CheckCommandAccess for permission checks.
    • Rather than writing your own vote system, it's possible to do weighted voting using the SourceMod vote system with a Vote Result callback... just ignore the item_info array/num_items and process the client_info array/num_clients manually.
      • Of course, if you use the SourceMod vote system, it will use the SourceMod vote display system and vip_mapvotes_admin_can_see_vote_progress would be useless.
      • This is also possible with the NativeVotes plugin, but its vote result callback syntax is slightly different
    • Consider using the Translations system for text sent to clients.
    • Consider using the Translations system for Menu titles. This is done via the MenuAction_Display menu action and SetPanelTitle on param2. Sample
    • Consider using ReplyToCommand instead of PrintToChat when a player uses a command. This routes the response to wherever the user typed it (server console, client console, client chat). Note: Responses to menus should still use PrintToChat.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 06-08-2014 at 12:25.
    Powerlord is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 06-09-2014 , 04:59   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #7

    Powerlord, I haven't finished this yet nor put in for a approval yet. I also have translations as part of my To Do list. The sourcemod voting system, just like its admin menu system, is too complex to read / figure out quickly for the average joe. I like to create a more easy to read source, than creating odd loopbacks and stuff.

    ReplyToCommand .. I've had a hard understanding why sometimes this command didn't work. So I used PrintToChat instead. Yeah, sometimes ReplyToCommand wouldn't get the message thru, maybe it got confused or something?
    __________________
    El Diablo War3Evo is offline
    El Diablo War3Evo
    Veteran Member
    Join Date: Jun 2013
    Old 09-19-2014 , 20:25   Re: [TF2/ANY] VIP (weighted) Mapvotes
    Reply With Quote #8

    Quote:
    Originally Posted by Powerlord View Post
    Consider using the Overrides system and CheckCommandAccess for permission checks.
    I thought about it, and because of the complex way I am doing this.. I have decided to just allow them to continue to use the configuration file supplied.

    Quote:
    Originally Posted by Powerlord View Post
    Consider using the Translations system for text sent to clients.
    I still need to add the translations system :/ .. I personally dislike of the translations system, and because of that, it will probably be the last thing I do.

    Quote:
    Originally Posted by Powerlord View Post
    Consider using ReplyToCommand instead of PrintToChat when a player uses a command. This routes the response to wherever the user typed it (server console, client console, client chat). Note: Responses to menus should still use PrintToChat.
    I couldn't get ReplyToCommand to work in the function call I was using, so I dumped that and will use what works: PrintToChat.
    __________________

    Last edited by El Diablo War3Evo; 09-19-2014 at 20:27.
    El Diablo War3Evo is offline
    sparkie951
    Member
    Join Date: Jul 2014
    Old 11-29-2014 , 15:46   Re: [TF2/ANY] VIP (weighted) Mapvotes - Updated 19 Sept 2014
    Reply With Quote #9

    This works great.... Only thing I would like to see to be able to do is to change the map voting list from say 5 to 3 or something like that...
    sparkie951 is offline
    mlov420
    Senior Member
    Join Date: May 2013
    Old 06-23-2019 , 07:11   Re: [TF2/ANY] VIP (weighted) Mapvotes - Updated 19 Sept 2014
    Reply With Quote #10

    This plugin is pretty good but it does appear to have a few big issues in CS:GO.

    - Many times if there is more than 1 page of maps to choose from during the !mapvote map selection process, maps chosen from the 2nd+ page don't get put in the vote and are replaced at random

    - Player 'map chosen' feedback after their vote is often wrong or doesn't display

    - Map with winning votes is often not shown as the winner (one of the losing maps is shown as the winner and set as nextmap)

    - On times that it works correctly, if 2+ maps are tied in voting, the winner is always chosen as the map that is listed 1st in the .ini file, even when all maps carry the same vote weight. This one is not a big deal but it would be nice if there was a random element to it.


    Not sure if OP is interested in updating this plugin but it's like the only VIP voting plugin out there. I'd be willing to throw a couple bucks to someone to make this work or sell their VIP weighted voting plugin.
    mlov420 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 11:38.


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