Raised This Month: $ Target: $400
 0% 

Solved RockTheVote "R4.2"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 04-01-2021 , 14:29   RockTheVote "R4.2"
Reply With Quote #1

Can you tell me why he gives me this mistake at any time? The error I get is from: colorchat However, I removed it and it says again that there is an error and I do not know exactly what is happening

Here is the code:
HTML Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <chatcolor>


#define PREFIX "^1 [^4 Zombie Plague^1 ]"

new rtv[33], count;
new min_players, max_players, howmanyvotesperc, timevote, directmapchange, vote_delay, bool:ChangeMap = false, nextmap[64]

public plugin_init()
{
	register_plugin("RockTheVote", "R4.2", "HarveyWNvm");
	
	register_clcmd("say", "cmdSay");
	register_clcmd("say_team",	"cmdSay");

	min_players = register_cvar("amx_min_players", "4"); // how many votes the plugin needs in order to start the vote (below this it will take the count of the players)
	max_players = register_cvar("amx_max_players", "8"); // how many players the plugin needs in order to start working with howmanyvotesperc
	howmanyvotesperc = register_cvar("amx_howmanypercentage", "0.50"); // how much percent of the players need to vote in order to start the vote
	timevote = register_cvar("amx_timevote", "5"); // how much time players need to wait before the plugin is active
	directmapchange = register_cvar( "amx_directmapchange", "0" ); // 0 = map changes on roundstart || 1 = map changes after xx seconds(vote_delay)
	vote_delay = register_cvar("amx_voteDelay", "20"); // don't write less than 20, because the map will change before the vote is over
	
	register_logevent ( "RoundStart", 2, "1=Round_Start" );
}

public  client_disconnect(id)
{
	if (rtv[id-1] == id)
	{
		rtv[id-1] = 0;
		count--;
	}
}

public cmdSay(id)
{
	new szMessage[32]
	read_args(szMessage, charsmax(szMessage));
	remove_quotes(szMessage);
	if	((equali(szMessage, "rtv") == 1) || (equali(szMessage, "/rtv") == 1))
	{
		if (get_gametime() < (get_pcvar_float(timevote) * 60.0))
			ColorChat(id, TEAM_COLOR, "%s Vote is currently not allowed. Wait ^4%d^1 minutes.", PREFIX, (floatround(((get_pcvar_float(timevote) * 60.0) - get_gametime()) / 60.0)))
		else
		{
			if	(rtv[id-1] == id)
				ColorChat(id, TEAM_COLOR, "%s You have already voted!",PREFIX);
			else
			{
				rtv[id-1] = id;
				count++;
				
				static name[32];
				get_user_name( id, name, charsmax( name ) );
				

				new playerNum = get_playersnum();
				new minPlayers = get_pcvar_num(min_players)
				new maxPlayers = get_pcvar_num(max_players)
				new minPlayersPercent = floatround((get_pcvar_float(howmanyvotesperc) * playerNum))
				
				if(playerNum <= minPlayers) {
					if (count == playerNum || playerNum-count <= 0) {
						StartVoteMap()
						return PLUGIN_HANDLED;
					}
					ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, playerNum-count)
				}
				
				if (playerNum > minPlayers && playerNum < maxPlayers) {
					if (count == minPlayers || minPlayers-count <= 0) {
						StartVoteMap()
						return PLUGIN_HANDLED;
					}
					ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, minPlayers-count)
				}
				if(playerNum >= maxPlayers) {
					if (count == minPlayersPercent || minPlayersPercent-count <= 0) {
						StartVoteMap()
						return PLUGIN_HANDLED;
					}
					ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, minPlayersPercent-count)
				}
			}
		}
	}
	return PLUGIN_CONTINUE;
}
public StartVoteMap() {
	ChangeMap = true
	
	if (get_pcvar_num(directmapchange)) {
		new delay = max(get_pcvar_num(vote_delay),20)
		set_hudmessage(210, 0, 0, 0.02, 0.43, 1, 20.0, 10.0, 0.5, 0.15, 4);
		show_hudmessage(0, "The map will change in %d seconds", delay);
		set_task(float(delay),"RoundStart")
	} else {
		set_hudmessage(210, 0, 0, 0.02, 0.43, 1, 20.0, 10.0, 0.5, 0.15, 4);
		show_hudmessage(0, "This is the final round");
	}
	
	if(find_plugin_byfile("mapchooser.amxx") != INVALID_PLUGIN_ID)
	{
		new oldWinLimit = get_cvar_num("mp_winlimit"), oldMaxRounds = get_cvar_num("mp_maxrounds");
		set_cvar_num("mp_winlimit",0); 
		set_cvar_num("mp_maxrounds",-1); 
		
		if(callfunc_begin("voteNextmap","mapchooser.amxx") == 1)
			callfunc_end();

		set_cvar_num("mp_winlimit",oldWinLimit);
		set_cvar_num("mp_maxrounds",oldMaxRounds);
		return PLUGIN_CONTINUE;
	}
	return PLUGIN_HANDLED;
}

public RoundStart()
{
	if (ChangeMap == true)
	{
		get_cvar_string("amx_nextmap", nextmap, charsmax(nextmap));
		server_cmd( "changelevel %s", nextmap );
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1251\\ deff0\\ deflang1026{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/


Fix error code:

HTML Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/texth5Quz1.sma(5) : fatal error 100: cannot read from file: "colorchat"

Compilation aborted.
1 Error.
Done.
__________________
nFL-CS.InFo
My link bio: Steam Acc
HarveyWNvm - Fire Fire ( Official Audio ) 💢 Coming Soon!
nflcsinfo is offline
Send a message via Skype™ to nflcsinfo
 


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 19:55.


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