Raised This Month: $404 Target: $400
 101% 

[L4D\2] Campaign/Map Voter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
satannuts
Member
Join Date: Jan 2010
Plugin ID:
1593
Plugin Version:
0.666 beta
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows players to call a vote to change Campaign/maps.
    Old 04-06-2010 , 02:01   [L4D\2] Campaign/Map Voter
    Reply With Quote #1

    [L4D\2] Campaign/Map Voter
    by satannuts

    About:
    [L4D\2] Campaign/Map Voter gives players the ability to start a vote to change campaigns/maps. This plugin is meant for servers that have a static gamemode. It checks the current gamemode and displays a list of maps available for that game mode. Also admins with mapchange flag will bypass the voting process and instantly initiate a changelevel.

    This is my first plugin. I was looking for a plugin that allows players to vote for custom maps and also allow voting for different gamemodes. So I whipped this one together based on the old l4d_gamemode_changer plugin and the more recent l4d2_campaign manager plugin. Creds to the original authors, but I've changed so much in this one, I guess I can call it my own.

    Usage: Type !mapvote in chat to bring up the map list menu to start a vote.
    For gametypes coop, versus, realism, teamversus: The menu will display Campaigns only. [I can change this if there's enough demand for it.]
    For gametypes survival, scavenge, and teamscavenge: The menu will display all available maps that support these modes.

    This plugin should work for both L4D and L4D2, but I've only tested it on 2.

    Cvars:
    l4d_mapvote_version - Plugin Version
    l4d_mapvote_announce_mode - (default 1) Controls how announcement is displayed. 0 disables the help messages, 1 displays the messages in normal chat window, 2 displays the messages in hint text, 3 displays the messages in center text
    sm_mapvotetime - (default 20) Default time to vote on a map in seconds

    Commands:
    sm_mapvote - Allows players to start a map vote.
    !mapvote
    - Chat command for starting vote.

    Known Issues:
    • None so far.

    Changelog:
    • .666 beta
      • Initial version

    To Do:
    • Add support for Custom Campaigns/Maps - which is the sole reason I used Campaigns instead of individual map names for versus/coop.
    • Add support for voting on gamemodes, though it may be a little complex for me ATM since l4d1 and l4d2 handle gamemodes differently.
    • Any suggestions?

    Install
    This supports both L4D1 and L4D2.
    Place l4d2_mapvote.smx in sourcemod/plugins.
    Or compile l4d2_mapvote.sp with your version of SM.


    ENJOY!!
    Attached Thumbnails
    Click image for larger version

Name:	c3m2_swamp0000.jpg
Views:	28577
Size:	97.8 KB
ID:	63114   Click image for larger version

Name:	l4d2_efp0000.jpg
Views:	29440
Size:	93.9 KB
ID:	63115  
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_mapvote.sp - 7758 views - 10.8 KB)

    Last edited by satannuts; 04-20-2010 at 14:56.
    satannuts is offline
    terminator2k2
    Senior Member
    Join Date: Feb 2010
    Old 04-06-2010 , 08:25   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #2

    hi there , is this just for the bog standard 5 l4d2 maps atm.?

    not to fussed on game mode change but to add custom maps to the vote is a must as i host around 14 addon maps......
    terminator2k2 is offline
    satannuts
    Member
    Join Date: Jan 2010
    Old 04-06-2010 , 12:40   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #3

    Quote:
    Originally Posted by terminator2k2 View Post
    hi there , is this just for the bog standard 5 l4d2 maps atm.?

    not to fussed on game mode change but to add custom maps to the vote is a must as i host around 14 addon maps......
    That is correct. I've just started with the basics, as I'm still new to scripting.
    Same here. I keep my servers on a static gamemode.

    And about the custom maps, that's the whole reason I started this one...
    I wanted to see if I could actually make a working plugin first with map votes.

    Next planned step is exploring different ways to call up custom maps.

    But there are some problems with custom maps, for example a few I checked out have bad mission.txt files and I've had to extract them from the addons.vpk files, correct them, and rebuild the vpk files.

    So far I've corrected:
    25tolifemission.txt, braindead.txt, clan bunker.txt, deadontimeii.txt, demosurvival.txt ['a noble effort' map], rtv_mission.txt, and scoolout.txt.
    All these maps/campaigns had bad mission.txt files which should have be corrected before they were released.

    Hey since you run custom maps, maybe you [or anyone else], want to test something out for me:
    Check your server in HLSW, and check player times. I've noticed a bug: when server is running default maps, player time shows correct. But when a custom map is loaded, player time is negative time and isn't reported correctly. On sites like GameTracker, this makes stat tracking virtually impossible since the negative time played is making players show as bots and therefore don't get recorded stats.

    Besides this plugin, I would like to explore if there is any way to fix the player time on custom maps with a SM plugin/ext/ect.

    Thanks for yer input.
    satannuts is offline
    terminator2k2
    Senior Member
    Join Date: Feb 2010
    Old 04-06-2010 , 13:58   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #4

    hi there, not tried this yet but im always playing with peoples code.......


    ill give that a look wen im next on

    Last edited by terminator2k2; 04-06-2010 at 14:18.
    terminator2k2 is offline
    Eraa
    Senior Member
    Join Date: Mar 2010
    Old 04-06-2010 , 15:28   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #5

    Thanks for this! I have some suggestion has to propose.

    1. Allow voting after x sec on the current MAP.
    Because the votes are often to launch at the beginning of MAP, which makes it possible to let finish charging the other players.

    2. Disable voting on the news MAP peoples have vote.
    To prevent players who would have to vote NOT with the preceding vote to start again a new MAP.
    Eraa is offline
    terminator2k2
    Senior Member
    Join Date: Feb 2010
    Old 04-06-2010 , 18:54   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #6

    i have a couple of problems......

    1.cant get the welcome message to show which advertises the plugin.....

    2.if i dont select a map and exit it...it crashes the server......

    could this be caused by a plugin conflict.?

    ill check sourcemod for errors......

    also ive edited my source code to include my addon maps and it works a treat.....

    errors are:
    L 04/06/2010 - 22:16:14: [SM] Native "GetConVarInt" reported: Invalid convar handle 0 (error 4)
    L 04/06/2010 - 22:16:14: [SM] Displaying call stack trace for plugin "l4d2_mapvote.smx":
    L 04/06/2010 - 22:16:14: [SM] [0] Line 64, /home/groups/sourcemod/upload_tmp/phpUYJb6K.sp::Timer_WelcomeMessage()

    Last edited by terminator2k2; 04-06-2010 at 19:05.
    terminator2k2 is offline
    Blakeocity
    Senior Member
    Join Date: Nov 2009
    Old 04-06-2010 , 20:06   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #7

    Gonna test this out later today.

    Would you be able to bring up a menu showing the available gamemodes when players type !mapvote, and then when the gamemode is selected bring up a menu showing the maps/campaigns available for that gamemode?

    Then show some text, something like,

    Player has started a \x04Versus\x01 vote for \x04No Mercy
    Blakeocity is offline
    Newf
    Senior Member
    Join Date: Dec 2009
    Old 04-06-2010 , 20:54   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #8

    this is almost what i'm looking for. I need something that lets the players vote for the next map when the last map in a campaign starts. is it possible to do it with this? not worried about gamemodes, but the custom maps option is a plus since i have some custom ones i want to put in.

    EDIT: I don't want the players to have access to voting though. I just want them to pick from a list when the option pops up. Last thing I want are people abusing the vote option.

    good job.
    __________________
    I like to drink beer and shoot stuff. Video games are fun too i guess!

    Last edited by Newf; 04-06-2010 at 20:57.
    Newf is offline
    Blakeocity
    Senior Member
    Join Date: Nov 2009
    Old 04-06-2010 , 21:44   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #9

    It's telling non admin players that they don't have access to the !mapvote command, they can still start a vote though, however the map doesn't change even if the vote is successful.
    Blakeocity is offline
    Blakeocity
    Senior Member
    Join Date: Nov 2009
    Old 04-06-2010 , 21:49   Re: [L4D\2] Campaign/Map Voter
    Reply With Quote #10

    How do you remove the flag for mapvote? I tried it but I can't recompile.

    Last edited by Blakeocity; 04-06-2010 at 22:01.
    Blakeocity 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 19:12.


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