Cerere plugin Team Score And Round HUD

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
@Marius.
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 28 Dec 2018, 13:02
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

28 Dec 2018, 13:15

Plugin Cerut: Team Score And Round HUD
Descriere (adica ce face el mai exact): Sa apara un hud sus in care va contoriza scorul echipei si cate runde se joaca.
Serverul ruleaza (HLDS/ReHLDS): ReHLDS
Versiune AMX Mod X: 1.8.2
Modul Serverului: CSGO

La momentul actual am un plugin...cs_competitive, care face dupa 15 runde sa se schimbe echipele si dupa 30 runde sa schimbe mapa, doar ca hudul nu mai e functional, adica nu mai apare.
Stiu ca exista o multitudine de astfel de pluginuri insa niciunul pe placul meu, ba chiar unele dupa schimbarea echipei isi reseteaza scorul ceea ce eu nu imi doresc.

Modul este CSGO 1.9 Facut de zorken, as dori sa imi rezolvati si mie hudul acesta daca se poate, sau sa il inlocuiti.
https://imgur.com/a/kNQkLPo
Last edited by Rainq on 03 Jan 2019, 19:32, edited 3 times in total.
Reason: Editat dupa model
RoyalServer
User avatar
LondoN eXtream
Membru eXtream
Membru eXtream
Posts: 2755
Joined: 10 Oct 2014, 06:21
Detinator Steam: Da
SteamID: /id/london_extreamcs
Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
Fond eXtream: 0
Location: Roman, Neamț
Has thanked: 3 times
Been thanked: 12 times

28 Dec 2018, 13:21

Scorul se reseteaza datorita "sv_restart 1" care se aplica la schimbarea echipei.
Poti sa imi lasi si sma, si sa incerc sa ti-l rezolv
PS: cand mai veniti cu cereri de genu incercati sa lasati si sursa pentru a fi ajutati.
@Marius.
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 28 Dec 2018, 13:02
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

28 Dec 2018, 13:25

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include 		<  amxmodx  >
#include 		<  cstrike  >
#include <fakemeta>
#include 		<  hamsandwich  >
#include 		<  fakemeta_util  >
#include <dhudmessage>
#include <csx>
#include <fun>

#define TASKROUND 1231232135
#define TASKBOMB 42342523
#define 		PLUGIN 			"CS: Competitive Mod"
#define 		VERSION 		"0.Ox"
#define 		AUTHOR 			"Hades Ownage"

#define			szTag			"!g[!tCSGO]!n -"

#define			SWITCH_TIME		9	// seconds

new TeamScore [ 2 ], Switched, Showmsg, g_nextMap[32], g_mapCycle[32], g_pos
new Float:C4_CountDownDelay
new Float:roundtime
new end
new hs[33]
native get_mvp()
native set_user_chest(id,nr)
native get_user_chest(id)

public plugin_init ( ) {
	
	register_plugin ( PLUGIN, VERSION, AUTHOR );
	
	register_logevent ( "round_start", 2, "1=Round_Start" );
	register_logevent ( "round_end", 2, "1=Round_End" );
	
	register_event ( "SendAudio", "t_win", "a", "2=%!MRAD_terwin" );
	register_event ( "SendAudio", "ct_win", "a", "2=%!MRAD_ctwin" );
	
	register_event( "HLTV", "ev_RoundStart", "a", "1=0", "2=0" ); 
	register_event("DeathMsg", "Event_DeathMsg", "a")
	
	set_task ( 1.0, "CheckPlayers", _, _, _, "b" );

	new szString[32], szString2[32], szString3[8]
	
	get_localinfo("lastmapcycle", szString, 31)
	parse(szString, szString2, 31, szString3, 7)
	g_pos = str_to_num(szString3)
	get_cvar_string("mapcyclefile", g_mapCycle, 31)

	if (!equal(g_mapCycle, szString2))
		g_pos = 0	// mapcyclefile has been changed - go from first

	readMapCycle(g_mapCycle, g_nextMap, 31)
	set_cvar_string("amx_nextmap", g_nextMap)
	format(szString3, 31, "%s %d", g_mapCycle, g_pos)	// save lastmapcycle settings
	set_localinfo("lastmapcycle", szString3)
}
public dff()
{
	TeamScore [ 1 ] = 15
}
public plugin_precache()
{
	engfunc(EngFunc_PrecacheSound, "csgox/freezetime.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/20secunderamase.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/10secundec4.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/ctwin.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/twin.mp3")
}	
public ev_RoundStart ( ) {
	
	remove_task(TASKROUND)
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 stop")
	client_cmd(0, "mp3 play sound/csgox/freezetime.mp3")
	
}
public vote()
{
	server_cmd("gal_startvote")
}
public round_start ( ) {
	end = 0

	if (!Showmsg ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 2.0 );
		show_hudmessage ( 0, "MATCH STARTS!" );
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) & ~FL_FROZEN );
		
		Showmsg = 1;
		set_task(60.0, "vote")
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] == 14 && !Switched ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.15, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA DIN PRIMA REPRIZA!" );
		
	}
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	roundtime = (get_cvar_float("mp_roundtime")*60.0)-20.0
	set_task(roundtime, "startspk", TASKROUND)
}

public startspk()
{
	client_cmd(0, "mp3 play sound/csgox/20secunderamase.mp3")
}
public bomb_planted() {
	if(end)
		return 1;

	remove_task(TASKROUND)
	C4_CountDownDelay = get_cvar_float("mp_c4timer")-10.0
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	set_task(C4_CountDownDelay, "bomb", TASKBOMB)
	return 0;
}
public bomb()
{
	client_cmd(0, "mp3 play sound/csgox/10secundec4.mp3")
}
public round_end ( ) {

	if ( TeamScore [ 0 ] + TeamScore [ 1 ] >= 15 && !Switched ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 5.0, 0.0, 0.0, -1 );
		show_hudmessage ( 0, "\\ TEAM SWITCH //" );
		
		Switched = 1;
		TeamSwitch ( );
		
		new t_score = TeamScore [ 0 ];
		new ct_score = TeamScore [ 1 ];
		
		TeamScore [ 0 ] = ct_score;
		TeamScore [ 1 ] = t_score;
		server_cmd ( "amx_cvar mp_startmoney 800" );
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	
	if ( TeamScore [ 0 ] >= 16 || TeamScore [ 1 ] >= 16 ) {
		new mvp[32], tfrag, ctfrag, hs, ntfrag[32], nctfrag[32], nhs[32]
		tfrag = tPower()
		ctfrag = ctPower()
		hs = hsPower()
		get_user_name(get_mvp(), mvp, 31)
		get_user_name(tfrag, ntfrag, 31)
		get_user_name(ctfrag, nctfrag, 31)
		get_user_name(hs, nhs, 31)
		if(!tfrag)
			formatex(ntfrag, 31, "Nimeni")
		if(!ctfrag)
			formatex(nctfrag, 31, "Nimeni")
		if(!hs)
			formatex(nhs, 31, "Nimeni")
		if(!get_mvp())
			formatex(mvp, 31, "Nimeni")
		
		
		if ( TeamScore [ 0 ] > TeamScore [ 1 ] ) {
			
			set_hudmessage ( 255, 0, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			
			set_task (5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] > TeamScore [ 0 ] ) {
			set_hudmessage ( 0, 127, 255, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "ANTI TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			set_task ( 5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] == TeamScore [ 0 ] ) {
			
			set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "MECI EGAL!^n^nCele mai multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			set_task ( 5.0, "changelevel_" );
			
		}
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	end = 1
	
	return 1;
	
}
stock tPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			iPacks = get_user_frags(id)

			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
stock ctPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			iPacks = get_user_frags(id)
			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
public Event_DeathMsg()
{
	new id = read_data(1)
	new hss = read_data(3);
	if(is_user_connected(id) && hss)
		hs[id]++
}

stock hsPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		iPacks = hs[id]
		
		if ( iPacks > mvt )
		{
			mvt = iPacks
			iLeader = id
		}
	}
	return iLeader
}
public changelevel_ ( ) {
	new name[32]
	
	getNextMapName(name, 31);
	
	server_cmd ( "amx_map %s",name );
	
}

public t_win ( )
{
	TeamScore [ 0 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/twin.mp3")
}
public ct_win ( )
{
	TeamScore [ 1 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/ctwin.mp3")
}

public TeamSwitch ( ) {
	
	new iPlayers[  32  ],  iNum;
	get_players(  iPlayers,  iNum );
	
	if(  iNum  ) 
	{
		new  id;
		
		for(  --iNum;  iNum  >=  0;  iNum--  ) 
		{
			id  =  iPlayers[  iNum  ];
			BeginDelayedTeamChange(  id  );
			
		}
	}
	
}

public BeginDelayedTeamChange (  id  ) {
	
	switch(  id  ) 
	{ 
		case  1..6:  set_task(  0.1, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  7..13:  set_task(  0.2, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  14..20:  set_task(  0.3, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  21..26:  set_task(  0.4, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  27..32:  set_task(  0.5, "ChangeUserTeamWithDelay",  id  +  112233  ); 
		} 
}

public ChangeUserTeamWithDelay (  id  ) {
	
	id  -=  112233;
	if(  !is_user_connected(  id  )  )  return 1;
	
	cs_set_user_money ( id, 800 , 1);
	
	switch(  cs_get_user_team(  id  )   ) 
	{
		
		case  CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
			case  CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
			
	}
	
	server_cmd ( "sv_restart 1" );
	
	return 0;
}

public CheckPlayers ( ) {
	
	
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
		
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 > 10 )
		show_dhudmessage ( 0, "Runda: %d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
	else if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 == 10 )
		show_dhudmessage ( 0, "Runda: 10" );
	else
		show_dhudmessage ( 0, "Runda: 0%d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", TeamScore [ 0 ] > 9 ? "" : "0", TeamScore [ 0 ], TeamScore [ 1 ] > 9 ? "" : "0", TeamScore [ 1 ] );
}

stock PlayerAllCount ( Team ) {
	
	new iCount = 0; 
	for ( new i = 1; i <= get_maxplayers ( ); i++) {
		
		if ( is_user_connected ( i ) && get_user_team ( i ) == Team )
			++iCount; 
	} 
	
	return iCount; 
}  

stock bacon_strip_weapon(index, weapon[]) {
	if(!equal(weapon, "weapon_", 7)) 
		return 0
	
	static weaponid 
	weaponid = get_weaponid(weapon)
	
	if(!weaponid) 
		return 0
	
	static weaponent
	weaponent = fm_find_ent_by_owner(-1, weapon, index)
	
	if(!weaponent) 
		return 0
	
	if(get_user_weapon(index) == weaponid) 
		ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent)
	
	if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent)) 
		return 0
	
	ExecuteHamB(Ham_Item_Kill, weaponent)
	set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid))
	
	return 1
}

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()
		}
	}
}

getNextMapName(szArg[], iMax)
{
	new len = get_cvar_string("amx_nextmap", szArg, iMax)
	
	if (ValidMap(szArg)) return len
	len = copy(szArg, iMax, g_nextMap)
	set_cvar_string("amx_nextmap", g_nextMap)
	
	return len
}


stock bool:ValidMap(mapname[])
{
	if ( is_map_valid(mapname) )
	{
		return true;
	}
	// If the is_map_valid check failed, check the end of the string
	new len = strlen(mapname) - 4;
	
	// The mapname was too short to possibly house the .bsp extension
	if (len < 0)
	{
		return false;
	}
	if ( equali(mapname[len], ".bsp") )
	{
		// If the ending was .bsp, then cut it off.
		// the string is byref'ed, so this copies back to the loaded text.
		mapname[len] = '^0';
		
		// recheck
		if ( is_map_valid(mapname) )
		{
			return true;
		}
	}
	
	return false;
}

new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"

readMapCycle(szFileName[], szNext[], iNext)
{
	new b, i = 0, iMaps = 0
	new szBuffer[32], szFirst[32]

	if (file_exists(szFileName))
	{
		while (read_file(szFileName, i++, szBuffer, 31, b))
		{
			if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
			
			if (!iMaps)
				copy(szFirst, 31, szBuffer)
			
			if (++iMaps > g_pos)
			{
				copy(szNext, iNext, szBuffer)
				g_pos = iMaps
				return
			}
		}
	}

	if (!iMaps)
	{
		log_amx(g_warning, szFileName)
		get_mapname(szFirst, 31)
	}

	copy(szNext, iNext, szFirst)
	g_pos = 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


Sursa este publica pe internet, si da as dori sa imi scoateti si toate sunetele din el daca se poate, multumesc.

EDIT: Am rezolvat problema !
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2549
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 62 times
Contact:

28 Dec 2018, 15:16

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include 		<  amxmodx  >
#include 		<  cstrike  >
#include <fakemeta>
#include 		<  hamsandwich  >
#include 		<  fakemeta_util  >
#include <dhudmessage>
#include <csx>
#include <fun>

#define TASKROUND 1231232135
#define TASKBOMB 42342523
#define 		PLUGIN 			"CS: Competitive Mod"
#define 		VERSION 		"0.Ox"
#define 		AUTHOR 			"Hades Ownage"

#define			szTag			"!g[!tCSGO]!n -"

#define			SWITCH_TIME		9	// seconds

new TeamScore [ 2 ], Switched, Showmsg, g_nextMap[32], g_mapCycle[32], g_pos
new Float:C4_CountDownDelay
new Float:roundtime
new end
new hs[33]
native get_mvp()
native set_user_chest(id,nr)
native get_user_chest(id)

public plugin_init ( ) {
	
	register_plugin ( PLUGIN, VERSION, AUTHOR );
	
	register_logevent ( "round_start", 2, "1=Round_Start" );
	register_logevent ( "round_end", 2, "1=Round_End" );
	
	register_event( "HLTV", "ev_RoundStart", "a", "1=0", "2=0" ); 
	register_event("DeathMsg", "Event_DeathMsg", "a")
	
	set_task ( 1.0, "CheckPlayers", _, _, _, "b" );

	new szString[32], szString2[32], szString3[8]
	
	get_localinfo("lastmapcycle", szString, 31)
	parse(szString, szString2, 31, szString3, 7)
	g_pos = str_to_num(szString3)
	get_cvar_string("mapcyclefile", g_mapCycle, 31)

	if (!equal(g_mapCycle, szString2))
		g_pos = 0	// mapcyclefile has been changed - go from first

	readMapCycle(g_mapCycle, g_nextMap, 31)
	set_cvar_string("amx_nextmap", g_nextMap)
	format(szString3, 31, "%s %d", g_mapCycle, g_pos)	// save lastmapcycle settings
	set_localinfo("lastmapcycle", szString3)
}
public dff()
{
	TeamScore [ 1 ] = 15
}

public vote()
{
	server_cmd("gal_startvote")
}
public round_start ( ) {
	end = 0

	if (!Showmsg ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 2.0 );
		show_hudmessage ( 0, "MATCH STARTS!" );
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) & ~FL_FROZEN );
		
		Showmsg = 1;
		set_task(60.0, "vote")
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] == 14 && !Switched ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.15, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA DIN PRIMA REPRIZA!" );
		
	}
	remove_task(TASKROUND)
	roundtime = (get_cvar_float("mp_roundtime")*60.0)-20.0
	set_task(roundtime, "startspk", TASKROUND)
}

public bomb_planted() {
	if(end)
		return 1;

	remove_task(TASKROUND)
	C4_CountDownDelay = get_cvar_float("mp_c4timer")-10.0
	set_task(C4_CountDownDelay, "bomb", TASKBOMB)
	return 0;
}

public round_end ( ) {

	if ( TeamScore [ 0 ] + TeamScore [ 1 ] >= 15 && !Switched ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 5.0, 0.0, 0.0, -1 );
		show_hudmessage ( 0, "\\ TEAM SWITCH //" );
		
		Switched = 1;
		TeamSwitch ( );
		
		new t_score = TeamScore [ 0 ];
		new ct_score = TeamScore [ 1 ];
		
		TeamScore [ 0 ] = ct_score;
		TeamScore [ 1 ] = t_score;
		server_cmd ( "amx_cvar mp_startmoney 800" );
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	
	if ( TeamScore [ 0 ] >= 16 || TeamScore [ 1 ] >= 16 ) {
		new mvp[32], tfrag, ctfrag, hs, ntfrag[32], nctfrag[32], nhs[32]
		tfrag = tPower()
		ctfrag = ctPower()
		hs = hsPower()
		get_user_name(get_mvp(), mvp, 31)
		get_user_name(tfrag, ntfrag, 31)
		get_user_name(ctfrag, nctfrag, 31)
		get_user_name(hs, nhs, 31)
		if(!tfrag)
			formatex(ntfrag, 31, "Nimeni")
		if(!ctfrag)
			formatex(nctfrag, 31, "Nimeni")
		if(!hs)
			formatex(nhs, 31, "Nimeni")
		if(!get_mvp())
			formatex(mvp, 31, "Nimeni")
		
		
		if ( TeamScore [ 0 ] > TeamScore [ 1 ] ) {
			
			set_hudmessage ( 255, 0, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			
			set_task (5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] > TeamScore [ 0 ] ) {
			set_hudmessage ( 0, 127, 255, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "ANTI TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			set_task ( 5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] == TeamScore [ 0 ] ) {
			
			set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "MECI EGAL!^n^nCele mai multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			set_task ( 5.0, "changelevel_" );
			
		}
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	end = 1
	
	return 1;
	
}
stock tPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			iPacks = get_user_frags(id)

			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
stock ctPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			iPacks = get_user_frags(id)
			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
public Event_DeathMsg()
{
	new id = read_data(1)
	new hss = read_data(3);
	if(is_user_connected(id) && hss)
		hs[id]++
}

stock hsPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		iPacks = hs[id]
		
		if ( iPacks > mvt )
		{
			mvt = iPacks
			iLeader = id
		}
	}
	return iLeader
}
public changelevel_ ( ) {
	new name[32]
	
	getNextMapName(name, 31);
	
	server_cmd ( "amx_map %s",name );
	
}

public t_win ( )
{
	TeamScore [ 0 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
}
public ct_win ( )
{
	TeamScore [ 1 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
}

public TeamSwitch ( ) {
	
	new iPlayers[  32  ],  iNum;
	get_players(  iPlayers,  iNum );
	
	if(  iNum  ) 
	{
		new  id;
		
		for(  --iNum;  iNum  >=  0;  iNum--  ) 
		{
			id  =  iPlayers[  iNum  ];
			BeginDelayedTeamChange(  id  );
			
		}
	}
	
}

public BeginDelayedTeamChange (  id  ) {
	
	switch(  id  ) 
	{ 
		case  1..6:  set_task(  0.1, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  7..13:  set_task(  0.2, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  14..20:  set_task(  0.3, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  21..26:  set_task(  0.4, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  27..32:  set_task(  0.5, "ChangeUserTeamWithDelay",  id  +  112233  ); 
		} 
}

public ChangeUserTeamWithDelay (  id  ) {
	
	id  -=  112233;
	if(  !is_user_connected(  id  )  )  return 1;
	
	cs_set_user_money ( id, 800 , 1);
	
	switch(  cs_get_user_team(  id  )   ) 
	{
		
		case  CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
			case  CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
			
	}
	
	server_cmd ( "sv_restart 1" );
	
	return 0;
}

public CheckPlayers ( ) {
	
	
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
		
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 > 10 )
		show_dhudmessage ( 0, "Runda: %d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
	else if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 == 10 )
		show_dhudmessage ( 0, "Runda: 10" );
	else
		show_dhudmessage ( 0, "Runda: 0%d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", TeamScore [ 0 ] > 9 ? "" : "0", TeamScore [ 0 ], TeamScore [ 1 ] > 9 ? "" : "0", TeamScore [ 1 ] );
}

stock PlayerAllCount ( Team ) {
	
	new iCount = 0; 
	for ( new i = 1; i <= get_maxplayers ( ); i++) {
		
		if ( is_user_connected ( i ) && get_user_team ( i ) == Team )
			++iCount; 
	} 
	
	return iCount; 
}  

stock bacon_strip_weapon(index, weapon[]) {
	if(!equal(weapon, "weapon_", 7)) 
		return 0
	
	static weaponid 
	weaponid = get_weaponid(weapon)
	
	if(!weaponid) 
		return 0
	
	static weaponent
	weaponent = fm_find_ent_by_owner(-1, weapon, index)
	
	if(!weaponent) 
		return 0
	
	if(get_user_weapon(index) == weaponid) 
		ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent)
	
	if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent)) 
		return 0
	
	ExecuteHamB(Ham_Item_Kill, weaponent)
	set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid))
	
	return 1
}

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()
		}
	}
}

getNextMapName(szArg[], iMax)
{
	new len = get_cvar_string("amx_nextmap", szArg, iMax)
	
	if (ValidMap(szArg)) return len
	len = copy(szArg, iMax, g_nextMap)
	set_cvar_string("amx_nextmap", g_nextMap)
	
	return len
}


stock bool:ValidMap(mapname[])
{
	if ( is_map_valid(mapname) )
	{
		return true;
	}
	// If the is_map_valid check failed, check the end of the string
	new len = strlen(mapname) - 4;
	
	// The mapname was too short to possibly house the .bsp extension
	if (len < 0)
	{
		return false;
	}
	if ( equali(mapname[len], ".bsp") )
	{
		// If the ending was .bsp, then cut it off.
		// the string is byref'ed, so this copies back to the loaded text.
		mapname[len] = '^0';
		
		// recheck
		if ( is_map_valid(mapname) )
		{
			return true;
		}
	}
	
	return false;
}

new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"

readMapCycle(szFileName[], szNext[], iNext)
{
	new b, i = 0, iMaps = 0
	new szBuffer[32], szFirst[32]

	if (file_exists(szFileName))
	{
		while (read_file(szFileName, i++, szBuffer, 31, b))
		{
			if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
			
			if (!iMaps)
				copy(szFirst, 31, szBuffer)
			
			if (++iMaps > g_pos)
			{
				copy(szNext, iNext, szBuffer)
				g_pos = iMaps
				return
			}
		}
	}

	if (!iMaps)
	{
		log_amx(g_warning, szFileName)
		get_mapname(szFirst, 31)
	}

	copy(szNext, iNext, szFirst)
	g_pos = 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
no...
User avatar
vld.mihai
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 17 Jan 2015, 12:33
Detinator Steam: Da
CS Status: ASL.BLACKGAMES.RO
Detinator server CS: ASL.BLACKGAMES.RO
SteamID: vlad2795
Fond eXtream: 0
Location: Bacau
Has thanked: 3 times

10 Jan 2021, 15:45

@Marius. wrote:
28 Dec 2018, 13:25
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include 		<  amxmodx  >
#include 		<  cstrike  >
#include <fakemeta>
#include 		<  hamsandwich  >
#include 		<  fakemeta_util  >
#include <dhudmessage>
#include <csx>
#include <fun>

#define TASKROUND 1231232135
#define TASKBOMB 42342523
#define 		PLUGIN 			"CS: Competitive Mod"
#define 		VERSION 		"0.Ox"
#define 		AUTHOR 			"Hades Ownage"

#define			szTag			"!g[!tCSGO]!n -"

#define			SWITCH_TIME		9	// seconds

new TeamScore [ 2 ], Switched, Showmsg, g_nextMap[32], g_mapCycle[32], g_pos
new Float:C4_CountDownDelay
new Float:roundtime
new end
new hs[33]
native get_mvp()
native set_user_chest(id,nr)
native get_user_chest(id)

public plugin_init ( ) {
	
	register_plugin ( PLUGIN, VERSION, AUTHOR );
	
	register_logevent ( "round_start", 2, "1=Round_Start" );
	register_logevent ( "round_end", 2, "1=Round_End" );
	
	register_event ( "SendAudio", "t_win", "a", "2=%!MRAD_terwin" );
	register_event ( "SendAudio", "ct_win", "a", "2=%!MRAD_ctwin" );
	
	register_event( "HLTV", "ev_RoundStart", "a", "1=0", "2=0" ); 
	register_event("DeathMsg", "Event_DeathMsg", "a")
	
	set_task ( 1.0, "CheckPlayers", _, _, _, "b" );

	new szString[32], szString2[32], szString3[8]
	
	get_localinfo("lastmapcycle", szString, 31)
	parse(szString, szString2, 31, szString3, 7)
	g_pos = str_to_num(szString3)
	get_cvar_string("mapcyclefile", g_mapCycle, 31)

	if (!equal(g_mapCycle, szString2))
		g_pos = 0	// mapcyclefile has been changed - go from first

	readMapCycle(g_mapCycle, g_nextMap, 31)
	set_cvar_string("amx_nextmap", g_nextMap)
	format(szString3, 31, "%s %d", g_mapCycle, g_pos)	// save lastmapcycle settings
	set_localinfo("lastmapcycle", szString3)
}
public dff()
{
	TeamScore [ 1 ] = 15
}
public plugin_precache()
{
	engfunc(EngFunc_PrecacheSound, "csgox/freezetime.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/20secunderamase.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/10secundec4.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/ctwin.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/twin.mp3")
}	
public ev_RoundStart ( ) {
	
	remove_task(TASKROUND)
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 stop")
	client_cmd(0, "mp3 play sound/csgox/freezetime.mp3")
	
}
public vote()
{
	server_cmd("gal_startvote")
}
public round_start ( ) {
	end = 0

	if (!Showmsg ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 2.0 );
		show_hudmessage ( 0, "MATCH STARTS!" );
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) & ~FL_FROZEN );
		
		Showmsg = 1;
		set_task(60.0, "vote")
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] == 14 && !Switched ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.15, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA DIN PRIMA REPRIZA!" );
		
	}
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	roundtime = (get_cvar_float("mp_roundtime")*60.0)-20.0
	set_task(roundtime, "startspk", TASKROUND)
}

public startspk()
{
	client_cmd(0, "mp3 play sound/csgox/20secunderamase.mp3")
}
public bomb_planted() {
	if(end)
		return 1;

	remove_task(TASKROUND)
	C4_CountDownDelay = get_cvar_float("mp_c4timer")-10.0
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	set_task(C4_CountDownDelay, "bomb", TASKBOMB)
	return 0;
}
public bomb()
{
	client_cmd(0, "mp3 play sound/csgox/10secundec4.mp3")
}
public round_end ( ) {

	if ( TeamScore [ 0 ] + TeamScore [ 1 ] >= 15 && !Switched ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 5.0, 0.0, 0.0, -1 );
		show_hudmessage ( 0, "\\ TEAM SWITCH //" );
		
		Switched = 1;
		TeamSwitch ( );
		
		new t_score = TeamScore [ 0 ];
		new ct_score = TeamScore [ 1 ];
		
		TeamScore [ 0 ] = ct_score;
		TeamScore [ 1 ] = t_score;
		server_cmd ( "amx_cvar mp_startmoney 800" );
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	
	if ( TeamScore [ 0 ] >= 16 || TeamScore [ 1 ] >= 16 ) {
		new mvp[32], tfrag, ctfrag, hs, ntfrag[32], nctfrag[32], nhs[32]
		tfrag = tPower()
		ctfrag = ctPower()
		hs = hsPower()
		get_user_name(get_mvp(), mvp, 31)
		get_user_name(tfrag, ntfrag, 31)
		get_user_name(ctfrag, nctfrag, 31)
		get_user_name(hs, nhs, 31)
		if(!tfrag)
			formatex(ntfrag, 31, "Nimeni")
		if(!ctfrag)
			formatex(nctfrag, 31, "Nimeni")
		if(!hs)
			formatex(nhs, 31, "Nimeni")
		if(!get_mvp())
			formatex(mvp, 31, "Nimeni")
		
		
		if ( TeamScore [ 0 ] > TeamScore [ 1 ] ) {
			
			set_hudmessage ( 255, 0, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			
			set_task (5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] > TeamScore [ 0 ] ) {
			set_hudmessage ( 0, 127, 255, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "ANTI TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			set_task ( 5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] == TeamScore [ 0 ] ) {
			
			set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "MECI EGAL!^n^nCele mai multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			set_task ( 5.0, "changelevel_" );
			
		}
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	end = 1
	
	return 1;
	
}
stock tPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			iPacks = get_user_frags(id)

			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
stock ctPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			iPacks = get_user_frags(id)
			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
public Event_DeathMsg()
{
	new id = read_data(1)
	new hss = read_data(3);
	if(is_user_connected(id) && hss)
		hs[id]++
}

stock hsPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers
		iPacks = hs[id]
		
		if ( iPacks > mvt )
		{
			mvt = iPacks
			iLeader = id
		}
	}
	return iLeader
}
public changelevel_ ( ) {
	new name[32]
	
	getNextMapName(name, 31);
	
	server_cmd ( "amx_map %s",name );
	
}

public t_win ( )
{
	TeamScore [ 0 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/twin.mp3")
}
public ct_win ( )
{
	TeamScore [ 1 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/ctwin.mp3")
}

public TeamSwitch ( ) {
	
	new iPlayers[  32  ],  iNum;
	get_players(  iPlayers,  iNum );
	
	if(  iNum  ) 
	{
		new  id;
		
		for(  --iNum;  iNum  >=  0;  iNum--  ) 
		{
			id  =  iPlayers[  iNum  ];
			BeginDelayedTeamChange(  id  );
			
		}
	}
	
}

public BeginDelayedTeamChange (  id  ) {
	
	switch(  id  ) 
	{ 
		case  1..6:  set_task(  0.1, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  7..13:  set_task(  0.2, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  14..20:  set_task(  0.3, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  21..26:  set_task(  0.4, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  27..32:  set_task(  0.5, "ChangeUserTeamWithDelay",  id  +  112233  ); 
		} 
}

public ChangeUserTeamWithDelay (  id  ) {
	
	id  -=  112233;
	if(  !is_user_connected(  id  )  )  return 1;
	
	cs_set_user_money ( id, 800 , 1);
	
	switch(  cs_get_user_team(  id  )   ) 
	{
		
		case  CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
			case  CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
			
	}
	
	server_cmd ( "sv_restart 1" );
	
	return 0;
}

public CheckPlayers ( ) {
	
	
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
		
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 > 10 )
		show_dhudmessage ( 0, "Runda: %d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
	else if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 == 10 )
		show_dhudmessage ( 0, "Runda: 10" );
	else
		show_dhudmessage ( 0, "Runda: 0%d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", TeamScore [ 0 ] > 9 ? "" : "0", TeamScore [ 0 ], TeamScore [ 1 ] > 9 ? "" : "0", TeamScore [ 1 ] );
}

stock PlayerAllCount ( Team ) {
	
	new iCount = 0; 
	for ( new i = 1; i <= get_maxplayers ( ); i++) {
		
		if ( is_user_connected ( i ) && get_user_team ( i ) == Team )
			++iCount; 
	} 
	
	return iCount; 
}  

stock bacon_strip_weapon(index, weapon[]) {
	if(!equal(weapon, "weapon_", 7)) 
		return 0
	
	static weaponid 
	weaponid = get_weaponid(weapon)
	
	if(!weaponid) 
		return 0
	
	static weaponent
	weaponent = fm_find_ent_by_owner(-1, weapon, index)
	
	if(!weaponent) 
		return 0
	
	if(get_user_weapon(index) == weaponid) 
		ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent)
	
	if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent)) 
		return 0
	
	ExecuteHamB(Ham_Item_Kill, weaponent)
	set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid))
	
	return 1
}

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()
		}
	}
}

getNextMapName(szArg[], iMax)
{
	new len = get_cvar_string("amx_nextmap", szArg, iMax)
	
	if (ValidMap(szArg)) return len
	len = copy(szArg, iMax, g_nextMap)
	set_cvar_string("amx_nextmap", g_nextMap)
	
	return len
}


stock bool:ValidMap(mapname[])
{
	if ( is_map_valid(mapname) )
	{
		return true;
	}
	// If the is_map_valid check failed, check the end of the string
	new len = strlen(mapname) - 4;
	
	// The mapname was too short to possibly house the .bsp extension
	if (len < 0)
	{
		return false;
	}
	if ( equali(mapname[len], ".bsp") )
	{
		// If the ending was .bsp, then cut it off.
		// the string is byref'ed, so this copies back to the loaded text.
		mapname[len] = '^0';
		
		// recheck
		if ( is_map_valid(mapname) )
		{
			return true;
		}
	}
	
	return false;
}

new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"

readMapCycle(szFileName[], szNext[], iNext)
{
	new b, i = 0, iMaps = 0
	new szBuffer[32], szFirst[32]

	if (file_exists(szFileName))
	{
		while (read_file(szFileName, i++, szBuffer, 31, b))
		{
			if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
			
			if (!iMaps)
				copy(szFirst, 31, szBuffer)
			
			if (++iMaps > g_pos)
			{
				copy(szNext, iNext, szBuffer)
				g_pos = iMaps
				return
			}
		}
	}

	if (!iMaps)
	{
		log_amx(g_warning, szFileName)
		get_mapname(szFirst, 31)
	}

	copy(szNext, iNext, szFirst)
	g_pos = 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


Sursa este publica pe internet, si da as dori sa imi scoateti si toate sunetele din el daca se poate, multumesc.

EDIT: Am rezolvat problema !


da eroare la compilat .

Code: Select all

//// asl_runde.sma
// C:\Users\Asus\Desktop\COMPLIE\asl_runde.sma(246 -- 247) : error 006: must be assigned to an array
// C:\Users\Asus\Desktop\COMPLIE\asl_runde.sma(270 -- 271) : error 006: must be assigned to an array
// C:\Users\Asus\Desktop\COMPLIE\asl_runde.sma(301 -- 302) : error 006: must be assigned to an array
//
// 3 Errors.
// Could not locate output file compiled\asl_runde.amx (compile failed).
Image
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 Jan 2021, 17:18

pluginuri-extream/dhud-team-details-t239062.html
sau sursa postată fixată

Code: Select all

/* Plugin generated by AMXX-Studio */

#include 		<  amxmodx  >
#include 		<  cstrike  >
#include <fakemeta>
#include 		<  hamsandwich  >
#include 		<  fakemeta_util  >
#include <dhudmessage>
#include <csx>
#include <fun>

#define TASKROUND 1231232135
#define TASKBOMB 42342523
#define 		PLUGIN 			"CS: Competitive Mod"
#define 		VERSION 		"0.Ox"
#define 		AUTHOR 			"Hades Ownage"

#define			szTag			"!g[!tCSGO]!n -"

#define			SWITCH_TIME		9	// seconds

new TeamScore [ 2 ], Switched, Showmsg, g_nextMap[32], g_mapCycle[32], g_pos
new Float:C4_CountDownDelay
new Float:roundtime
new end
new hs[33]
native get_mvp()
native set_user_chest(id,nr)
native get_user_chest(id)

public plugin_init ( ) {
	
	register_plugin ( PLUGIN, VERSION, AUTHOR );
	
	register_logevent ( "round_start", 2, "1=Round_Start" );
	register_logevent ( "round_end", 2, "1=Round_End" );
	
	register_event ( "SendAudio", "t_win", "a", "2=%!MRAD_terwin" );
	register_event ( "SendAudio", "ct_win", "a", "2=%!MRAD_ctwin" );
	
	register_event( "HLTV", "ev_RoundStart", "a", "1=0", "2=0" ); 
	register_event("DeathMsg", "Event_DeathMsg", "a")
	
	set_task ( 1.0, "CheckPlayers", _, _, _, "b" );

	new szString[32], szString2[32], szString3[8]
	
	get_localinfo("lastmapcycle", szString, 31)
	parse(szString, szString2, 31, szString3, 7)
	g_pos = str_to_num(szString3)
	get_cvar_string("mapcyclefile", g_mapCycle, 31)

	if (!equal(g_mapCycle, szString2))
		g_pos = 0	// mapcyclefile has been changed - go from first

	readMapCycle(g_mapCycle, g_nextMap, 31)
	set_cvar_string("amx_nextmap", g_nextMap)
	format(szString3, 31, "%s %d", g_mapCycle, g_pos)	// save lastmapcycle settings
	set_localinfo("lastmapcycle", szString3)
}
public dff()
{
	TeamScore [ 1 ] = 15
}
public plugin_precache()
{
	engfunc(EngFunc_PrecacheSound, "csgox/freezetime.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/20secunderamase.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/10secundec4.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/ctwin.mp3")
	engfunc(EngFunc_PrecacheSound, "csgox/twin.mp3")
}	
public ev_RoundStart ( ) {
	
	remove_task(TASKROUND)
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 stop")
	client_cmd(0, "mp3 play sound/csgox/freezetime.mp3")
	
}
public vote()
{
	server_cmd("gal_startvote")
}
public round_start ( ) {
	end = 0

	if (!Showmsg ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 2.0 );
		show_hudmessage ( 0, "MATCH STARTS!" );
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) & ~FL_FROZEN );
		
		Showmsg = 1;
		set_task(60.0, "vote")
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] < 15 ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "RUNDA DECISIVA!" );
		
	}
	
	if ( TeamScore [ 0 ] == 15 && TeamScore [ 1 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 1 ] == 15 && TeamScore [ 0 ] == 14 ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA!" );
		
	}
	
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] == 14 && !Switched ) {
		
		set_hudmessage ( 255, 85, 0, -1.0, 0.15, 1, 6.0, 3.0 );
		show_hudmessage ( 0, "ULTIMA RUNDA DIN PRIMA REPRIZA!" );
		
	}
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	roundtime = (get_cvar_float("mp_roundtime")*60.0)-20.0
	set_task(roundtime, "startspk", TASKROUND)
}

public startspk()
{
	client_cmd(0, "mp3 play sound/csgox/20secunderamase.mp3")
}
public bomb_planted() {
	if(end)
		return 1;

	remove_task(TASKROUND)
	C4_CountDownDelay = get_cvar_float("mp_c4timer")-10.0
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	set_task(C4_CountDownDelay, "bomb", TASKBOMB)
	return 0;
}
public bomb()
{
	client_cmd(0, "mp3 play sound/csgox/10secundec4.mp3")
}
public round_end ( ) {

	if ( TeamScore [ 0 ] + TeamScore [ 1 ] >= 15 && !Switched ) {
		
		set_hudmessage ( 255, 255, 255, -1.0, 0.13, 1, 6.0, 5.0, 0.0, 0.0, -1 );
		show_hudmessage ( 0, "\\ TEAM SWITCH //" );
		
		Switched = 1;
		TeamSwitch ( );
		
		new t_score = TeamScore [ 0 ];
		new ct_score = TeamScore [ 1 ];
		
		TeamScore [ 0 ] = ct_score;
		TeamScore [ 1 ] = t_score;
		server_cmd ( "amx_cvar mp_startmoney 800" );
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	
	if ( TeamScore [ 0 ] >= 16 || TeamScore [ 1 ] >= 16 ) {
		new mvp[32], tfrag, ctfrag, hs, ntfrag[32], nctfrag[32], nhs[32]
		tfrag = tPower()
		ctfrag = ctPower()
		hs = hsPower()
		get_user_name(get_mvp(), mvp, 31)
		get_user_name(tfrag, ntfrag, 31)
		get_user_name(ctfrag, nctfrag, 31)
		get_user_name(hs, nhs, 31)
		if(!tfrag)
			formatex(ntfrag, 31, "Nimeni")
		if(!ctfrag)
			formatex(nctfrag, 31, "Nimeni")
		if(!hs)
			formatex(nhs, 31, "Nimeni")
		if(!get_mvp())
			formatex(mvp, 31, "Nimeni")
		
		
		if ( TeamScore [ 0 ] > TeamScore [ 1 ] ) {
			
			set_hudmessage ( 255, 0, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			
			set_task (5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] > TeamScore [ 0 ] ) {
			set_hudmessage ( 0, 127, 255, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "ANTI TERORISTII AU CASTIGAT MECIUL!^n^nCele Mai Multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			for(new x; x < 32; x++)
			{
				if(!is_user_connected(x))
					continue;
			}
			set_task ( 5.0, "changelevel_" );
			
		}
		
		else if ( TeamScore [ 1 ] == TeamScore [ 0 ] ) {
			
			set_hudmessage ( 255, 85, 0, -1.0, 0.13, 1, 6.0, 360.0 );
			show_hudmessage ( 0, "MECI EGAL!^n^nCele mai multe MVP-uri %s^nCel mai bun T %s^nCel mai bun CT %s^nCele mai multe HS %s", mvp,ntfrag,nctfrag,nhs );
			set_task ( 5.0, "changelevel_" );
			
		}
		
		set_pev ( 0, pev_flags, pev ( 0, pev_flags ) | FL_FROZEN );
	}
	end = 1
	
	return 1;
	
}
stock tPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers[i]
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			iPacks = get_user_frags(id)

			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
stock ctPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers[i]
		if(cs_get_user_team(id) == CS_TEAM_CT)
		{
			iPacks = get_user_frags(id)
			if(iPacks >= 50)
				set_user_chest(id,get_user_chest(id)+1)

			if ( iPacks > mvt )
			{
				mvt = iPacks
				iLeader = id
			}
		}
	}
	return iLeader
}
public Event_DeathMsg()
{
	new id = read_data(1)
	new hss = read_data(3);
	if(is_user_connected(id) && hss)
		hs[id]++
}

stock hsPower()
{
	new iPlayers[32], iNum, id, i, iLeader, iPacks, mvt
	get_players( iPlayers, iNum, "ch" )
	
	for ( i = 0; i < iNum; i++ )
	{
		id = iPlayers[i]
		iPacks = hs[id]
		
		if ( iPacks > mvt )
		{
			mvt = iPacks
			iLeader = id
		}
	}
	return iLeader
}
public changelevel_ ( ) {
	new name[32]
	
	getNextMapName(name, 31);
	
	server_cmd ( "amx_map %s",name );
	
}

public t_win ( )
{
	TeamScore [ 0 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/twin.mp3")
}
public ct_win ( )
{
	TeamScore [ 1 ]++;
	remove_task(TASKBOMB)
	remove_task(TASKROUND)
	client_cmd(0, "mp3 stop")
	client_cmd(0, "stopsound")
	client_cmd(0, "mp3 play sound/csgox/ctwin.mp3")
}

public TeamSwitch ( ) {
	
	new iPlayers[  32  ],  iNum;
	get_players(  iPlayers,  iNum );
	
	if(  iNum  ) 
	{
		new  id;
		
		for(  --iNum;  iNum  >=  0;  iNum--  ) 
		{
			id  =  iPlayers[  iNum  ];
			BeginDelayedTeamChange(  id  );
			
		}
	}
	
}

public BeginDelayedTeamChange (  id  ) {
	
	switch(  id  ) 
	{ 
		case  1..6:  set_task(  0.1, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  7..13:  set_task(  0.2, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  14..20:  set_task(  0.3, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  21..26:  set_task(  0.4, "ChangeUserTeamWithDelay",  id  +  112233  ); 
			case  27..32:  set_task(  0.5, "ChangeUserTeamWithDelay",  id  +  112233  ); 
		} 
}

public ChangeUserTeamWithDelay (  id  ) {
	
	id  -=  112233;
	if(  !is_user_connected(  id  )  )  return 1;
	
	cs_set_user_money ( id, 800 , 1);
	
	switch(  cs_get_user_team(  id  )   ) 
	{
		
		case  CS_TEAM_T:  cs_set_user_team(  id,  CS_TEAM_CT  );
			case  CS_TEAM_CT:cs_set_user_team(  id,  CS_TEAM_T  );
			
	}
	
	server_cmd ( "sv_restart 1" );
	
	return 0;
}

public CheckPlayers ( ) {
	
	
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
		
	if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 > 10 )
		show_dhudmessage ( 0, "Runda: %d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
	else if ( TeamScore [ 0 ] + TeamScore [ 1 ] + 1 == 10 )
		show_dhudmessage ( 0, "Runda: 10" );
	else
		show_dhudmessage ( 0, "Runda: 0%d", TeamScore [ 0 ] + TeamScore [ 1 ] + 1 );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", TeamScore [ 0 ] > 9 ? "" : "0", TeamScore [ 0 ], TeamScore [ 1 ] > 9 ? "" : "0", TeamScore [ 1 ] );
}

stock PlayerAllCount ( Team ) {
	
	new iCount = 0; 
	for ( new i = 1; i <= get_maxplayers ( ); i++) {
		
		if ( is_user_connected ( i ) && get_user_team ( i ) == Team )
			++iCount; 
	} 
	
	return iCount; 
}  

stock bacon_strip_weapon(index, weapon[]) {
	if(!equal(weapon, "weapon_", 7)) 
		return 0
	
	static weaponid 
	weaponid = get_weaponid(weapon)
	
	if(!weaponid) 
		return 0
	
	static weaponent
	weaponent = fm_find_ent_by_owner(-1, weapon, index)
	
	if(!weaponent) 
		return 0
	
	if(get_user_weapon(index) == weaponid) 
		ExecuteHamB(Ham_Weapon_RetireWeapon, weaponent)
	
	if(!ExecuteHamB(Ham_RemovePlayerItem, index, weaponent)) 
		return 0
	
	ExecuteHamB(Ham_Item_Kill, weaponent)
	set_pev(index, pev_weapons, pev(index, pev_weapons) & ~(1<<weaponid))
	
	return 1
}

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()
		}
	}
}

getNextMapName(szArg[], iMax)
{
	new len = get_cvar_string("amx_nextmap", szArg, iMax)
	
	if (ValidMap(szArg)) return len
	len = copy(szArg, iMax, g_nextMap)
	set_cvar_string("amx_nextmap", g_nextMap)
	
	return len
}


stock bool:ValidMap(mapname[])
{
	if ( is_map_valid(mapname) )
	{
		return true;
	}
	// If the is_map_valid check failed, check the end of the string
	new len = strlen(mapname) - 4;
	
	// The mapname was too short to possibly house the .bsp extension
	if (len < 0)
	{
		return false;
	}
	if ( equali(mapname[len], ".bsp") )
	{
		// If the ending was .bsp, then cut it off.
		// the string is byref'ed, so this copies back to the loaded text.
		mapname[len] = '^0';
		
		// recheck
		if ( is_map_valid(mapname) )
		{
			return true;
		}
	}
	
	return false;
}

new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"

readMapCycle(szFileName[], szNext[], iNext)
{
	new b, i = 0, iMaps = 0
	new szBuffer[32], szFirst[32]

	if (file_exists(szFileName))
	{
		while (read_file(szFileName, i++, szBuffer, 31, b))
		{
			if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
			
			if (!iMaps)
				copy(szFirst, 31, szBuffer)
			
			if (++iMaps > g_pos)
			{
				copy(szNext, iNext, szBuffer)
				g_pos = iMaps
				return
			}
		}
	}

	if (!iMaps)
	{
		log_amx(g_warning, szFileName)
		get_mapname(szFirst, 31)
	}

	copy(szNext, iNext, szFirst)
	g_pos = 1
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
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)
User avatar
vld.mihai
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 17 Jan 2015, 12:33
Detinator Steam: Da
CS Status: ASL.BLACKGAMES.RO
Detinator server CS: ASL.BLACKGAMES.RO
SteamID: vlad2795
Fond eXtream: 0
Location: Bacau
Has thanked: 3 times

10 Jan 2021, 18:05

l-am compilat si nu merge pe server !

Code: Select all

unknown            unknown     unknown           asl_runde.amxx   bad load 
daca e posibil acest plugin sa fie, am gasit si eu alte versiuni , dar as avea nevoie de asta din poza ! Multumesc

Image
Image
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 Jan 2021, 19:23

Code: Select all

#include <amxmodx>
#include <dhudmessage>

#pragma tabsize 0

new my_data_2_store[3]

public plugin_init(){
	register_event ( "SendAudio", "t_win", "a", "2&%!MRAD_terwin" );
	register_event ( "SendAudio", "ct_win", "a", "2&%!MRAD_ctwin" );
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
	register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
	
	set_task(1.0,"CheckPlayers",.flags="b")
}
public eRestart()	arrayset(my_data_2_store,0,charsmax(my_data_2_store))
public event_new_round()	my_data_2_store[0]++
public t_win ( )	my_data_2_store [ 1 ] ++;
public ct_win ( )	my_data_2_store [ 2 ] ++;
public CheckPlayers ( ) {
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "Runda: %s%d", my_data_2_store[0]>9?"":"0",my_data_2_store[0] );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", my_data_2_store[1] > 9 ? "" : "0", my_data_2_store [ 1 ], my_data_2_store[2] > 9 ? "" : "0", my_data_2_store[2] );
}
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)
User avatar
vld.mihai
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 17 Jan 2015, 12:33
Detinator Steam: Da
CS Status: ASL.BLACKGAMES.RO
Detinator server CS: ASL.BLACKGAMES.RO
SteamID: vlad2795
Fond eXtream: 0
Location: Bacau
Has thanked: 3 times

10 Jan 2021, 19:51

L E V I N wrote:
10 Jan 2021, 19:23

Code: Select all

#include <amxmodx>
#include <dhudmessage>

#pragma tabsize 0

new my_data_2_store[3]

public plugin_init(){
	register_event ( "SendAudio", "t_win", "a", "2&%!MRAD_terwin" );
	register_event ( "SendAudio", "ct_win", "a", "2&%!MRAD_ctwin" );
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
	register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
	
	set_task(1.0,"CheckPlayers",.flags="b")
}
public eRestart()	arrayset(my_data_2_store,0,charsmax(my_data_2_store))
public event_new_round()	my_data_2_store[0]++
public t_win ( )	my_data_2_store [ 1 ] ++;
public ct_win ( )	my_data_2_store [ 2 ] ++;
public CheckPlayers ( ) {
	set_dhudmessage ( 51, 102, 153, -1.0, 0.06, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "Runda: %s%d", my_data_2_store[0]>9?"":"0",my_data_2_store[0] );
		
	set_dhudmessage ( 156, 255, 0, -1.0, 0.09, 1, 6.0, 3.0 );
	show_dhudmessage ( 0, "T: %s%d         -         CT: %s%d", my_data_2_store[1] > 9 ? "" : "0", my_data_2_store [ 1 ], my_data_2_store[2] > 9 ? "" : "0", my_data_2_store[2] );
}
MULTUMESC FRUMOS !
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

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