Plugin adminvote colorat[rezolvat!]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

12 Oct 2013, 23:30

Imi poate da cineva pluginul adminvote colorat, in felul urmator :

[Admin] Spanksau rosu: votare customizata
RoyalServer
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

13 Oct 2013, 11:31

adminvote.sma | Afiseaza codul
[code]/*
	AdminVote colored by K1d0x
*/

#include <amxmodx>
#include <amxmisc>
#include <K1d0x_ChatColor>

new g_Answer[128]
new g_optionName[4][64]
new g_voteCount[4]
new g_validMaps
new g_yesNoVote
new g_coloredMenus
new g_voteCaller
new g_Execute[256]
new g_execLen

new bool:g_execResult
new Float:g_voteRatio

public plugin_init()
{
	register_plugin("Admin Votes", AMXX_VERSION_STR, "AMXX Dev Team")
	register_dictionary("adminvote.txt")
	register_dictionary("common.txt")
	register_dictionary("mapsmenu.txt")
	register_menucmd(register_menuid("Change map to "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Choose map: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
	register_menucmd(register_menuid("Kick "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Ban "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Vote: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
	register_menucmd(register_menuid("The result: "), MENU_KEY_1|MENU_KEY_2, "actionResult")
	register_concmd("amx_votemap", "cmdVoteMap", ADMIN_VOTE, "- >map< >[map]< >[map]< >[map]< -")
	register_concmd("amx_votekick", "cmdVoteKickBan", ADMIN_VOTE, "- >nume sau #userid< -")
	register_concmd("amx_voteban", "cmdVoteKickBan", ADMIN_VOTE, "- >nume sau #userid< -")
	register_concmd("amx_vote", "cmdVote", ADMIN_VOTE, "- >intrebare< >raspuns#1< >raspuns#2< -")
	register_concmd("amx_cancelvote", "cmdCancelVote", ADMIN_VOTE, "")
	
	g_coloredMenus = colored_menus()
}

public cmdCancelVote(id, level, cid)
{
	if (!cmd_access(id, level, cid, 0))
		return PLUGIN_HANDLED

	if (task_exists(99889988, 1))
	{
		new authid[32], name[32]
		
		get_user_authid(id, authid, 31)
		get_user_name(id, name, 31)
		log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
	
		switch (get_cvar_num("amx_show_activity"))
		{
			case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_CANC_VOTE_2", name)
			case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_CANC_VOTE_1")
		} 
	
		console_print(id, "%L", id, "VOTING_CANC")
		remove_task(99889988, 1)
		set_cvar_float("amx_last_voting", get_gametime())
	}
	else
		console_print(id, "%L", id, "NO_VOTE_CANC")

	return PLUGIN_HANDLED
}

public delayedExec(cmd[])
	server_cmd("%s", cmd)

public autoRefuse()
{
	log_amx("Vote: %L", "en", "RES_REF")
	player_color(0, "%L", LANG_PLAYER, "RES_REF")
}

public actionResult(id, key)
{
	remove_task(4545454)
	
	switch (key)
	{
		case 0:
		{
			set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
			log_amx("Vote: %L", "en", "RES_ACCEPTED")
			player_color(0, "%L", LANG_PLAYER, "RES_ACCEPTED")
		}
		case 1: autoRefuse()
	}
	
	return PLUGIN_HANDLED
}

public checkVotes()
{
	new best = 0
	
	if (!g_yesNoVote)
	{
		for (new a = 0; a < 4; ++a)
			if (g_voteCount[a] > g_voteCount[best])
		
		best = a
	}

	new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3]
	new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
	new iResult = g_voteCount[best]
	new players[32], pnum, i
	
	get_players(players, pnum, "c")
	
	if (iResult < iRatio)
	{
		new lVotingFailed[64]
		
		for (i = 0; i < pnum; i++)
		{
			format(lVotingFailed, 63, "%L", players, "VOTING_FAILED")
			if (g_yesNoVote)
				player_color(players, "%L", players, "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio)
			else
				player_color(players, "%L", players, "VOTING_RES_2", lVotingFailed, iResult, iRatio)
		}
		
		format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED")
		log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio)
		
		return PLUGIN_CONTINUE
	}

	g_execLen = format(g_Execute, 255, g_Answer, g_optionName[best]) + 1
	
	if (g_execResult)
	{
		g_execResult = false
		
		if (is_user_connected(g_voteCaller))
		{
			new menuBody[512], lTheResult[32], lYes[16], lNo[16]
			
			format(lTheResult, 31, "%L", g_voteCaller, "THE_RESULT")
			format(lYes, 15, "%L", g_voteCaller, "YES")
			format(lNo, 15, "%L", g_voteCaller, "NO")
			
			new len = format(menuBody, 511, g_coloredMenus ? "\y%s: \w%s^n^n" : "%s: %s^n^n", lTheResult, g_Execute)
			
			len += format(menuBody[len], 511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
			format(menuBody[len], 511 - len, "^n1. %s^n2. %s", lYes, lNo)
			show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ")
			set_task(10.0, "autoRefuse", 4545454)
		}
		else
			set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
	}
	
	for (i = 0; i < pnum; i++)
	{
		player_color(players, "%L", players, "VOTING_RES_3", iResult, iRatio, g_Execute)
	}
	log_amx("Vote: Successfully(got ^"%d^") (needed ^"%d^") (result ^"%s^")", iResult, iRatio, g_Execute)
	
	return PLUGIN_CONTINUE
}

public voteCount(id, key)
{
	if (get_cvar_num("amx_vote_answers"))
	{
		new name[32]
		get_user_name(id, name, 31)
		
		if (g_yesNoVote)
			player_color(0, "%L", LANG_PLAYER, key ? "VOTED_AGAINST" : "VOTED_FOR", name)
		else
			player_color(0, "%L", LANG_PLAYER, "VOTED_FOR_OPT", name, key + 1)
	}
	++g_voteCount[key]
	
	return PLUGIN_HANDLED
}

public cmdVoteMap(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}
	
	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new argc = read_argc()
	if (argc > 5) argc = 5
	
	g_validMaps = 0
	g_optionName[0][0] = 0
	g_optionName[1][0] = 0
	g_optionName[2][0] = 0
	g_optionName[3][0] = 0
	
	for (new i = 1; i < argc; ++i)
	{
		read_argv(i, g_optionName[g_validMaps], 31)
		
		if (is_map_valid(g_optionName[g_validMaps]))
			g_validMaps++
	}
	
	if (g_validMaps == 0)
	{
		new lMaps[16]
		
		format(lMaps, 15, "%L", id, (argc == 2) ? "MAP_IS" : "MAPS_ARE")
		console_print(id, "%L", id, "GIVEN_NOT_VALID", lMaps)
		return PLUGIN_HANDLED
	}

	new menu_msg[256], len = 0
	new keys = 0
	
	if (g_validMaps > 1)
	{
		keys = MENU_KEY_0
		len = format(menu_msg, 255, g_coloredMenus ? "\y%L: \w^n^n" : "%L: ^n^n", LANG_SERVER, "CHOOSE_MAP")
		new temp[128]
		
		for (new a = 0; a < g_validMaps; ++a)
		{
			format(temp, 127, "%d.  %s^n", a+1, g_optionName[a])
			len += copy(menu_msg[len], 255-len, temp)
			keys |= (1<<a)
		}
		
		format(menu_msg[len], 255-len, "^n0.  %L", LANG_SERVER, "NONE")
		g_yesNoVote = 0
	} else {
		new lChangeMap[32], lYes[16], lNo[16]
		
		format(lChangeMap, 31, "%L", LANG_SERVER, "CHANGE_MAP_TO")
		format(lYes, 15, "%L", LANG_SERVER, "YES")
		format(lNo, 15, "%L", LANG_SERVER, "NO")
		format(menu_msg, 255, g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lChangeMap, g_optionName[0], lYes, lNo)
		keys = MENU_KEY_1|MENU_KEY_2
		g_yesNoVote = 1
	}
	
	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	
	if (argc == 2)
		log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name, get_user_userid(id), authid, g_optionName[0])
	else
		log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3])

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_MAP_2", name)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_MAP_1")
	} 

	g_execResult = true
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float("amx_votemap_ratio")
	g_Answer = "changelevel %s"
	show_menu(0, keys, menu_msg, floatround(vote_time), (g_validMaps > 1) ? "Choose map: " : "Change map to ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	
	return PLUGIN_HANDLED
}

public cmdVote(id, level, cid)
{
	if (!cmd_access(id, level, cid, 4))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}
	
	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new quest[48]
	read_argv(1, quest, 47)
	
	if (contain(quest, "sv_password") != -1 || contain(quest, "rcon_password") != -1)
	{
		console_print(id, "%L", id, "VOTING_FORBIDDEN")
		return PLUGIN_HANDLED
	}
	
	new count=read_argc();

	for (new i=0;i<4 && (i+2)<count;i++)
	{
		read_argv(i+2, g_optionName, sizeof(g_optionName[])-1);
	}

	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1])

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_CUS_2", name)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_CUS_1")
	} 

	new menu_msg[512], lVote[16]
	
	format(lVote, 15, "%L", LANG_SERVER, "VOTE")
	
	count-=2;
	if (count>4)
	{
		count=4;
	}
	// count now shows how many options were listed
	new keys=0;
	for (new i=0;i<count;i++)
	{
		keys |= (1<<i);
	}
	
	new len=formatex(menu_msg, sizeof(menu_msg)-1, g_coloredMenus ? "\y%s: %s\w^n^n" : "%s: %s^n^n", lVote, quest);
	
	for (new i=0;i<count;i++)
	{
		len+=formatex(menu_msg[len], sizeof(menu_msg) - 1 - len ,"%d.  %s^n",i+1,g_optionName);
	}
	g_execResult = false
	
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float("amx_vote_ratio")
	replace_all(quest,sizeof(quest)-1,"%","");
	format(g_Answer, 127, "%s - %%s", quest)
	show_menu(0, keys, menu_msg, floatround(vote_time), "Vote: ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	g_yesNoVote = 0
	
	return PLUGIN_HANDLED
}

public cmdVoteKickBan(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}

	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new cmd[32]
	
	read_argv(0, cmd, 31)
	
	new voteban = equal(cmd, "amx_voteban")
	new arg[32]
	read_argv(1, arg, 31)
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
	
	if (!player)
		return PLUGIN_HANDLED
	
	if (voteban && is_user_bot(player))
	{
		new imname[32]
		
		get_user_name(player, imname, 31)
		console_print(id, "%L", id, "ACTION_PERFORMED", imname)
		return PLUGIN_HANDLED
	}

	new keys = MENU_KEY_1|MENU_KEY_2
	new menu_msg[256], lYes[16], lNo[16], lKickBan[16]
	
	format(lYes, 15, "%L", LANG_SERVER, "YES")
	format(lNo, 15, "%L", LANG_SERVER, "NO")
	format(lKickBan, 15, "%L", LANG_SERVER, voteban ? "BAN" : "KICK")
	ucfirst(lKickBan)
	get_user_name(player, arg, 31)
	format(menu_msg, 255, g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lKickBan, arg, lYes, lNo)
	g_yesNoVote = 1
	
	new bool:ipban=false;
	
	if (voteban)
	{
		get_user_authid(player, g_optionName[0], sizeof(g_optionName[])-1);
		
		// Do the same check that's in plmenu to determine if this should be an IP ban instead
		if (equal("4294967295", g_optionName[0])
			|| equal("HLTV", g_optionName[0])
			|| equal("STEAM_ID_LAN", g_optionName[0])
			|| equali("VALVE_ID_LAN", g_optionName[0]))
		{
			get_user_ip(player, g_optionName[0], sizeof(g_optionName[])-1, 1);
			
			ipban=true;
		}

	}
	else
	{
		num_to_str(get_user_userid(player), g_optionName[0], 31)
	}
	
	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg)

	new maxpl=get_maxplayers();
	new msg[256];
	new right[256];
	new dummy[1];
	for (new i = 1; i <= maxpl; i++)
	{
		if (is_user_connected(i) && !is_user_bot(i))
		{
			formatex(lKickBan, charsmax(lKickBan), "%L", i, voteban ? "BAN" : "KICK");
			
			// HACK: ADMIN_VOTE_FOR{1,2} keys are really weird.  Tokenize and ignore the text before the :
			LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_FOR_1", i);
			strtok(msg, dummy, 0, right, charsmax(right), ':');
			trim(right);
			show_activity_id(i, id, name, right, lKickBan, arg);
		}
	}

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_FOR_2", name, voteban ? "BAN" : "KICK", arg)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_FOR_1", voteban ? "BAN" : "KICK", arg)
	} 

	g_execResult = true
	
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio")

	if (voteban)
	{
		if (ipban==true)
		{
			g_Answer = "addip 30.0 %s";
		}
		else
		{
			g_Answer = "banid 30.0 %s kick";

		}
	}
	else
	{
		g_Answer = "kick #%s";
	}
	show_menu(0, keys, menu_msg, floatround(vote_time), voteban ? "Ban " : "Kick ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	
	return PLUGIN_HANDLED
}

/*
	End Of Plugin
*/[/code]

adminvote.amxx | Afiseaza codul
[code]http://www.girlshare.ro/32911352.1[/code]
K1d0x_ChatColor.inc | Afiseaza codul
[code]/* K1d0x Productions - Chat Color functions
*
* (c) Copyright 2010-2012, K1d0x
*
* This file is provided as is (no warranties).
*/

#if defined _K1d0x_ChatColor_included
  #endinput
#endif
#define _K1d0x_ChatColor_included

stock player_color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!v", "^4" ) /* culoarea verde */
	replace_all( msg, 190, "!c", "^1" ) /* culoarea chatului */
	replace_all( msg, 190, "!e", "^3" ) /* culoarea echipei ct = albastru | tero = rosie */
	replace_all( msg, 190, "!e2", "^0" ) /* culoarea normala a echipei */
	
	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
	{
		for( new i = 0; i < count; i++ )
		{
			if( is_user_connected( players[ i ] ) )
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
		}
	}
}[/code]
data/lang/adminvote.txt | Afiseaza codul
[code][en]
ADMIN_CANC_VOTE_1 = !v[LCS]!c a folosit comanda: !eamx_cancelvote!c!
ADMIN_CANC_VOTE_2 = !v[LCS] !e%s !ca folosit comanda: !vamx_cancelvote!c!
VOTING_CANC = Votarea a fost anulata!
NO_VOTE_CANC = Nu exista votari pentru anulare sau nu poate fi anulata cu acea comanda!c!
RES_REF = !v[LCS]!c Rezultatul a fost !erefuzat!c!
RES_ACCEPTED = !v[LCS]!c Rezultatul a fost !eacceptat!
VOTING_FAILED = !v[LCS]!c Votare esuata!
VOTING_RES_1 = %s (da "!e%d!c" voturi, nu "!v%dvoturi!c", necesare "!e%d!c!")
VOTING_RES_2 = %s (a obtinut "!v%d!c voturi", necesare "!e%d!c!")
VOTING_SUCCESS = !v[INFO]!c Votarea a avut loc cu succes!
VOTING_RES_3 = !v[LCS]!c Votarea a avut loc cu succes (a obtinut "!v%d!c" voturi, necesare "!e%d!c"). Rezultatul este: !v%s!c!
THE_RESULT = Rezultatul!
WANT_CONTINUE = Accepti schimbarea hartii?
VOTED_FOR = !v[LCS] !e%s !ca votat pentru!c!
VOTED_AGAINST = !v[LCS] !e%s !ca votat impotriva
VOTED_FOR_OPT = !v[LCS] !e%s !ca votat pentru optiunea !v#%d!c!
ALREADY_VOTING = !v[LCS]!c Deja se afla o votare in curs de desfasurare...
VOTING_NOT_ALLOW = !v[LCS]!c Votarile nu sunt permise acum!
GIVEN_NOT_VALID = !v[LCS]!c !e%s !cnu este valida!
MAP_IS = harta este
MAPS_ARE = hartile sunt
CHOOSE_MAP = Alege harta
ADMIN_VOTE_MAP_1 = !v[LCS]!c a folosit comanda: !evote map!c(!es!c)!
ADMIN_VOTE_MAP_2 = !v[LCS] !e%s !ca folosit comanda: !evote map!c(!es!c)!
VOTING_STARTED = Votarea a inceput...
VOTING_FORBIDDEN = Votarea pentru aceasta optiune nu este permisa!
ADMIN_VOTE_CUS_1 = !v[LCS] !cvotare customizata!
ADMIN_VOTE_CUS_2 = !v[LCS] !e%s !cvotare customizata!
VOTE = Voteaza
ACTION_PERFORMED = Aceasta comanda nu poate fi executata pe bot-ul !e"%s"!c!
ADMIN_VOTE_FOR_1 = !cvot !e%s !cpentru !v%s!c!
ADMIN_VOTE_FOR_2 = !v%s !cvot !e%s !cpentru !v%s!c!

[ro]
ADMIN_CANC_VOTE_1 = !v[LCS]!c a folosit comanda: !eamx_cancelvote!c!
ADMIN_CANC_VOTE_2 = !v[LCS] !e%s !ca folosit comanda: !vamx_cancelvote!c!
VOTING_CANC = Votarea a fost anulata!
NO_VOTE_CANC = Nu exista votari pentru anulare sau nu poate fi anulata cu acea comanda!c!
RES_REF = !v[LCS]!c Rezultatul a fost !erefuzat!c!
RES_ACCEPTED = !v[LCS]!c Rezultatul a fost !eacceptat!
VOTING_FAILED = !v[LCS]!c Votare esuata!
VOTING_RES_1 = %s (da "!e%d!c" voturi, nu "!v%dvoturi!c", necesare "!e%d!c!")
VOTING_RES_2 = %s (a obtinut "!v%d!c voturi", necesare "!e%d!c!")
VOTING_SUCCESS = !v[INFO]!c Votarea a avut loc cu succes!
VOTING_RES_3 = !v[LCS]!c Votarea a avut loc cu succes (a obtinut "!v%d!c" voturi, necesare "!e%d!c"). Rezultatul este: !v%s!c!
THE_RESULT = Rezultatul!
WANT_CONTINUE = Accepti schimbarea hartii?
VOTED_FOR = !v[LCS] !e%s !ca votat pentru!c!
VOTED_AGAINST = !v[LCS] !e%s !ca votat impotriva
VOTED_FOR_OPT = !v[LCS] !e%s !ca votat pentru optiunea !v#%d!c!
ALREADY_VOTING = !v[LCS]!c Deja se afla o votare in curs de desfasurare...
VOTING_NOT_ALLOW = !v[LCS]!c Votarile nu sunt permise acum!
GIVEN_NOT_VALID = !v[LCS]!c !e%s !cnu este valida!
MAP_IS = harta este
MAPS_ARE = hartile sunt
CHOOSE_MAP = Alege harta
ADMIN_VOTE_MAP_1 = !v[LCS]!c a folosit comanda: !evote map!c(!es!c)!
ADMIN_VOTE_MAP_2 = !v[LCS] !e%s !ca folosit comanda: !evote map!c(!es!c)!
VOTING_STARTED = Votarea a inceput...
VOTING_FORBIDDEN = Votarea pentru aceasta optiune nu este permisa!
ADMIN_VOTE_CUS_1 = !v[LCS] !cvotare customizata!
ADMIN_VOTE_CUS_2 = !v[LCS] !e%s !cvotare customizata!
VOTE = Voteaza
ACTION_PERFORMED = Aceasta comanda nu poate fi executata pe bot-ul !e"%s"!c!
ADMIN_VOTE_FOR_1 = !cvot !e%s !cpentru !v%s!c!
ADMIN_VOTE_FOR_2 = !v%s !cvot !e%s !cpentru !v%s!c![/code]
Poze | Afiseaza codul
Image
Image
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

13 Oct 2013, 12:42

Am pus pluginul, daca scriu amx_vot imi apare asa :
Usage: amx_vote - >intrebare< >raspuns#1< >raspuns#2< -
Dar daca dau amx_vote Test? Da Nu imi apare asa :
Unknown command: amx_vote
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

13 Oct 2013, 12:54

Spank wrote:Am pus pluginul, daca scriu amx_vot imi apare asa :
Usage: amx_vote - >intrebare< >raspuns#1< >raspuns#2< -
Dar daca dau amx_vote Test? Da Nu imi apare asa :
Unknown command: amx_vote
Din pacate vad ca nu sti sa dai la vot .. :|
| Afiseaza codul
Image

Image
Mie de ce imi da vot si e si normal daca scri amx_vote sa nu dea la vot iti explica ca trebuie sa pui o intrebare dupa 2 raspunsuri.
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

13 Oct 2013, 13:17

Nu stiu sa dau vot, vai de capul tau..dar oricum am rezolvat cu alt plugin! T,C
User avatar
Freezy.
Membru, skill +1
Membru, skill +1
Posts: 385
Joined: 21 Feb 2016, 14:12
Detinator Steam: Da
Detinator server CS: SUD.LEAGUECS.RO
SteamID: /id/fzind/
Fond eXtream: 0
Location: Constanţa
Has thanked: 2 times
Contact:

26 Feb 2017, 13:24

Update la linkurile de download ?
sud.leaguecs.ro # 32/32 non stop. - 5.254.20.19:27015
sudmix.leaguecs.ro # mix our familly - 5.254.20.7:27015 - DE
sudmix2.leaguecs.ro # mix our familly - 109.163.232.164:27015 - RO
leaguecs românia - forum sud: https://bit.ly/3fm6bJK

----------------------------------------------------------
servere găzduite de gphosting.ro
User avatar
Freezy.
Membru, skill +1
Membru, skill +1
Posts: 385
Joined: 21 Feb 2016, 14:12
Detinator Steam: Da
Detinator server CS: SUD.LEAGUECS.RO
SteamID: /id/fzind/
Fond eXtream: 0
Location: Constanţa
Has thanked: 2 times
Contact:

27 Feb 2017, 17:50

De ce naiba spune ca nu exista comanda cand scriu amx vote i1 i2 si r ?
sud.leaguecs.ro # 32/32 non stop. - 5.254.20.19:27015
sudmix.leaguecs.ro # mix our familly - 5.254.20.7:27015 - DE
sudmix2.leaguecs.ro # mix our familly - 109.163.232.164:27015 - RO
leaguecs românia - forum sud: https://bit.ly/3fm6bJK

----------------------------------------------------------
servere găzduite de gphosting.ro
User avatar
AboveAll :)
Membru, skill +1
Membru, skill +1
Posts: 141
Joined: 16 Dec 2014, 11:29
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Abcs.LaLeagane.Ro
SteamID: AboveAll14
Fond eXtream: 0
Location: Barlad
Contact:

14 Feb 2020, 16:00

update la linkuri cineva? imi da eroare la compilare.
Abcs.LaLeagane.Ro / 89.40.104.77:27015 - Uwc3x - Level Mod 50 Lvl !
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

14 Feb 2020, 17:13

Code: Select all

/*
	AdminVote colored by K1d0x
*/

#include <amxmodx>
#include <amxmisc>

new g_Answer[128]
new g_optionName[4][64]
new g_voteCount[4]
new g_validMaps
new g_yesNoVote
new g_coloredMenus
new g_voteCaller
new g_Execute[256]
new g_execLen

new bool:g_execResult
new Float:g_voteRatio

public plugin_init()
{
	register_plugin("Admin Votes", AMXX_VERSION_STR, "AMXX Dev Team")
	register_dictionary("adminvote.txt")
	register_dictionary("common.txt")
	register_dictionary("mapsmenu.txt")
	register_menucmd(register_menuid("Change map to "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Choose map: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
	register_menucmd(register_menuid("Kick "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Ban "), MENU_KEY_1|MENU_KEY_2, "voteCount")
	register_menucmd(register_menuid("Vote: "), MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4, "voteCount")
	register_menucmd(register_menuid("The result: "), MENU_KEY_1|MENU_KEY_2, "actionResult")
	register_concmd("amx_votemap", "cmdVoteMap", ADMIN_VOTE, "- >map< >[map]< >[map]< >[map]< -")
	register_concmd("amx_votekick", "cmdVoteKickBan", ADMIN_VOTE, "- >nume sau #userid< -")
	register_concmd("amx_voteban", "cmdVoteKickBan", ADMIN_VOTE, "- >nume sau #userid< -")
	register_concmd("amx_vote", "cmdVote", ADMIN_VOTE, "- >intrebare< >raspuns#1< >raspuns#2< -")
	register_concmd("amx_cancelvote", "cmdCancelVote", ADMIN_VOTE, "")
	
	g_coloredMenus = colored_menus()
}

public cmdCancelVote(id, level, cid)
{
	if (!cmd_access(id, level, cid, 0))
		return PLUGIN_HANDLED

	if (task_exists(99889988, 1))
	{
		new authid[32], name[32]
		
		get_user_authid(id, authid, 31)
		get_user_name(id, name, 31)
		log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
	
		switch (get_cvar_num("amx_show_activity"))
		{
			case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_CANC_VOTE_2", name)
			case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_CANC_VOTE_1")
		} 
	
		console_print(id, "%L", id, "VOTING_CANC")
		remove_task(99889988, 1)
		set_cvar_float("amx_last_voting", get_gametime())
	}
	else
		console_print(id, "%L", id, "NO_VOTE_CANC")

	return PLUGIN_HANDLED
}

public delayedExec(cmd[])
	server_cmd("%s", cmd)

public autoRefuse()
{
	log_amx("Vote: %L", "en", "RES_REF")
	player_color(0, "%L", LANG_PLAYER, "RES_REF")
}

public actionResult(id, key)
{
	remove_task(4545454)
	
	switch (key)
	{
		case 0:
		{
			set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
			log_amx("Vote: %L", "en", "RES_ACCEPTED")
			player_color(0, "%L", LANG_PLAYER, "RES_ACCEPTED")
		}
		case 1: autoRefuse()
	}
	
	return PLUGIN_HANDLED
}

public checkVotes()
{
	new best = 0
	
	if (!g_yesNoVote)
	{
		for (new a = 0; a < 4; ++a)
			if (g_voteCount[a] > g_voteCount[best])
		
		best = a
	}

	new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3]
	new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
	new iResult = g_voteCount[best]
	new players[32], pnum, i
	
	get_players(players, pnum, "c")
	
	if (iResult < iRatio)
	{
		new lVotingFailed[64]
		
		for (i = 0; i < pnum; i++)
		{
			format(lVotingFailed, 63, "%L", players, "VOTING_FAILED")
			if (g_yesNoVote)
				player_color(players[i], "%L", players[i], "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio)
			else
				player_color(players[i], "%L", players[i], "VOTING_RES_2", lVotingFailed, iResult, iRatio)
		}
		
		format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED")
		log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio)
		
		return PLUGIN_CONTINUE
	}

	g_execLen = format(g_Execute, 255, g_Answer, g_optionName[best]) + 1
	
	if (g_execResult)
	{
		g_execResult = false
		
		if (is_user_connected(g_voteCaller))
		{
			new menuBody[512], lTheResult[32], lYes[16], lNo[16]
			
			format(lTheResult, 31, "%L", g_voteCaller, "THE_RESULT")
			format(lYes, 15, "%L", g_voteCaller, "YES")
			format(lNo, 15, "%L", g_voteCaller, "NO")
			
			new len = format(menuBody, 511, g_coloredMenus ? "\y%s: \w%s^n^n" : "%s: %s^n^n", lTheResult, g_Execute)
			
			len += format(menuBody[len], 511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
			format(menuBody[len], 511 - len, "^n1. %s^n2. %s", lYes, lNo)
			show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ")
			set_task(10.0, "autoRefuse", 4545454)
		}
		else
			set_task(2.0, "delayedExec", 0, g_Execute, g_execLen)
	}
	
	for (i = 0; i < pnum; i++)
	{
		player_color(players[i], "%L", players[i], "VOTING_RES_3", iResult, iRatio, g_Execute)
	}
	log_amx("Vote: Successfully(got ^"%d^") (needed ^"%d^") (result ^"%s^")", iResult, iRatio, g_Execute)
	
	return PLUGIN_CONTINUE
}

public voteCount(id, key)
{
	if (get_cvar_num("amx_vote_answers"))
	{
		new name[32]
		get_user_name(id, name, 31)
		
		if (g_yesNoVote)
			player_color(0, "%L", LANG_PLAYER, key ? "VOTED_AGAINST" : "VOTED_FOR", name)
		else
			player_color(0, "%L", LANG_PLAYER, "VOTED_FOR_OPT", name, key + 1)
	}
	++g_voteCount[key]
	
	return PLUGIN_HANDLED
}

public cmdVoteMap(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}
	
	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new argc = read_argc()
	if (argc > 5) argc = 5
	
	g_validMaps = 0
	g_optionName[0][0] = 0
	g_optionName[1][0] = 0
	g_optionName[2][0] = 0
	g_optionName[3][0] = 0
	
	for (new i = 1; i < argc; ++i)
	{
		read_argv(i, g_optionName[g_validMaps], 31)
		
		if (is_map_valid(g_optionName[g_validMaps]))
			g_validMaps++
	}
	
	if (g_validMaps == 0)
	{
		new lMaps[16]
		
		format(lMaps, 15, "%L", id, (argc == 2) ? "MAP_IS" : "MAPS_ARE")
		console_print(id, "%L", id, "GIVEN_NOT_VALID", lMaps)
		return PLUGIN_HANDLED
	}

	new menu_msg[256], len = 0
	new keys = 0
	
	if (g_validMaps > 1)
	{
		keys = MENU_KEY_0
		len = format(menu_msg, 255, g_coloredMenus ? "\y%L: \w^n^n" : "%L: ^n^n", LANG_SERVER, "CHOOSE_MAP")
		new temp[128]
		
		for (new a = 0; a < g_validMaps; ++a)
		{
			format(temp, 127, "%d.  %s^n", a+1, g_optionName[a])
			len += copy(menu_msg[len], 255-len, temp)
			keys |= (1<<a)
		}
		
		format(menu_msg[len], 255-len, "^n0.  %L", LANG_SERVER, "NONE")
		g_yesNoVote = 0
	} else {
		new lChangeMap[32], lYes[16], lNo[16]
		
		format(lChangeMap, 31, "%L", LANG_SERVER, "CHANGE_MAP_TO")
		format(lYes, 15, "%L", LANG_SERVER, "YES")
		format(lNo, 15, "%L", LANG_SERVER, "NO")
		format(menu_msg, 255, g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lChangeMap, g_optionName[0], lYes, lNo)
		keys = MENU_KEY_1|MENU_KEY_2
		g_yesNoVote = 1
	}
	
	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	
	if (argc == 2)
		log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name, get_user_userid(id), authid, g_optionName[0])
	else
		log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3])

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_MAP_2", name)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_MAP_1")
	} 

	g_execResult = true
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float("amx_votemap_ratio")
	g_Answer = "changelevel %s"
	show_menu(0, keys, menu_msg, floatround(vote_time), (g_validMaps > 1) ? "Choose map: " : "Change map to ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	
	return PLUGIN_HANDLED
}

public cmdVote(id, level, cid)
{
	if (!cmd_access(id, level, cid, 4))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}
	
	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new quest[48]
	read_argv(1, quest, 47)
	
	if (contain(quest, "sv_password") != -1 || contain(quest, "rcon_password") != -1)
	{
		console_print(id, "%L", id, "VOTING_FORBIDDEN")
		return PLUGIN_HANDLED
	}
	
	new count=read_argc();

	for (new i=0;i<4 && (i+2)<count;i++)
	{
		read_argv(i+2, g_optionName[i], sizeof(g_optionName[])-1);
	}

	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1])

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_CUS_2", name)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_CUS_1")
	} 

	new menu_msg[512], lVote[16]
	
	format(lVote, 15, "%L", LANG_SERVER, "VOTE")
	
	count-=2;
	if (count>4)
	{
		count=4;
	}
	// count now shows how many options were listed
	new keys=0;
	for (new i=0;i<count;i++)
	{
		keys |= (1<<i);
	}
	
	new len=formatex(menu_msg, sizeof(menu_msg)-1, g_coloredMenus ? "\y%s: %s\w^n^n" : "%s: %s^n^n", lVote, quest);
	
	for (new i=0;i<count;i++)
	{
		len+=formatex(menu_msg[len], sizeof(menu_msg) - 1 - len ,"%d.  %s^n",i+1,g_optionName);
	}
	g_execResult = false
	
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float("amx_vote_ratio")
	replace_all(quest,sizeof(quest)-1,"%","");
	format(g_Answer, 127, "%s - %%s", quest)
	show_menu(0, keys, menu_msg, floatround(vote_time), "Vote: ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	g_yesNoVote = 0
	
	return PLUGIN_HANDLED
}

public cmdVoteKickBan(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED
	
	new Float:voting = get_cvar_float("amx_last_voting")
	if (voting > get_gametime())
	{
		console_print(id, "%L", id, "ALREADY_VOTING")
		return PLUGIN_HANDLED
	}

	if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
	{
		console_print(id, "%L", id, "VOTING_NOT_ALLOW")
		return PLUGIN_HANDLED
	}

	new cmd[32]
	
	read_argv(0, cmd, 31)
	
	new voteban = equal(cmd, "amx_voteban")
	new arg[32]
	read_argv(1, arg, 31)
	
	new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
	
	if (!player)
		return PLUGIN_HANDLED
	
	if (voteban && is_user_bot(player))
	{
		new imname[32]
		
		get_user_name(player, imname, 31)
		console_print(id, "%L", id, "ACTION_PERFORMED", imname)
		return PLUGIN_HANDLED
	}

	new keys = MENU_KEY_1|MENU_KEY_2
	new menu_msg[256], lYes[16], lNo[16], lKickBan[16]
	
	format(lYes, 15, "%L", LANG_SERVER, "YES")
	format(lNo, 15, "%L", LANG_SERVER, "NO")
	format(lKickBan, 15, "%L", LANG_SERVER, voteban ? "BAN" : "KICK")
	ucfirst(lKickBan)
	get_user_name(player, arg, 31)
	format(menu_msg, 255, g_coloredMenus ? "\y%s %s?\w^n^n1.  %s^n2.  %s" : "%s %s?^n^n1.  %s^n2.  %s", lKickBan, arg, lYes, lNo)
	g_yesNoVote = 1
	
	new bool:ipban=false;
	
	if (voteban)
	{
		get_user_authid(player, g_optionName[0], sizeof(g_optionName[])-1);
		
		// Do the same check that's in plmenu to determine if this should be an IP ban instead
		if (equal("4294967295", g_optionName[0])
			|| equal("HLTV", g_optionName[0])
			|| equal("STEAM_ID_LAN", g_optionName[0])
			|| equali("VALVE_ID_LAN", g_optionName[0]))
		{
			get_user_ip(player, g_optionName[0], sizeof(g_optionName[])-1, 1);
			
			ipban=true;
		}

	}
	else
	{
		num_to_str(get_user_userid(player), g_optionName[0], 31)
	}
	
	new authid[32], name[32]
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg)

	new maxpl=get_maxplayers();
	new msg[256];
	new right[256];
	new dummy[1];
	for (new i = 1; i <= maxpl; i++)
	{
		if (is_user_connected(i) && !is_user_bot(i))
		{
			formatex(lKickBan, charsmax(lKickBan), "%L", i, voteban ? "BAN" : "KICK");
			
			// HACK: ADMIN_VOTE_FOR{1,2} keys are really weird.  Tokenize and ignore the text before the :
			LookupLangKey(msg, charsmax(msg), "ADMIN_VOTE_FOR_1", i);
			strtok(msg, dummy, 0, right, charsmax(right), ':');
			trim(right);
			show_activity_id(i, id, name, right, lKickBan, arg);
		}
	}

	switch (get_cvar_num("amx_show_activity"))
	{
		case 2: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_FOR_2", name, voteban ? "BAN" : "KICK", arg)
		case 1: player_color(0,"%L", LANG_PLAYER, "ADMIN_VOTE_FOR_1", voteban ? "BAN" : "KICK", arg)
	} 

	g_execResult = true
	
	new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
	
	set_cvar_float("amx_last_voting", get_gametime() + vote_time)
	g_voteRatio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio")

	if (voteban)
	{
		if (ipban==true)
		{
			g_Answer = "addip 30.0 %s";
		}
		else
		{
			g_Answer = "banid 30.0 %s kick";

		}
	}
	else
	{
		g_Answer = "kick #%s";
	}
	show_menu(0, keys, menu_msg, floatround(vote_time), voteban ? "Ban " : "Kick ")
	set_task(vote_time, "checkVotes", 99889988)
	g_voteCaller = id
	console_print(id, "%L", id, "VOTING_STARTED")
	g_voteCount = {0, 0, 0, 0}
	
	return PLUGIN_HANDLED
}

/*
	End Of Plugin
*/

/* K1d0x Productions - Chat Color functions
*
* (c) Copyright 2010-2012, K1d0x
*
* This file is provided as is (no warranties).
*/

#if defined _K1d0x_ChatColor_included
  #endinput
#endif
#define _K1d0x_ChatColor_included

stock player_color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!v", "^4" ) /* culoarea verde */
	replace_all( msg, 190, "!c", "^1" ) /* culoarea chatului */
	replace_all( msg, 190, "!e", "^3" ) /* culoarea echipei ct = albastru | tero = rosie */
	replace_all( msg, 190, "!e2", "^0" ) /* culoarea normala a echipei */
	
	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
	{
		for( new i = 0; i < count; i++ )
		{
			if( is_user_connected( players[ i ] ) )
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
		}
	}
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Yandex [Bot] and 36 guests