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

rtv but no vote


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
L4D2Noob
AlliedModders Donor
Join Date: Mar 2020
Location: Moscow
Old 03-07-2022 , 19:49   rtv but no vote
Reply With Quote #1

Hi all!

I have 105 maps on my Climb server (CS:S) and most of them are not played.

I would like to eradicate this problem.

the bottom line is that the sm_extendmap_timestep "100" command in the mapchooser plugin does not exclude recently played maps, no matter how I try to fix it.

And the command sm_mapvote_endvote "0" doesn't work either. Players write RTV anyway, and a menu appears prompting them to choose one of two maps.

Is there some kind of voting plugin that would just run the next map from the Mapcycle if the player writes an RTV?
__________________
L4D2Noob is offline
Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
L4D2Noob
AlliedModders Donor
Join Date: Mar 2020
Location: Moscow
Old 03-07-2022 , 21:45   Re: rtv but no vote
Reply With Quote #2

Possible example

HTML Code:
new bool:is_vote[MAXPLAYERS];
new max_votes;
new vote_counts;
new Handle:h_cvar_players;

public OnPluginStart()
{
	RegConsoleCmd("sm_rtv", ChangeMap_Func, "Used console command changelevel_next");
	RegConsoleCmd("say .rtv", ChangeMap_Func, "Used console command changelevel_next");
	LoadTranslations("mapchange_ini.phrases");
	h_cvar_players = CreateConVar("sm_initial_players", "1", "How many minimum players need on this Server, what Turn On Vote", FCVAR_NOTIFY, true, 0.0, true, 64.0);
	CreateConVar("sm_mapchange_ini", "1.0", "Version of Plugin", FCVAR_NOTIFY | FCVAR_NONE);
}

public Action:ChangeMap_Func(client, args)
{
	if (!args)
	{
		if (max_votes >= GetConVarInt(h_cvar_players))
		{
			if (is_vote[client] == false)
			{
				is_vote[client] = true;
				new vote_count_half = max_votes / 2;
				if (vote_count_half == vote_counts++)
				{
					ServerCommand("changelevel_next");
				}
				else
				{
					decl String:map_name[32];
					decl String:level_name[32];
					GetCurrentMap(map_name, sizeof(map_name));
					new Handle:map_file = OpenFile("cfg/mapcycle.txt", "r");
					new bool:test_end_file = false;
					while (!IsEndOfFile(map_file))
					{
						ReadFileLine(map_file, level_name, sizeof(level_name));
						TrimString(level_name);
						if (StrEqual(map_name, level_name, false))
						{
							if (!IsEndOfFile(map_file))
							{
								ReadFileLine(map_file, level_name, sizeof(level_name));
								TrimString(level_name);
								break;
							}
							else
							{
								test_end_file = true;
							}
						}
					}
					if (test_end_file)
					{
						CloseHandle(map_file);
						map_file = OpenFile("cfg/mapcycle.txt", "r");
						ReadFileLine(map_file, level_name, sizeof(level_name));
						TrimString(level_name);
					}
					CloseHandle(map_file);
					for (new i_client = 1; i_client <= MaxClients; i_client++)
					{
						if (!IsClientInGame(i_client) || IsFakeClient(i_client))
						{
							continue;
						}
						decl String:name_include[MAX_NAME_LENGTH];
						decl String:map_include[32];
						decl String:vote_string[16];
						FormatEx(name_include, sizeof(name_include), "\x04%N\x01", client);
						FormatEx(map_include, sizeof(map_include), "\x04%s\x01", level_name);
						FormatEx(vote_string, sizeof(vote_string), "[\x04%i\x01/\x04%i\x01]", vote_counts, vote_count_half);
						PrintToChat(i_client, "\x03[SM]\x01 %t", "Vote Apply", name_include, map_include, vote_string);
					}
				}
			}
			else
			{
				PrintToChat(client, "\x03[SM]\x01 %t", "Vote Already");
			}
		}
		else
		{
			PrintToChat(client, "\x03[SM]\x01 %t", "More Players");
		}
	}
	return Plugin_Handled;
}

public OnClientDisconnect(client)
{
	if (!IsFakeClient(client) && IsClientInGame(client))
	{
		max_votes--;
		if (is_vote[client] == true)
		{
			is_vote[client] = false;
			vote_counts--;
		}
	}
}

public OnClientPutInServer(client)
{
	if (!IsFakeClient(client))
	{
		max_votes++;
	}
}
__________________
L4D2Noob is offline
Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-08-2022 , 14:28   Re: rtv but no vote
Reply With Quote #3

Quote:
Originally Posted by L4D2Noob View Post
Hi all!

I have 105 maps on my Climb server (CS:S) and most of them are not played.

I would like to eradicate this problem.

the bottom line is that the sm_extendmap_timestep "100" command in the mapchooser plugin does not exclude recently played maps, no matter how I try to fix it.

And the command sm_mapvote_endvote "0" doesn't work either. Players write RTV anyway, and a menu appears prompting them to choose one of two maps.

Is there some kind of voting plugin that would just run the next map from the Mapcycle if the player writes an RTV?
mapchooser.cfg
PHP Code:
// Specifies how much many more minutes each extension makes
// -
// Default: "15"
// Minimum: "5.000000"
sm_extendmap_timestep "15" 

PHP Code:
// Specifies how many past maps to exclude from the vote.
// -
// Default: "5"
// Minimum: "0.000000"
sm_mapvote_exclude "5" 
__________________
Do not Private Message @me
Bacardi 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 15:25.


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