AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D\2] Campaign/Map Voter (https://forums.alliedmods.net/showthread.php?t=123497)

satannuts 04-06-2010 02:01

[L4D\2] Campaign/Map Voter
 
3 Attachment(s)
[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!!

terminator2k2 04-06-2010 08:25

Re: [L4D\2] Campaign/Map Voter
 
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......

satannuts 04-06-2010 12:40

Re: [L4D\2] Campaign/Map Voter
 
Quote:

Originally Posted by terminator2k2 (Post 1141193)
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. :)

terminator2k2 04-06-2010 13:58

Re: [L4D\2] Campaign/Map Voter
 
hi there, not tried this yet but im always playing with peoples code.......


ill give that a look wen im next on

Eraa 04-06-2010 15:28

Re: [L4D\2] Campaign/Map Voter
 
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.

terminator2k2 04-06-2010 18:54

Re: [L4D\2] Campaign/Map Voter
 
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()

Blakeocity 04-06-2010 20:06

Re: [L4D\2] Campaign/Map Voter
 
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

Newf 04-06-2010 20:54

Re: [L4D\2] Campaign/Map Voter
 
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.

Blakeocity 04-06-2010 21:44

Re: [L4D\2] Campaign/Map Voter
 
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 04-06-2010 21:49

Re: [L4D\2] Campaign/Map Voter
 
How do you remove the flag for mapvote? I tried it but I can't recompile.


All times are GMT -4. The time now is 15:22.

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