Raised This Month: $37 Target: $400
 9% 

Solved RockTheVote "R4.2"


Post New Thread Reply   
 
Thread Tools Display Modes
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
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-01-2021 , 16:39   Re: RockTheVote "R4.2"
Reply With Quote #2

The compile log you attached has nothing to do with that plugin.
__________________


Dear admins. If somehow you managed to read this, plz fix.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 04-02-2021 , 04:14   Re: RockTheVote "R4.2"
Reply With Quote #3

It doesn't work for me and I don't know why.
__________________
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-02-2021 , 16:37   Re: RockTheVote "R4.2"
Reply With Quote #4

As Oxi said, the code that you posted did not produce that compile error. You need to post the actual code that you're trying to compile.
__________________
fysiks is offline
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 04-04-2021 , 06:56   Re: RockTheVote "R4.2"
Reply With Quote #5

I just put everything and gave the mistakes that make me wrong. No way to help me with this little thing?
__________________
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-04-2021 , 13:36   Re: RockTheVote "R4.2"
Reply With Quote #6

It's like you saying "can you fix my car?" and then you bring in your somebody else's car. How can they fix your car if you being an entirely different car into the shop?
__________________
fysiks is offline
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 04-05-2021 , 06:44   Re: RockTheVote "R4.2"
Reply With Quote #7

I don't understand cars
__________________
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-05-2021 , 12:52   Re: RockTheVote "R4.2"
Reply With Quote #8

Quote:
Originally Posted by nflcsinfo View Post
I don't understand cars
That's not relevant. Replace "car" with literally anything else in my analogy.
__________________
fysiks is offline
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 04-08-2021 , 08:25   Re: RockTheVote "R4.2"
Reply With Quote #9

I understand very well. And I answer your question? I just want to know if there will be a way for the plugin?
__________________
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
SHIFT0
Member
Join Date: Apr 2021
Location: Algeria
Old 04-08-2021 , 09:42   Re: RockTheVote "R4.2"
Reply With Quote #10

OciXCrom
SHIFT0 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 17:20.


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