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

[L4D1 & L4D2] Vote difficulty + (no black screen)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Plugin ID:
6631
Plugin Version:
1.17
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    11 
    Plugin Description:
    Vote for game difficulty
    Old 07-05-2019 , 04:28   [L4D1 & L4D2] Vote difficulty + (no black screen)
    Reply With Quote #1

    Description:
    This plugin replaces annoing black screen vote for difficulty by translucent menu with ability to execute per-difficulty configs.
    Features:
    - no black screen.
    - vote announcement
    - flexible configuration of access rights
    - ability to execute your own config files per each difficulty
    - ability to reset convars by executing your own default config file before difficulty is applied
    - all actions are logged (who vote - ip/country/nick/SteamId, who tried to vote witout success, what difficulty ...)
    - ability to setup 2 additional difficulty levels "Hard +" and "Expert +" with their own config files (see ConVars).
    Permissions:
    - by default, vote can be started by everybody (adjustable) if immunity and player count checks passed.
    - ability to set minimum time to allow repeat the vote.
    - ability to set minimum players count to allow starting the vote.
    - ability to block specific user by name (mask) or SteamId from using the vote functionality.
    Vote block file:
    - data/votedifficulty_vote_block.txt
    Logfile location:
    - logs/vote_difficulty.log
    Settings (ConVars):
    can be found in: cfg/sourcemod/sm_votedifficulty.cfg
    PHP Code:
    // Minimum delay (in sec.) allowed between votes
    sm_votedifficulty_delay "60"

    // How long (in sec.) does the vote last
    sm_votedifficulty_timeout "10"

    // Delay (in sec.) between announce and vote menu appearing
    sm_votedifficulty_announcedelay "2.0"

    // Minimum players present in game to allow starting vote
    sm_votedifficulty_minplayers "1"

    // Admin flag required to start the vote (leave empty to allow for everybody)
    sm_votedifficulty_accessflag "" 

    // Use logging? (1 - Yes / 0 - No)
    sm_votedifficulty_log "1" 

    // Add new difficulty 'Master +' ? (1 - Yes / 0 - No)
    sm_votedifficulty_use_master_plus "0"

    // Add new difficulty 'Expert+' ? (1 - Yes / 0 - No)
    sm_votedifficulty_use_expert_plus "0"

    // Use separate configs per each default difficulties ? (1 - Yes / 0 - No)
    sm_votedifficulty_use_config_per_dif "1"

    // Do we need to set default difficulty when the server get restarted? (1 - Yes, 0 - No)
    sm_votedifficulty_default_set "0"

    // Default difficulty to use when the server get restarted (you must remove z_difficulty ConVar from server.cfg)
    sm_votedifficulty_default_difficulty "Easy" 
    Commands:
    PHP Code:
    // Try to start vote for difficluty
    sm_vd

    // Allow admin to veto current vote (ADMFLAG_BAN is required)
    sm_veto

    // Allow admin to bypass current vote (ADMFLAG_BAN is required)
    sm_votepass 
    Requirements:
    - GeoIP extension (included in SourceMod).

    If you enabled "Hard+" and "Expert+" difficulties, you need create own config files for them (so they get any sense):
    • сfg/server_hard+.cfg
    • сfg/server_expert+.cfg
    Also, you have ability to execute separate cfg for each default difficulty:
    • cfg/server_easy.cfg
    • cfg/server_normal.cfg
    • cfg/server_hard.cfg
    • cfg/server_expert.cfg
    Also, this default config is automatically executed before set any new difficulty:
    • сfg/server_default.cfg
    * all empty cfg files are included in archive's attachment in "cfg/sourcemod" folder (just in case, for skeleton)

    Note: When you vote for "Hard+", only server_hard+.cfg is executed (not server_hard.cfg), same for impossible (expert).

    Natives, Forwards, IPC:
    PHP Code:
    // ConVar, allowing to set a hook on, to understand current extended game difficulty name
    // Possible values (read only):
    //        Easy
    //        Normal
    //        Hard
    //        Hard+
    //        Impossible
    //        Impossible+
    z_difficulty_ex "<default value>" (read only!) 
    Languages:
    - Russian
    - English
    Installation:
    - unpack attached archive in "game root folder/game name" as is.
    - (optional) create desired configs within per-difficulty config files in cfg/sourcemod folder.
    TODO:
    - Support for listen servers [Need help]
    FAQ:
    Q: How to preserve voted difficulty for the next map?
    A: Remove "z_difficulty" ConVar from your cfg/server.cfg file.
    References
    - [L4D1 & L4D2] Votekick (no black screen)
    - [L4D1 & L4D2] Vote difficulty (no black screen)
    - [L4D1 & L4D2] Votemute (no black screen)
    - [L4D1 & L4D2] Map changer with rating system (no black screen)
    Donate
    Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
    - Patreon (Paypal)
    - BitCoin
    - Ю.Money
    P.S.:
    - Project and updates discontinued. Don't ask.
    Attached Files
    File Type: zip vd.zip (23.8 KB, 171 views)
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 03-03-2023 at 07:20.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 09-08-2019 , 10:45   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #2

    Updated
    Quote:
    1.7
    - Some security fixes

    1.8
    - Fixed infinite "Vote is in progress"
    - Fixed rare mem leak.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Jerry_21
    Member
    Join Date: Jun 2017
    Old 09-08-2019 , 12:41   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #3

    Quote:
    Originally Posted by Dragokas View Post
    Updated
    hello dragokas, I just see your update of this add-on and decide to add it but when I compile I get the following notice...


    //// l4d_votedifficulty.sp
    //
    // G:\01.- PLUGINS ESTABLES NUEVOS\02.- Plugins l4d1 SM 1.9 6275 y 1.10 6428\02.- SM 1.10.0 6428\addons\sourcemod\scripting\l4d_votediffi culty.sp(18 : warning 204: symbol is assigned a value that is never used: "bExpertPlus"
    // Code size: 14384 bytes
    // Data size: 6596 bytes
    // Stack/heap size: 16384 bytes
    // Total requirements: 37364 bytes
    //
    // 1 Warning.
    //
    // Compilation Time: 0,84 sec
    // ----------------------------------------

    Press enter to exit ...

    .... He still compiled but when I vote to change his difficulty, he doesn't.
    Jerry_21 is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 09-08-2019 , 15:59   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #4

    Aya Supay, I didn't ask to touch my code.
    I can remove usused code myself.

    Jerry_21, it is not important warning. It was leftovers from my private Expert++ difficulty implementation.
    1. Is L4d2 your game?
    2. Do you have all ConVars set by default in cfg/sm_votedifficulty.cfg?
    Try remove it and check again.
    3. Do you have any useful info in logs/vote_difficulty.log or error logs?
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    Jerry_21
    Member
    Join Date: Jun 2017
    Old 09-08-2019 , 16:57   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #5

    Quote:
    Originally Posted by Dragokas View Post
    Aya Supay, I didn't ask to touch my code.
    I can remove usused code myself.

    Jerry_21, it is not important warning. It was leftovers from my private Expert++ difficulty implementation.
    1. Is L4d2 your game?
    2. Do you have all ConVars set by default in cfg/sm_votedifficulty.cfg?
    Try remove it and check again.
    3. Do you have any useful info in logs/vote_difficulty.log or error logs?
    Hello Dragokas.
    1.- Use l4d1
    2.- I already did but still when I change difficulty for example from normal to advanced, it just doesn't.
    3.- I don't get any error in the files you review, only this comes out
    L 09/08/2019 - 14:48:23: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:48:23: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:48:45: [l4d_votedifficulty.smx] [TRY] Difficulty: Easy. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:48:45: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Easy.
    L 09/08/2019 - 14:48:55: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:48:55: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:49:43: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:49:43: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:49:56: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:49:56: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:510: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:510: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:52:03: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:52:03: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Hard.
    L 09/08/2019 - 14:523: [l4d_votedifficulty.smx] [TRY] Difficulty: Easy. Jerry (STEAM_1:0:1505898952 [] loopback)
    L 09/08/2019 - 14:523: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Easy.
    Jerry_21 is offline
    joyist
    Member
    Join Date: Apr 2018
    Old 09-08-2019 , 20:32   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #6

    Good job
    __________________
    http://chdong.top/motd

    L4D2 CN CloudsSky Server group。
    My WebLabWebOS
    joyist is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 03-12-2020 , 07:42   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #7

    Jerry_21, very late answer from me, anyway, it is failed because you are using listen server.

    Currently, plugin doesn't support it.

    Quote:
    hostname: ☣ Drakoshka ☣
    version : 1.0.3.8 6830 insecure
    udp/ip : 192.168.x.x:27015 [ public n/a ]
    map : l4d_hospital01_apartment at ( 1945, 917, 494 )
    os : Windows Listen
    # userid name uniqueid connected ping loss state rateplayers : 1 humans, 0 bots (4 max) (not hibernating) (unreserved)

    adr

    # 2 1 "☣ Drakoshka ☣" STEAM_1:1xxxx 13:47 34 0 active 30000# 3 "Bill" BOT active loopback
    # 4 "Zoey" BOT active
    # 5 "Francis" BOT active
    #end
    ] sm_cvar z_difficulty "Hard"
    [SM] Changed cvar "z_difficulty" to "Hard".
    L 03/12/2020 - 138:11: [sm\basecommands.smx] "Console<0><Console><Console>" changed cvar (cvar "z_difficulty") (value "Hard")
    Unable to change difficulty to 'Hard', it is locked due to lobby reservation.
    And I dunno how to solve this issue directly.

    Indirectly, I could call default vote menu and emulate vote answers using usermessages or so. I saw somewhere such code.
    Still, unsure I need to spend time for it. [Require help].

    Plugin is updated to v.1.10
    Quote:
    1.9
    - Added Expert+ and Master+ difficulties.
    You have to prepare server_hard+.cfg, server_expert+.cfg and server_default.cfg files and put them next to server.cfg file.
    By default, disabled. Use new convars to enable: "sm_votedifficulty_use_master_plus" and "sm_votedifficulty_use_expert_plus".

    1.10 (12-Mar-2020)
    - Fixed menu title phrase sometimes displayed as random language.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

    Last edited by Dragokas; 03-12-2020 at 07:51.
    Dragokas is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-08-2020 , 13:44   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #8

    Updated.

    Quote:
    1.11 (08-Apr-2020)
    - Removed binding "plus" difficulties detection to my own server cvars.
    - Added "sm_votedifficulty_use_config_per_dif" ConVar - ability to execute per-difficulty configs, by default:
    * "cfg/server_easy.cfg"
    * "cfg/server_normal.cfg"
    * "cfg/server_hard.cfg"
    * "cfg/server_expert.cfg"
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is offline
    bacongrease
    New Member
    Join Date: Sep 2020
    Old 09-21-2020 , 16:53   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #9

    This plugin along with the vote kick plugin cannot compile. Can you fix? All your plugins are very useful!
    bacongrease is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 09-21-2020 , 18:56   Re: [L4D] Vote difficulty (no black screen)
    Reply With Quote #10

    Thanks. Fixed. Increased minimal requirements up to sm.1.9.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas 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:17.


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