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

[L4D] Co-op Difficulty Blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Author
crazydog
AlliedModders Donor
Join Date: Jan 2006
Plugin ID:
1169
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Blocks specified difficulties from being played on server
    Unapprover:
    Reason for Unapproving:
    requested
    Old 09-19-2009 , 14:30   [L4D] Co-op Difficulty Blocker
    Reply With Quote #1

    Description:

    Valve lets you limit which gamemodes can be played on your server, but not which difficulties for the coop gamemode. This plugin lets you do that!

    Because we can not hide the server from the lobby based on difficulty, this plugin does the next best thing (which is still rather crude). If it detects a disallowed difficulty, it simply kicks everyone before they connect to the server with a message similar to "Easy mode is disallowed on this server".

    Cvars: l4d_difficulty.cfg is created in cfg/sourcemod/

    l4d_difficulty_version - Shows the version
    l4d_allow_easy - Allow easy games? Default=1(yes)
    l4d_allow_normal - Allow normal games? Default=1(yes)
    l4d_allow_advanced - Allow advanced games? Default=1(yes)
    l4d_allow_expert - Allow expert games? Default=1(yes)

    Changelog:

    Code:
    1.1
     - Fixed Advanced + Expert restrictions not working
    1.0
     - Initial Release
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_difficulty.sp - 933 views - 2.5 KB)

    Last edited by crazydog; 09-19-2009 at 14:56.
    crazydog is offline
    KRosen
    Junior Member
    Join Date: Apr 2009
    Old 09-20-2009 , 08:38   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #2

    idk much about l4d, but maybe its possible to change the difficulty to the lowest allowed difficulty based on the 'allowed'

    so if the lobby comes in easy, but easy is disabled, set to medium.
    if lobby comes in expert, but its disabled, force it to hard mode instead?

    ^_^ otherwise interesting idea dude!
    KRosen is offline
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 09-20-2009 , 08:43   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #3

    That's what I wanted to do in the first place, but it seems impossible. That's why I decided on the crude method of kicking.

    Another option is to notify the players when they connect, that if they don't change the difficulty within a certain amount of time, they will be kicked. That would seem to be more inconveniencing to people, since they would not be able to play the difficulty they want after starting the game.

    Even removing the lobby reservation does not let me change z_difficulty.

    As you can see:
    Code:
    sm_unreserve
    status
    players : 1 humans, 0 bots (4 max) (not hibernating) (unreserved)
    rcon z_difficulty Easy
    Unable to change difficulty to 'Easy', it is locked due to lobby reservation.
    sm_cvar z_difficulty Easy
    [SM] Changed cvar "z_difficulty" to "Easy".
    rcon z_difficulty
    "z_difficulty" = "Hard" ( def. "Normal" )
     game replicated
     - Difficulty of the current game (Easy, Normal, Hard, Impossible)
    If anyone knows HOW to do this, please let me know!

    Last edited by crazydog; 09-20-2009 at 08:50.
    crazydog is offline
    Mr. Zero
    Veteran Member
    Join Date: Jun 2009
    Location: Denmark
    Old 09-20-2009 , 17:48   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #4

    How about look at the Vote Manger code? Make one of the clients vote for expert and look for the "pass" code in Vote Manger so the vote is auto passed.

    And do the "veto" code if they try to change it back.
    Mr. Zero is offline
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 09-20-2009 , 22:55   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #5

    That's another thing I was considering, I could just check for that plugin, and if it's not loaded, kick!
    crazydog is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 09-21-2009 , 03:10   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #6

    Umm, why it kicks players? They wont like such behaviour and wont even join your server nexttime, because it kicks for no reason besides some mysterious game difficulty limitations. Its not good way to do imo.

    Did you tried to change difficulty using the plugin itself? I mean SetConVarStirng.
    __________________

    Last edited by olj; 09-21-2009 at 03:12.
    olj is offline
    leonil7
    BANNED
    Join Date: May 2009
    Location: GB
    Old 09-21-2009 , 07:16   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #7

    useful. thanks!
    leonil7 is offline
    Send a message via ICQ to leonil7 Send a message via AIM to leonil7 Send a message via Yahoo to leonil7 Send a message via Skype™ to leonil7
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 09-21-2009 , 10:49   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #8

    Quote:
    Originally Posted by olj View Post
    Umm, why it kicks players? They wont like such behaviour and wont even join your server nexttime, because it kicks for no reason besides some mysterious game difficulty limitations. Its not good way to do imo.

    Did you tried to change difficulty using the plugin itself? I mean SetConVarStirng.
    Like I've said, I'm aware it's a very crude way of getting this done.

    About people not joining the servers:
    They wont KNOW what server did this to them, unless they check their console. They can't hide certain servers from matchmaking.

    When they are kicked, it states that the server does not allow whatever difficulty they were on.

    SetConVarString won't work. That's the same thing sm_cvar does.

    Again, I know it's not a good way to do it, but it was the best, simplest way I could think of. I'm going to try the other ideas brought up in this thread.

    Last edited by crazydog; 09-21-2009 at 11:00.
    crazydog is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 11-21-2009 , 01:44   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #9

    Current plugin status? I can't see this being very useful...
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 11-21-2009 , 07:53   Re: [L4D] Co-op Difficulty Blocker
    Reply With Quote #10

    If necessary you can unapprove it for now. I'll be able to work on it when the semester's over in 3 weeks.

    It's useful for people who don't want certain difficulty games being played on their servers for whatever reason.
    crazydog 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 08:44.


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