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

[L4D\2] Campaign/Map Voter


Post New Thread Reply   
 
Thread Tools Display Modes
terminator2k2
Senior Member
Join Date: Feb 2010
Old 04-07-2010 , 06:30   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #11

hi there, is some of this code been copied and pasted .? hehe

ive found this is the cource code:

public Action:Timer_WelcomeMessage(Handle:timer, any:client)
{
new String:announce[] = "\x01[SM] To call a vote to change map/campaign votes, Type: \x04!mapvote\x01 in chat.";
if (IsClientConnected(client) && IsClientInGame(client) && !IsFakeClient(client))
{
switch (GetConVarInt(FindConVar("l4d_backpack_help_m ode")))
{
case 1:
{
PrintToChat(client, announce);
}
case 2:
{
PrintHintText(client, announce);
}
case 3:
{
PrintCenterText(client, announce);
}
default:
{
PrintToChat(client, announce);
}
}
}
}



is this right.?

switch (GetConVarInt(FindConVar("l4d_backpack_help_m ode")))

shouldnt this line be:

switch (GetConVarInt(FindConVar("l4d_mapvote_announc e_mode")))


i changed this and still does not work.......

can any one confirm server crash wen no options chose.?

Last edited by terminator2k2; 04-07-2010 at 08:15.
terminator2k2 is offline
satannuts
Member
Join Date: Jan 2010
Old 04-07-2010 , 13:24   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #12

sorry, been a little busy this week with work.
Everyone who commented, I will reply to everyone tonight and have another look over the code... until then...

@terminator2k2:
yeah, I copy/pasted all of the code, but reworked most of it to work, sorta.
The welcome message/announcement was copied from backpack plugin, but I haven't a chance to run thru it.
Also, I think I've found out why the server crahses when canceling vote, and also why players without mapchange flag, can't change maps... I will tidy up the code in the next few days... please keep the feedback coming in, in the meantime.

laterz

Last edited by satannuts; 04-07-2010 at 13:28.
satannuts is offline
terminator2k2
Senior Member
Join Date: Feb 2010
Old 04-07-2010 , 13:42   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #13

hi there, ive edited my source code so it shows a hint message only...

so i got rid of :

l4d_mapvote_announce_mode

havent tested it since but i think it should work as ive modded a few plugins this way to my liking......

wats ur solution to server crash.?

also being admin, the map changes straight away, no vote initiates but i think thats how its ment to work......

now onto mission.txt files, how are u unpacking the vpks?

i can change to my custom maps no problem but want to make sure its the correct missions for the maps....

having so many cant keep track of what mission is for wat map.....so if i can open the vpks i can see which mission is for each map......

thank you and keep it going....will get there in the end
terminator2k2 is offline
satannuts
Member
Join Date: Jan 2010
Old 04-07-2010 , 14:07   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #14

Quote:
Originally Posted by terminator2k2 View Post
hi there, ive edited my source code so it shows a hint message only...

so i got rid of :

l4d_mapvote_announce_mode

havent tested it since but i think it should work as ive modded a few plugins this way to my liking......

wats ur solution to server crash.?

also being admin, the map changes straight away, no vote initiates but i think thats how its ment to work......

now onto mission.txt files, how are u unpacking the vpks?

i can change to my custom maps no problem but want to make sure its the correct missions for the maps....

having so many cant keep track of what mission is for wat map.....so if i can open the vpks i can see which mission is for each map......

thank you and keep it going....will get there in the end
good thing you caught me on lunch break.lol

for the server crashes, I think I need to add a "PluginEnd" or "Plugin return" to the code (I'm still reading up on this), but since I'm really not sure how everything works completely, I have a lot of testing/ trial-and-error ahead. Its how i got this far.

Yes sir! Being admin bypasses the vote and changes map immediately.

GCFScape can be used to extract files from vpk's. And also check on Valve's developer wiki for instructions on how to repack the vpk's when done. I tried just making a 'missions' folder in l4d2/left4dead directory, but the game still reads it from the vpk's and not the new foder. Bummer.

If you need any missions files that I listed on the previous page, let me know. Anyways, If I get some time tonight, I'll take a look over everything and maybe post an updated version.
later
satannuts is offline
terminator2k2
Senior Member
Join Date: Feb 2010
Old 04-07-2010 , 17:57   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #15

hi there, thanks for the above.......got the mission files.......and updated my plugin to accomondate the new maps......

had 1 friend say wen i typed !mapvote and chose which map i wanted, every thing looked fine my side but friend said he had a level list of around 5 different ones from different maps.? cant confirm that as i didnt see it......

can confirm my server shows my hint message with my updated source.....

also non admins or randoms unable to change map with this plugin.....they get menu and vote, vote initiates but map doesnt change......

server crash u know about.....

server crash doesnt happen with non admins due to it not working with them anyway.....

would love to help but can only do basic stuff by comparing other plugins of similar codeing.......

thanks once again

Last edited by terminator2k2; 04-07-2010 at 18:04.
terminator2k2 is offline
KELO
New Member
Join Date: Nov 2009
Old 04-11-2010 , 05:28   HELP!
Reply With Quote #16

Sorry guys, my english sucks, but i don't get it good.
I play in my server a lot of custom campaigns. ok, i (or any player) need to start a vote. what i must write !mapvote on chat?
second, how and where i supose to paste the list of custom maps that server read for?
i read the replay of Terminator that we must paste the list of maps in mission.txt file. canīt you show me any example?
Thanks for your time

Last edited by KELO; 04-11-2010 at 05:33.
KELO is offline
terminator2k2
Senior Member
Join Date: Feb 2010
Old 04-11-2010 , 05:58   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #17

hi there, yea you type !mapvote in chat, it brings up wat maps you have put in the following part of the source script....

ive found this only works for admins so ive took off the plugin advertiser completely.......

remember though if you press the wrong button, server will crash......

if u open up to sp file in notepad......scroll down to this part:

if(game_l4d2)
{
if(strcmp(g_gameMode, "coop", false) == 0)
{
AddMenuItem(mapMenu, "c1m1_hotel", "Dead Center");
AddMenuItem(mapMenu, "c2m1_highway", "Dark Carnival");
AddMenuItem(mapMenu, "c3m1_plankcountry", "Swamp Fever");
AddMenuItem(mapMenu, "c4m1_milltown_a", "Hard Rain");
AddMenuItem(mapMenu, "c5m1_waterfront", "The Parish");



then u need to add your custom map info under the last one the parish......

so i used the programme which the op gave me the link for gcf scape to open up the vpk to get the missions file for each custom map.....(if u already know the map names for the custom maps then u dont need to do this.

so if you have say city 17 custom map.....find out what the first map of the campaign is.....in this case its : l4d2_city17_01

so we write a line underneath the last 1 (look out as its case sensitive...needs to exact or will not recompile)

so we now have:

AddMenuItem(mapMenu, "l4d2_city17_01", "City 17");

put this here:

if(game_l4d2)
{
if(strcmp(g_gameMode, "coop", false) == 0)
{
AddMenuItem(mapMenu, "c1m1_hotel", "Dead Center");
AddMenuItem(mapMenu, "c2m1_highway", "Dark Carnival");
AddMenuItem(mapMenu, "c3m1_plankcountry", "Swamp Fever");
AddMenuItem(mapMenu, "c4m1_milltown_a", "Hard Rain");
AddMenuItem(mapMenu, "c5m1_waterfront", "The Parish");
AddMenuItem(mapMenu, "l4d2_city17_01", "City 17");


do this for every custom map then file and save the sp file......

then we goto the source compiler which is found here:

http://www.sourcemod.net/compiler.php

upload your sp.....click compile then download your modified .smx plugin

put it in your plugins folder and try.......
terminator2k2 is offline
shotgunelvis
Member
Join Date: Nov 2009
Old 04-12-2010 , 13:22   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #18

It doesn't see the addon campaigns. Can that be fixed?
shotgunelvis is offline
KELO
New Member
Join Date: Nov 2009
Old 04-15-2010 , 21:44   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #19

in fact, i got left4dead 1. is it the same thing? thanks for your help...again
KELO is offline
satannuts
Member
Join Date: Jan 2010
Old 04-16-2010 , 08:01   Re: [L4D\2] Campaign/Map Voter
Reply With Quote #20

Quote:
Originally Posted by KELO View Post
in fact, i got left4dead 1. is it the same thing? thanks for your help...again
yes, put l4d2 maps under if game l4d2,
and add l4d1 maps under the else part - then recompile.

I have removed the beta version from my server due to the bugs that causes crashes/errors.

Sorry, I haven't had time to post a new version yet.
I am working on a complete re-write as most of the old code is copy/pasted/modified from other sources, and I plan on having it automatically scan for custom maps.. and I'm looking into several voting alternatives as well.

I should find some time this weekend.
satannuts 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 08:48.


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