[Cerere Plugin] MapChooser Avansat

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
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

10 Feb 2023, 23:16

Plugin Cerut: MapChooser avansat
Descriere (adica ce face el mai exact): mapschooser numai ca acesta cand mai sunt 10 playeri da vote cu harti mai mici , iar atunci cand sunt 10 + 1 da voturi cu mape mai mari .
Ai cautat pluginul?(daca da, precizeaza cum): am cautat am gasit exact ce cautam doar ca nu merge adresa url de unde trebuia descarcat
Serverul impune conditii strict HLDS/REHLDS?: rehlds
Necesita mod special?: nu
Versiune AMXX Server: 1.9.0

las aici adresa unde am gasit si nu merge sa descarc

Code: Select all

https://www.fairside.ro/forum/topic/14353-plugin-mapchooser4/

si aici las cum am gasit acolo

Code: Select all

1. Fisierul mapchooser4.sma il puneti in addons/amxmodx/scripting
2. Fisierul mapchooser4.amxx il puneti in addons/amxmodx/plugins
3. Fisierul mapchooser4.txt il puneti in addons/amxmodx/data/lang
4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
mapchooser4.amxx
5 . Creati un fisier cu numele maps si terminatia .ini ( maps.ini ) si il puneti in addons/amxmodx/configs/
In acest fisier puneti mapele mari ( acestea vor fi pentru votul cu mape mari atunci cand sunt 10 + 1 playeri )
ex:
----www.SITETAU.ro----
awp_bycastor32
de_aztec
de_cbble
de_dust
de_dust2
de_dustyaztec
de_inferno
de_inferno20106. Creati un fisier cu numele maps_small si terminatia .ini ( maps_small.ini ) si il puneti in addons/amxmodx/configs
In acest fisier puneti mapele mici ( acestea vor fi pentru votul cu mape mici atunci cand sunt -10playeri )
ex:
----www.SITETAU.ro----
cs_deagle5
de_dust2_2x2
fy_snow
fy_buzzkill
de_dust2_long
fy_snow_orange
Cvaruri:
// Map Chooser 4

amx_mapchooser_type "0"
0: random maps from amx_mapchooser_mapsfile/mapcycle/maps folder
1: nominations
2: the nextmap is a random map chosen from amx_mapchooser_mapsloc (no vote)
amx_mapchooser_mapsloc "0"
0: amx_mapchooser_mapsfile
1: mapcycle
2: maps folder
amx_nominfromfile "0"
0: players can nominate all the maps from the map folder
1: players can only nominate maps from amx_mapchooser_mapsfile/mapcycle
amx_rtv "1" - enables/disables rockthevote option (deafult is 1).
amx_rtv_percent "0.6"
amx_show_activity "2"
0 - doesn't show what the admin is doing (starting any vote i.e.),
1 - shows to everybody the activity of admin, but without showing his name,
2 - shows the activity of the admin with his name.
Higher than 2 values of this cvar aren't supported by mapchooser4 plugin.
amx_mapchooser_mapsfile "maps.ini"
amx_mapchooser_mapsfile_s "maps_small.ini"
amx_vote_time "10" - the time next vote can happen since last vote happened. Default is 10.
amx_vote_delay "40" - the length of time the vote is active. Default is 10.
amx_maxnominperplayer "1" - how many maps each player can nominate (default is 1).
amx_map_history "3" - how many last played maps shouldn't go to the maps vote menu (default is 5).
amx_extendmap_max "90" - max. time for overall extending the map if mp_timelimit is used (default is 90).
amx_extendmap_step "15" - with what time the map will be extended if mp_timelimit is used (default is 15).
amx_ext_round_max "3" - how many times the map can be extended if mp_maxrounds is used (default is 3).
amx_ext_round_step "3" - with what rounds number the map will be extended if mp_maxrounds is used (default is 3).
amx_ext_win_max "3" - how many times the map can be extended if mp_winlimit is used (default is 3).
amx_ext_win_step "3" - with what rounds number the map will be extended if mp_winlimit is used (default is 3).

 
RoyalServer 2
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:

10 Feb 2023, 23:26

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)
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

10 Feb 2023, 23:46

multumesc dar nu este precum cel care ti-am dat eu , nu are harti mici , harti mari si restul ....
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:

11 Feb 2023, 12:24

eu zic că are
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)
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

11 Feb 2023, 13:28

jur ca nu vad unde scrie maps_high.txt , maps_small.txt
User avatar
kidd0x
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 1054
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Reputatie: Utilizator neserios (tepar!)
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x
Has thanked: 172 times
Been thanked: 81 times

11 Feb 2023, 13:59

Code: Select all

#include <amxmodx>

new const PLUGIN[] = "Mapchooser"
new const VERSION[] = "3.0"
new const AUTHOR[] = "Prayer/Safety1st"

new g_teamScore[2]

new nextmap, vote_answers, maxspeed
new mp_timelimit, mp_winlimit, mp_maxrounds, mp_roundtime
new extendmapmax_pcvar, extendmapstep_pcvar, votetime_pcvar, votemaps_pcvar
new result_red_pcvar, result_green_pcvar, result_blue_pcvar

#define TASK_PLUGIN_ID 44747477
#define TASK_SCREEN_ID 979699
#define TASK_RESULT_ID 12111

const HudLen = 512

new Array:g_mapName
new g_mapNums
new g_saveids[10]

new g_voteCount[10]
new g_nextName[10]
new g_lastMap[32]
new g_currentMap[32]
new g_mapVoteNum

new g_votemaps
new g_maxspeed = 320

new Float:f_timelimit = 0.0	// we want to restore timelimit only if we touched it

new bool:willbevote = false	// there will be a vote
new bool:voteStarted = false	// there is vote in progress
new bool:forceBlock = true	// block player's selections if vote is canceled
new bool:hasExtend = false	// map was extended
new bool:lastRound = false	// map changing will be at the current round end
new bool:forceChange = true	// we should force map end in case if it is not round-based limit coming soon

new bool:hasBlind[33] = { false, ... }
new g_msgScreenFade

new g_PlayersVoted = 0
new g_PlayersNum = 0

new
	g_result_red,
	g_result_green,
	g_result_blue

new const g_mape_mici[] = "mape_mici.ini"
new const g_mape_mari[] = "mape_mari.ini"

new delimiter

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("super_mapchooser",VERSION,FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	register_dictionary("mapchooser.txt")
	
	extendmapmax_pcvar = register_cvar("amx_extendmap_max", "90")
	extendmapstep_pcvar = register_cvar("amx_extendmap_step", "15")
	register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
	register_event("TextMsg", "Event_RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("ScreenFade", "Event_ScreenFade", "be")
	register_event("TeamScore", "team_score", "a")
	register_logevent("Event_RoundEnd", 2, "0=World triggered","1=Round_End")
	
	votetime_pcvar = register_cvar("mapchooser_votetime", "15")
	votemaps_pcvar = register_cvar("mapchooser_votemaps", "5")
	
	result_red_pcvar = register_cvar("mapchooser_result_red", "0")
	result_green_pcvar = register_cvar("mapchooser_result_green", "255")
	result_blue_pcvar = register_cvar("mapchooser_result_blue", "100")

	delimiter = register_cvar("mapchooser_delimiter", "9")
	
	g_msgScreenFade = get_user_msgid("ScreenFade")
	
	set_task(8.0, "taskListening", TASK_PLUGIN_ID, "", 0, "b")
}

public plugin_cfg()
{
	nextmap = get_cvar_pointer("amx_nextmap")
	vote_answers = get_cvar_pointer("amx_vote_answers")
	maxspeed = get_cvar_pointer("sv_maxspeed")
	
	mp_timelimit = get_cvar_pointer("mp_timelimit")
	mp_winlimit = get_cvar_pointer("mp_winlimit")
	mp_maxrounds = get_cvar_pointer("mp_maxrounds")
	mp_roundtime = get_cvar_pointer("mp_roundtime")
	
	g_votemaps = get_pcvar_num(votemaps_pcvar)
	
	if(g_votemaps > 8)
		g_votemaps = 8
	else if(g_votemaps < 1)
		g_votemaps = 1
	
	register_menucmd(register_menuid("superMapChooserMenu"), (-1^(-1<<(g_votemaps + 1))), "countVote")
	
	g_mapName = ArrayCreate(32)
	
	get_localinfo("lastMap", g_lastMap, sizeof g_lastMap -1)
	set_localinfo("lastMap", "")
	
	new maps_ini_file[64]
	get_localinfo("amxx_configsdir", maps_ini_file, sizeof maps_ini_file -1)
	
	format(maps_ini_file, sizeof maps_ini_file -1, "%s/maps.ini", maps_ini_file)
	
	if(!file_exists(maps_ini_file))
		get_cvar_string("mapcyclefile", maps_ini_file, sizeof maps_ini_file -1)
	
	if(loadSettings(maps_ini_file))
		Reset()
	
	g_maxspeed = get_pcvar_num(maxspeed)
	get_mapname(g_currentMap, sizeof g_currentMap -1)
}

public client_disconnect(id)
{
	remove_task(id+TASK_SCREEN_ID)
	remove_task(id+TASK_RESULT_ID)
	
	hasBlind[id] = false
}

public Event_RestartRound()
	Reset()

public Event_RoundEnd()
{
	if(lastRound && forceChange)
		set_task(4.5,"ForceChangeMap")
}

public ForceChangeMap()
{
	// trick: decrease mp_timelimit value to force map change. 0.3 min was carefully chosen by experiments
	set_pcvar_float(mp_timelimit, get_gametime() / 60.0 - 0.3)
}

public Reset()
{
	g_PlayersVoted = 0
	g_PlayersNum = 0
	
	if(voteStarted)
	{
		voteStarted = false
		forceBlock = true
		remove_task(TASK_PLUGIN_ID)	// remove 'checkVotes' task
		
		if(!hasExtend)
		{
		chat_color(0, "%L", LANG_SERVER, "INTERRUPTED")
		}
		else hasExtend = false
	}
	
	if(willbevote)
	{
		set_task(8.0, "taskListening", TASK_PLUGIN_ID, "", 0, "b")
		
		if(f_timelimit > 0.0)
			set_pcvar_float(mp_timelimit, f_timelimit)
	}
	
	willbevote = false
	lastRound = false
	forceChange = true
}



public taskListening()
{
	new winlimit = get_pcvar_num(mp_winlimit)
	
	if(winlimit)
	{
		new c = winlimit - 2
		if(!((c > g_teamScore[0]) && (c > g_teamScore[1])))
		{
			forceChange = false
			willbevote = true
		}
	}

	new maxrounds = get_pcvar_num(mp_maxrounds)
	
	if(maxrounds)
	{
		if(!((maxrounds - 2) > (g_teamScore[0] + g_teamScore[1])))
		{
			forceChange = false
			willbevote = true
		}
	}
	
	new Float:f_timeleft
	new Float:f_diff
	new Float:f_roundtime
	
	f_timeleft = float(get_timeleft())
	
	if (f_timeleft)
	{
		f_roundtime = get_pcvar_float(mp_roundtime) * 60.0
		f_diff = f_roundtime - f_timeleft + get_pcvar_float(votetime_pcvar) + 15.0
		// we need additional 10 seconds upper to don't get countdown voice
		
		if(!(f_timeleft < 1.0 || f_timeleft > f_diff))
			willbevote = true
	}
	
	if(!willbevote)
		return
	
	remove_task(TASK_PLUGIN_ID)	// remove 'taskListening' task
	
	chat_color(0, "%L", LANG_SERVER, "VOTE_NEXT_ROUND")
	
	// increase timelimit if it might elapse earlier than needed
	if (f_timeleft)
	{
		f_timelimit = get_pcvar_float(mp_timelimit)	// save current timelimit
		set_pcvar_float(mp_timelimit, f_timelimit + f_diff / 60.0)
	}
}

public Event_NewRound()
{
	if(willbevote && !lastRound)
	{
		forceBlock = false
		hasExtend = false
		
		g_result_red = get_pcvar_num(result_red_pcvar)
		g_result_green = get_pcvar_num(result_green_pcvar)
		g_result_blue = get_pcvar_num(result_blue_pcvar)
		
		cmdVoteNextmap()
	}
}

public cmdVoteNextmap()
{
	new file[64]
	get_localinfo("amxx_configsdir", file, sizeof file -1)

	if( get_playersnum() > get_pcvar_num(delimiter) )
	{
		format(file, sizeof file -1, "%s/%s", file, g_mape_mari)
		loadSettings(file)
	}
	else
	{
		format(file, sizeof file -1, "%s/%s", file, g_mape_mici)
		loadSettings(file)
	}

	new
		mkeys = ((1<<g_votemaps) + 1),
		menu[HudLen],
		a
	
	new pos = format(menu, HudLen -1, "     \r%L:^n^n", LANG_SERVER, "VOTE_TITLE")
	new dmax = (g_mapNums > g_votemaps) ? g_votemaps : g_mapNums
	
	new unki = 0
	
	for(g_mapVoteNum = 0; g_mapVoteNum < dmax; g_mapVoteNum++)
	{
		a = random_num(0, g_mapNums -1)
		
		while(isInMenu(a))
		{
			if(++a >= g_mapNums)
			{
				a = 0
			}
		}
		
		g_nextName[g_mapVoteNum] = a
		
		new map[32]
		ArrayGetString(g_mapName, a, map, sizeof map -1)
		
		pos += format(menu[pos], HudLen -1, "     \y%d.\w %s^n", g_mapVoteNum + 1, map)
		
		g_saveids[unki] = a
		unki++
		
		mkeys |= (1<<g_mapVoteNum)
		
		g_voteCount[g_mapVoteNum] = 0
	}
	
	g_voteCount[g_votemaps] = 0
	g_voteCount[g_votemaps + 1] = 0
	
	new winlimit = get_pcvar_num(mp_winlimit)
	new maxrounds = get_pcvar_num(mp_maxrounds)
	
	if((winlimit + maxrounds) == 0 && f_timelimit < get_pcvar_float(extendmapmax_pcvar))
	{
		pos += format(menu[pos], HudLen -1, "     \y%d.\w %s \y[%L]", g_votemaps + 1, g_currentMap, LANG_SERVER, "PROLONG")
		mkeys |= (1<<g_votemaps)
	}
	
	show_menu(0, mkeys, menu, get_pcvar_num(votetime_pcvar), "superMapChooserMenu")
	
	chat_color(0, "%L", LANG_SERVER, "VOTE_STARTED")
	
	client_cmd(0, "spk gman/gman_choose2")
	set_task(get_pcvar_float(votetime_pcvar), "checkVotes", TASK_PLUGIN_ID)
	
	PauseGame()
	
	voteStarted = true
	
	log_amx("Super Vote: Voting for the nextmap started")
}

public checkVotes()
{
	voteStarted = false
	
	new bolt = 0
	
	for(new a = 0; a < g_mapVoteNum; a++)
	{
		if(g_voteCount[bolt] < g_voteCount[a])
			bolt = a
	}
	
	//clear channel #2
	set_hudmessage(.channel=2)
	show_hudmessage(0, "")
	
	set_hudmessage(255, 127, 0, -1.0, 0.42, 2, 0.1, 10.0, 0.05, 1.0, 2)
	
	if((g_voteCount[g_votemaps] > g_voteCount[bolt]) && (g_voteCount[g_votemaps] > g_voteCount[g_votemaps + 1]))
	{	
		new Float:steptime = get_pcvar_float(extendmapstep_pcvar)
		f_timelimit = f_timelimit + steptime
		
		chat_color(0, "%L", LANG_SERVER, "MAP_EXTENDING", steptime)
		show_hudmessage(0, "%L", LANG_SERVER, "MAP_EXTENDING_HUD", steptime)
		
		log_amx("Super Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes", g_currentMap, steptime)
		
		hasExtend = true
		
		Reset()
		ContinueGame()
		
		return
	}
	
	new smap[32]
	
	if(g_voteCount[bolt] && (g_voteCount[g_votemaps + 1] <= g_voteCount[bolt]))
	{
		ArrayGetString(g_mapName, g_nextName[bolt], smap, sizeof smap -1)
		set_pcvar_string(nextmap, smap)
	}
	else get_pcvar_string(nextmap, smap, sizeof smap -1)	// get nextmap name in case if no one voted
	
	chat_color(0, "%L", LANG_SERVER, "NEXT_MAP_CHOSEN", smap)
	show_hudmessage(0, "%L", LANG_SERVER, "NEXT_MAP_CHOSEN_HUD", smap)
	
	if(forceChange)
	{
		chat_color(0, "%L", LANG_SERVER, "LAST_ROUND")
		set_hudmessage(255, 0, 0, -1.0, 0.58, 2, 0.1, 10.0, 0.05, 1.0, 1)
		show_hudmessage(0, "%L", LANG_SERVER, "LAST_ROUND_HUD")
	}
	
	new players[32], num, pid
	get_players(players, num)
	
	for(new i=0;i<num;i++)
	{
		pid = players
		remove_task(pid+TASK_RESULT_ID)
	}
	
	log_amx("Super Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
	
	lastRound = true
	
	// increase timelimit if it might elapse earlier than current round
	new Float:f_timeleft = float(get_timeleft())
	if(f_timeleft)	// there is timelimit for map definately
		set_pcvar_float(mp_timelimit, get_gametime() / 60.0 + get_pcvar_float(mp_roundtime))
	
	ContinueGame()
}

public countVote(id, key)
{
	if(!voteStarted && forceBlock)
		return PLUGIN_HANDLED
	
	if(get_pcvar_float(vote_answers))
	{
		new name[32]
		get_user_name(id, name, sizeof name -1)
		
		if(key == g_votemaps)
		{
			chat_color(0, "%L", LANG_SERVER, "VOTED_EXTEND", name)
		}
		else if(key < g_votemaps)
		{
			new map[32]
			ArrayGetString(g_mapName, g_nextName[key], map, sizeof map -1)
			
			chat_color(0, "%L", LANG_SERVER, "VOTED", name, map)
		}
		
		cmdShowResults(id+TASK_RESULT_ID)
		set_task(0.8, "cmdShowResults", id+TASK_RESULT_ID, "", 0, "b")
	}
	
	client_cmd(id, "spk UI/buttonclickrelease")
	
	g_voteCount[key]++
	g_PlayersVoted++
	
	return PLUGIN_HANDLED
}

public cmdShowResults(pid)
{
	static id
	id = pid-TASK_RESULT_ID
	
	if(is_user_connected(id))
	{
		static i, len, message[HudLen]
		
		len = format(message, sizeof message -1, "%L^n^n", LANG_SERVER, "VOTE_RESULTS")
		
		for(i=0;i<g_votemaps;i++)
		{
			new map[32]
			ArrayGetString(g_mapName, g_saveids, map, sizeof map -1)
			len += format(message[len], HudLen -1, "[%d] | %s^n", g_voteCount, map)
		}
		
		len += format(message[len], HudLen -1, "[%d] | %s [%L]^n^n", g_voteCount, g_currentMap, LANG_SERVER, "PROLONGED")
		len += format(message[len], HudLen -1, "%L", LANG_SERVER, "VOTE_TOTAL", g_PlayersVoted, g_PlayersNum)
		
		set_hudmessage(g_result_red, g_result_green, g_result_blue, 0.36, 0.3, 0, 1.0, 4.0, 0.1, 0.2, 2)
		show_hudmessage(id, message)
	}
}

public Event_ScreenFade(id)
{
	if(hasBlind[id])
	{
		set_task(0.6, "cmdFadeScreen", id+TASK_SCREEN_ID)
	}
}

public cmdFadeScreen(pid)
{
	new id = pid-TASK_SCREEN_ID
	
	if(is_user_connected(id))
	{
		message_begin(MSG_ONE, g_msgScreenFade, _, id)
		write_short(1<<0)	// Duration
		write_short(1<<0)	// Hold time
		write_short(1<<2)	// Fade type
		write_byte(0)		// Red
		write_byte(0)		// Green
		write_byte(0)		// Blue
		write_byte(255)		// Alpha
		message_end()
	}
}

public plugin_end()
{
	new current_map[32]
	
	set_pcvar_num(maxspeed, g_maxspeed)
	
	get_mapname(current_map, sizeof current_map -1)
	set_localinfo("lastMap", current_map)
}

stock bool:ValidMap(mapname[])
{
	if(is_map_valid(mapname))
	{
		return true
	}
	
	new len = strlen(mapname) -4
	
	if(len < 0)
	{
		return false
	}
	
	if(equali(mapname[len], ".bsp"))
	{
		mapname[len] = '^0'
		
		if(is_map_valid(mapname))
		{
			return true
		}
	}
	
	return false
}

loadSettings(filename[])
{
	if(!file_exists(filename))
		return 0

	new
		currentMap[32],
		szText[32],
		buff[256]
	
	get_mapname(currentMap, sizeof currentMap -1)

	new fp = fopen(filename, "r")
	
	while(!feof(fp))
	{
		buff[0] = '^0'
		
		fgets(fp, buff, sizeof buff -1)
		
		parse(buff, szText, sizeof szText -1)
		
		if((szText[0] != ';') && ValidMap(szText) && !equali(szText, g_lastMap) && !equali(szText, currentMap))
		{
			ArrayPushString(g_mapName, szText)
			
			g_mapNums++
		}
	}
	
	fclose(fp)

	return g_mapNums
}

bool:isInMenu(id)
{
	for(new a = 0; a < g_mapVoteNum; a++)
	{
		if(id == g_nextName[a])
		{
			return true
		}
	}
	
	return false
}

//From the AMXX nextmap base file
public team_score()
{
	new team[2]
	read_data(1,team,1)
	g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
            write_byte(players)
            write_string(msg)
            message_end()
         }
      }
   }
}
 
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

11 Feb 2023, 15:50

da aceste erori compilare


// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(127) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
//
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(325) : error 017: undefined symbol "PauseGame"
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(363) : error 017: undefined symbol "ContinueGame"
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(392 -- 393) : error 006: must be assigned to an array
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(405) : error 017: undefined symbol "ContinueGame"
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(456) : error 035: argument type mismatch (argument 2)
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(599) : error 035: argument type mismatch (argument 1)
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(601) : error 035: argument type mismatch (argument 4)
// C:\Users\Bogdan\Downloads\compiler\compiler\VotareHartiMiciMari.sma(602) : error 035: argument type mismatch (argument 1)
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

11 Feb 2023, 17:11

Discord: eyekon13
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

11 Feb 2023, 17:44

aceasi chestie aceleasi erori :((


VotareHartiMiciMari.sma(127) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
VotareHartiMiciMari.sma(186 -- 187) : error 006: must be assigned to an array
VotareHartiMiciMari.sma(211 -- 213) : error 006: must be assigned to an array
VotareHartiMiciMari.sma(442 -- 443) : error 006: must be assigned to an array
VotareHartiMiciMari.sma(506) : error 035: argument type mismatch (argument 2)
VotareHartiMiciMari.sma(649) : error 035: argument type mismatch (argument 1)
VotareHartiMiciMari.sma(651) : error 035: argument type mismatch (argument 4)
VotareHartiMiciMari.sma(652) : error 035: argument type mismatch (argument 1)
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

11 Feb 2023, 20:07

| Afiseaza codul
#include <amxmodx>

new const PLUGIN[] = "Mapchooser"
new const VERSION[] = "3.0"
new const AUTHOR[] = "Prayer/Safety1st"

new g_teamScore[2]

new nextmap, vote_answers, maxspeed
new mp_timelimit, mp_winlimit, mp_maxrounds, mp_roundtime
new extendmapmax_pcvar, extendmapstep_pcvar, votetime_pcvar, votemaps_pcvar
new result_red_pcvar, result_green_pcvar, result_blue_pcvar

#define TASK_PLUGIN_ID 44747477
#define TASK_SCREEN_ID 979699
#define TASK_RESULT_ID 12111

const HudLen = 512

new Array:g_mapName
new g_mapNums
new g_saveids[10]

new g_voteCount[10]
new g_nextName[10]
new g_lastMap[32]
new g_currentMap[32]
new g_mapVoteNum

new g_votemaps
new g_maxspeed = 320

new Float:f_timelimit = 0.0	// we want to restore timelimit only if we touched it

new bool:willbevote = false	// there will be a vote
new bool:voteStarted = false	// there is vote in progress
new bool:forceBlock = true	// block player's selections if vote is canceled
new bool:hasExtend = false	// map was extended
new bool:lastRound = false	// map changing will be at the current round end
new bool:forceChange = true	// we should force map end in case if it is not round-based limit coming soon

new bool:hasBlind[33] = { false, ... }
new g_msgScreenFade

new g_PlayersVoted = 0
new g_PlayersNum = 0

new
	g_result_red,
	g_result_green,
	g_result_blue

new const g_mape_mici[] = "mape_mici.ini"
new const g_mape_mari[] = "mape_mari.ini"

new delimiter

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("super_mapchooser",VERSION,FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	register_dictionary("mapchooser.txt")
	
	extendmapmax_pcvar = register_cvar("amx_extendmap_max", "90")
	extendmapstep_pcvar = register_cvar("amx_extendmap_step", "15")
	register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
	register_event("TextMsg", "Event_RestartRound", "a", "2&#Game_C", "2&#Game_w")
	register_event("ScreenFade", "Event_ScreenFade", "be")
	register_event("TeamScore", "team_score", "a")
	register_logevent("Event_RoundEnd", 2, "0=World triggered","1=Round_End")
	
	votetime_pcvar = register_cvar("mapchooser_votetime", "15")
	votemaps_pcvar = register_cvar("mapchooser_votemaps", "5")
	
	result_red_pcvar = register_cvar("mapchooser_result_red", "0")
	result_green_pcvar = register_cvar("mapchooser_result_green", "255")
	result_blue_pcvar = register_cvar("mapchooser_result_blue", "100")

	delimiter = register_cvar("mapchooser_delimiter", "9")
	
	g_msgScreenFade = get_user_msgid("ScreenFade")
	
	set_task(8.0, "taskListening", TASK_PLUGIN_ID, "", 0, "b")
}

public plugin_cfg()
{
	nextmap = get_cvar_pointer("amx_nextmap")
	vote_answers = get_cvar_pointer("amx_vote_answers")
	maxspeed = get_cvar_pointer("sv_maxspeed")
	
	mp_timelimit = get_cvar_pointer("mp_timelimit")
	mp_winlimit = get_cvar_pointer("mp_winlimit")
	mp_maxrounds = get_cvar_pointer("mp_maxrounds")
	mp_roundtime = get_cvar_pointer("mp_roundtime")
	
	g_votemaps = get_pcvar_num(votemaps_pcvar)
	
	if(g_votemaps > 8)
		g_votemaps = 8
	else if(g_votemaps < 1)
		g_votemaps = 1
	
	register_menucmd(register_menuid("superMapChooserMenu"), (-1^(-1<<(g_votemaps + 1))), "countVote")
	
	g_mapName = ArrayCreate(32)
	
	get_localinfo("lastMap", g_lastMap, sizeof g_lastMap -1)
	set_localinfo("lastMap", "")
	
	new maps_ini_file[64]
	get_localinfo("amxx_configsdir", maps_ini_file, sizeof maps_ini_file -1)
	
	format(maps_ini_file, sizeof maps_ini_file -1, "%s/maps.ini", maps_ini_file)
	
	if(!file_exists(maps_ini_file))
		get_cvar_string("mapcyclefile", maps_ini_file, sizeof maps_ini_file -1)
	
	if(loadSettings(maps_ini_file))
		Reset()
	
	g_maxspeed = get_pcvar_num(maxspeed)
	get_mapname(g_currentMap, sizeof g_currentMap -1)
}

public client_disconnected(id)
{
	remove_task(id+TASK_SCREEN_ID)
	remove_task(id+TASK_RESULT_ID)
	
	hasBlind[id] = false
}

public Event_RestartRound()
	Reset()

public Event_RoundEnd()
{
	if(lastRound && forceChange)
		set_task(4.5,"ForceChangeMap")
}

public ForceChangeMap()
{
	// trick: decrease mp_timelimit value to force map change. 0.3 min was carefully chosen by experiments
	set_pcvar_float(mp_timelimit, get_gametime() / 60.0 - 0.3)
}

public Reset()
{
	g_PlayersVoted = 0
	g_PlayersNum = 0
	
	if(voteStarted)
	{
		voteStarted = false
		forceBlock = true
		remove_task(TASK_PLUGIN_ID)	// remove 'checkVotes' task
		
		if(!hasExtend)
		{
		chat_color(0, "%L", LANG_SERVER, "INTERRUPTED")
		}
		else hasExtend = false
	}
	
	if(willbevote)
	{
		set_task(8.0, "taskListening", TASK_PLUGIN_ID, "", 0, "b")
		
		if(f_timelimit > 0.0)
			set_pcvar_float(mp_timelimit, f_timelimit)
	}
	
	willbevote = false
	lastRound = false
	forceChange = true
}

public PauseGame()
{
	new players[32], pid
	get_players(players, g_PlayersNum)
	for(new i=0;i<g_PlayersNum;i++)
	{
		pid = players[ i ]
		hasBlind[pid] = true
		
		message_begin(MSG_ONE, g_msgScreenFade, _, pid)
		write_short(1<<12)	// Duration
		write_short(1<<9)	// Hold time
		write_short(1<<0)	// Fade type
		write_byte(0)		// Red
		write_byte(0)		// Green
		write_byte(0)		// Blue
		write_byte(255)		// Alpha
		message_end()
		
		set_task(1.0, "cmdFadeScreen", pid+TASK_SCREEN_ID, "", 0, "b")
	}
	
	set_pcvar_num(maxspeed, 0)
}

public ContinueGame()
{
	new players[32], num, pid
	get_players(players, num)
	for(new i=0;i<num;i++)
	{
		pid = players[ i ]
		
		hasBlind[pid] = false
		
		remove_task(pid+TASK_SCREEN_ID)
		remove_task(pid+TASK_RESULT_ID)
		
		message_begin(MSG_ONE, g_msgScreenFade, _, pid)
		write_short(1<<0)
		write_short(1<<0)
		write_short(1<<0)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		message_end()
	}
	
	set_pcvar_num(maxspeed, g_maxspeed)
}

public taskListening()
{
	new winlimit = get_pcvar_num(mp_winlimit)
	
	if(winlimit)
	{
		new c = winlimit - 2
		if(!((c > g_teamScore[0]) && (c > g_teamScore[1])))
		{
			forceChange = false
			willbevote = true
		}
	}

	new maxrounds = get_pcvar_num(mp_maxrounds)
	
	if(maxrounds)
	{
		if(!((maxrounds - 2) > (g_teamScore[0] + g_teamScore[1])))
		{
			forceChange = false
			willbevote = true
		}
	}
	
	new Float:f_timeleft
	new Float:f_diff
	new Float:f_roundtime
	
	f_timeleft = float(get_timeleft())
	
	if (f_timeleft)
	{
		f_roundtime = get_pcvar_float(mp_roundtime) * 60.0
		f_diff = f_roundtime - f_timeleft + get_pcvar_float(votetime_pcvar) + 15.0
		// we need additional 10 seconds upper to don't get countdown voice
		
		if(!(f_timeleft < 1.0 || f_timeleft > f_diff))
			willbevote = true
	}
	
	if(!willbevote)
		return
	
	remove_task(TASK_PLUGIN_ID)	// remove 'taskListening' task
	
	chat_color(0, "%L", LANG_SERVER, "VOTE_NEXT_ROUND")
	
	// increase timelimit if it might elapse earlier than needed
	if (f_timeleft)
	{
		f_timelimit = get_pcvar_float(mp_timelimit)	// save current timelimit
		set_pcvar_float(mp_timelimit, f_timelimit + f_diff / 60.0)
	}
}

public Event_NewRound()
{
	if(willbevote && !lastRound)
	{
		forceBlock = false
		hasExtend = false
		
		g_result_red = get_pcvar_num(result_red_pcvar)
		g_result_green = get_pcvar_num(result_green_pcvar)
		g_result_blue = get_pcvar_num(result_blue_pcvar)
		
		cmdVoteNextmap()
	}
}

public cmdVoteNextmap()
{
	new file[64]
	get_localinfo("amxx_configsdir", file, sizeof file -1)

	if( get_playersnum() > get_pcvar_num(delimiter) )
	{
		format(file, sizeof file -1, "%s/%s", file, g_mape_mari)
		loadSettings(file)
	}
	else
	{
		format(file, sizeof file -1, "%s/%s", file, g_mape_mici)
		loadSettings(file)
	}

	new
		mkeys = ((1<<g_votemaps) + 1),
		menu[HudLen],
		a
	
	new pos = format(menu, HudLen -1, "     \r%L:^n^n", LANG_SERVER, "VOTE_TITLE")
	new dmax = (g_mapNums > g_votemaps) ? g_votemaps : g_mapNums
	
	new unki = 0
	
	for(g_mapVoteNum = 0; g_mapVoteNum < dmax; g_mapVoteNum++)
	{
		a = random_num(0, g_mapNums -1)
		
		while(isInMenu(a))
		{
			if(++a >= g_mapNums)
			{
				a = 0
			}
		}
		
		g_nextName[g_mapVoteNum] = a
		
		new map[32]
		ArrayGetString(g_mapName, a, map, sizeof map -1)
		
		pos += format(menu[pos], HudLen -1, "     \y%d.\w %s^n", g_mapVoteNum + 1, map)
		
		g_saveids[unki] = a
		unki++
		
		mkeys |= (1<<g_mapVoteNum)
		
		g_voteCount[g_mapVoteNum] = 0
	}
	
	g_voteCount[g_votemaps] = 0
	g_voteCount[g_votemaps + 1] = 0
	
	new winlimit = get_pcvar_num(mp_winlimit)
	new maxrounds = get_pcvar_num(mp_maxrounds)
	
	if((winlimit + maxrounds) == 0 && f_timelimit < get_pcvar_float(extendmapmax_pcvar))
	{
		pos += format(menu[pos], HudLen -1, "     \y%d.\w %s \y[%L]", g_votemaps + 1, g_currentMap, LANG_SERVER, "PROLONG")
		mkeys |= (1<<g_votemaps)
	}
	
	show_menu(0, mkeys, menu, get_pcvar_num(votetime_pcvar), "superMapChooserMenu")
	
	chat_color(0, "%L", LANG_SERVER, "VOTE_STARTED")
	
	client_cmd(0, "spk gman/gman_choose2")
	set_task(get_pcvar_float(votetime_pcvar), "checkVotes", TASK_PLUGIN_ID)
	
	PauseGame()
	
	voteStarted = true
	
	log_amx("Super Vote: Voting for the nextmap started")
}

public checkVotes()
{
	voteStarted = false
	
	new bolt = 0
	
	for(new a = 0; a < g_mapVoteNum; a++)
	{
		if(g_voteCount[bolt] < g_voteCount[a])
			bolt = a
	}
	
	//clear channel #2
	set_hudmessage(.channel=2)
	show_hudmessage(0, "")
	
	set_hudmessage(255, 127, 0, -1.0, 0.42, 2, 0.1, 10.0, 0.05, 1.0, 2)
	
	if((g_voteCount[g_votemaps] > g_voteCount[bolt]) && (g_voteCount[g_votemaps] > g_voteCount[g_votemaps + 1]))
	{	
		new Float:steptime = get_pcvar_float(extendmapstep_pcvar)
		f_timelimit = f_timelimit + steptime
		
		chat_color(0, "%L", LANG_SERVER, "MAP_EXTENDING", steptime)
		show_hudmessage(0, "%L", LANG_SERVER, "MAP_EXTENDING_HUD", steptime)
		
		log_amx("Super Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes", g_currentMap, steptime)
		
		hasExtend = true
		
		Reset()
		ContinueGame()
		
		return
	}
	
	new smap[32]
	
	if(g_voteCount[bolt] && (g_voteCount[g_votemaps + 1] <= g_voteCount[bolt]))
	{
		ArrayGetString(g_mapName, g_nextName[bolt], smap, sizeof smap -1)
		set_pcvar_string(nextmap, smap)
	}
	else get_pcvar_string(nextmap, smap, sizeof smap -1)	// get nextmap name in case if no one voted
	
	chat_color(0, "%L", LANG_SERVER, "NEXT_MAP_CHOSEN", smap)
	show_hudmessage(0, "%L", LANG_SERVER, "NEXT_MAP_CHOSEN_HUD", smap)
	
	if(forceChange)
	{
		chat_color(0, "%L", LANG_SERVER, "LAST_ROUND")
		set_hudmessage(255, 0, 0, -1.0, 0.58, 2, 0.1, 10.0, 0.05, 1.0, 1)
		show_hudmessage(0, "%L", LANG_SERVER, "LAST_ROUND_HUD")
	}
	
	new players[32], num, pid
	get_players(players, num)
	
	for(new i=0;i<num;i++)
	{
		pid = players[ i ]
		remove_task(pid+TASK_RESULT_ID)
	}
	
	log_amx("Super Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
	
	lastRound = true
	
	// increase timelimit if it might elapse earlier than current round
	new Float:f_timeleft = float(get_timeleft())
	if(f_timeleft)	// there is timelimit for map definately
		set_pcvar_float(mp_timelimit, get_gametime() / 60.0 + get_pcvar_float(mp_roundtime))
	
	ContinueGame()
}

public countVote(id, key)
{
	if(!voteStarted && forceBlock)
		return PLUGIN_HANDLED
	
	if(get_pcvar_float(vote_answers))
	{
		new name[32]
		get_user_name(id, name, sizeof name -1)
		
		if(key == g_votemaps)
		{
			chat_color(0, "%L", LANG_SERVER, "VOTED_EXTEND", name)
		}
		else if(key < g_votemaps)
		{
			new map[32]
			ArrayGetString(g_mapName, g_nextName[key], map, sizeof map -1)
			
			chat_color(0, "%L", LANG_SERVER, "VOTED", name, map)
		}
		
		cmdShowResults(id+TASK_RESULT_ID)
		set_task(0.8, "cmdShowResults", id+TASK_RESULT_ID, "", 0, "b")
	}
	
	client_cmd(id, "spk UI/buttonclickrelease")
	
	g_voteCount[key]++
	g_PlayersVoted++
	
	return PLUGIN_HANDLED
}

public cmdShowResults(pid)
{
	static id
	id = pid-TASK_RESULT_ID
	
	if(is_user_connected(id))
	{
		static i, len, message[HudLen]
		
		len = format(message, sizeof message -1, "%L^n^n", LANG_SERVER, "VOTE_RESULTS")
		
		for(i=0;i<g_votemaps;i++)
		{
			new map[32]
			ArrayGetString(g_mapName, g_saveids [ i ], map, sizeof map -1)
			len += format(message[len], HudLen -1, "[%d] | %s^n", g_voteCount, map)
		}
		
		len += format(message[len], HudLen -1, "[%d] | %s [%L]^n^n", g_voteCount, g_currentMap, LANG_SERVER, "PROLONGED")
		len += format(message[len], HudLen -1, "%L", LANG_SERVER, "VOTE_TOTAL", g_PlayersVoted, g_PlayersNum)
		
		set_hudmessage(g_result_red, g_result_green, g_result_blue, 0.36, 0.3, 0, 1.0, 4.0, 0.1, 0.2, 2)
		show_hudmessage(id, message)
	}
}

public Event_ScreenFade(id)
{
	if(hasBlind[id])
	{
		set_task(0.6, "cmdFadeScreen", id+TASK_SCREEN_ID)
	}
}

public cmdFadeScreen(pid)
{
	new id = pid-TASK_SCREEN_ID
	
	if(is_user_connected(id))
	{
		message_begin(MSG_ONE, g_msgScreenFade, _, id)
		write_short(1<<0)	// Duration
		write_short(1<<0)	// Hold time
		write_short(1<<2)	// Fade type
		write_byte(0)		// Red
		write_byte(0)		// Green
		write_byte(0)		// Blue
		write_byte(255)		// Alpha
		message_end()
	}
}

public plugin_end()
{
	new current_map[32]
	
	set_pcvar_num(maxspeed, g_maxspeed)
	
	get_mapname(current_map, sizeof current_map -1)
	set_localinfo("lastMap", current_map)
}

stock bool:ValidMap(mapname[])
{
	if(is_map_valid(mapname))
	{
		return true
	}
	
	new len = strlen(mapname) -4
	
	if(len < 0)
	{
		return false
	}
	
	if(equali(mapname[len], ".bsp"))
	{
		mapname[len] = '^0'
		
		if(is_map_valid(mapname))
		{
			return true
		}
	}
	
	return false
}

loadSettings(filename[])
{
	if(!file_exists(filename))
		return 0

	new
		currentMap[32],
		szText[32],
		buff[256]
	
	get_mapname(currentMap, sizeof currentMap -1)

	new fp = fopen(filename, "r")
	
	while(!feof(fp))
	{
		buff[0] = '^0'
		
		fgets(fp, buff, sizeof buff -1)
		
		parse(buff, szText, sizeof szText -1)
		
		if((szText[0] != ';') && ValidMap(szText) && !equali(szText, g_lastMap) && !equali(szText, currentMap))
		{
			ArrayPushString(g_mapName, szText)
			
			g_mapNums++
		}
	}
	
	fclose(fp)

	return g_mapNums
}

bool:isInMenu(id)
{
	for(new a = 0; a < g_mapVoteNum; a++)
	{
		if(id == g_nextName[a])
		{
			return true
		}
	}
	
	return false
}

//From the AMXX nextmap base file
public team_score()
{
	new team[2]
	read_data(1,team,1)
	g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}
stock chat_color(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[320]
   vformat(msg, 190, input, 3)
   replace_all(msg, 190, "!g", "^4")
   replace_all(msg, 190, "!n", "^1")
   replace_all(msg, 190, "!t", "^3")
   replace_all(msg, 190, "!t2", "^0")
   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()
         }
      }
   }
}
Discord: eyekon13
BoGdAnMoNs
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 30 Mar 2021, 23:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 1 time

11 Feb 2023, 20:54

a mers compilat ms

se poate face si ceva la el de exemplu scrii in chat /nominate , si iti apar mapele de pe server si poti nominaliza o mapa din lista pentru vot-ul de la final
Post Reply

Return to “Cereri”

  • Information