AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Vote difficulty + (no black screen) (https://forums.alliedmods.net/showthread.php?t=317257)

Dragokas 07-05-2019 04:28

[L4D1 & L4D2] Vote difficulty + (no black screen)
 
1 Attachment(s)
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.

Dragokas 09-08-2019 10:45

Re: [L4D] Vote difficulty (no black screen)
 
Updated
Quote:

1.7
- Some security fixes

1.8
- Fixed infinite "Vote is in progress"
- Fixed rare mem leak.

Jerry_21 09-08-2019 12:41

Re: [L4D] Vote difficulty (no black screen)
 
Quote:

Originally Posted by Dragokas (Post 2666268)
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(188) : 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.

Dragokas 09-08-2019 15:59

Re: [L4D] Vote difficulty (no black screen)
 
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?

Jerry_21 09-08-2019 16:57

Re: [L4D] Vote difficulty (no black screen)
 
Quote:

Originally Posted by Dragokas (Post 2666322)
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:51:30: [l4d_votedifficulty.smx] [TRY] Difficulty: Hard. Jerry (STEAM_1:0:1505898952 [] loopback)
L 09/08/2019 - 14:51:30: [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:52:33: [l4d_votedifficulty.smx] [TRY] Difficulty: Easy. Jerry (STEAM_1:0:1505898952 [] loopback)
L 09/08/2019 - 14:52:33: [l4d_votedifficulty.smx] [ACCEPTED] Difficulty: Easy.

joyist 09-08-2019 20:32

Re: [L4D] Vote difficulty (no black screen)
 
Good job

Dragokas 03-12-2020 07:42

Re: [L4D] Vote difficulty (no black screen)
 
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:1:xxxxx 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 - 13:38: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.

Dragokas 04-08-2020 13:44

Re: [L4D] Vote difficulty (no black screen)
 
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"

bacongrease 09-21-2020 16:53

Re: [L4D] Vote difficulty (no black screen)
 
This plugin along with the vote kick plugin cannot compile. Can you fix? All your plugins are very useful!

Dragokas 09-21-2020 18:56

Re: [L4D] Vote difficulty (no black screen)
 
Thanks. Fixed. Increased minimal requirements up to sm.1.9.


All times are GMT -4. The time now is 23:20.

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