Modificare Plugin

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Sounds.
Membru, skill 0
Membru, skill 0
Posts: 40
Joined: 19 Dec 2015, 11:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

02 Apr 2023, 14:11

Buna ziua, as dorii si eu va rog sa ma ajutati cu urmatoru plugin:

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "CS Misc. Stats"
#define VERSION "1.9"
#define AUTHOR "www.extreamcs.ro"

#define server "extreamcs"

public KillingStreak
public KillingStreakSound
public KnifeKillSound
public HeadShotKillSound
public BombCountVoice
public BombDefusedSound
public BombExplodingSound

const SOUNDFILE_PATH_MAXLEN = 64
const SOUND_SHORTPATH_MAXLEN = SOUNDFILE_PATH_MAXLEN - 10
const TASK_BOMB_TIMER = 8038
new const _msound[] = "_msound"

new g_streakKills[MAX_PLAYERS + 1][2]
new g_multiKills[MAX_PLAYERS + 1][2]
new g_C4Timer
new g_Defusing
new g_roundCount
new g_friend[MAX_PLAYERS + 1]
new g_left_sync
new g_pcvar_mp_c4timer, g_c4timer_value
new g_connected[MAX_PLAYERS + 1]
new g_msounds[MAX_PLAYERS + 1]
new g_knifekillsound[SOUND_SHORTPATH_MAXLEN] = "misc/cshumiliation"
new g_hssound_killer[SOUND_SHORTPATH_MAXLEN] = "misc/csheadshot"
new g_bombdefusedsound[SOUND_SHORTPATH_MAXLEN] = "misc/csbombdefused"
new g_bombexplodingsound[SOUND_SHORTPATH_MAXLEN] = "misc/csbombexploding"

new g_Sounds[12][SOUND_SHORTPATH_MAXLEN] = 
{
	"misc/cstriplekill",
	"misc/csmultikill",
	"misc/csludicrouskill",
	"misc/csmegakill",
	"misc/csultrakill",
	"misc/csmonsterkill",
	"misc/cskillingspree",
	"misc/csrampage",
	"misc/csholyshit",
	"misc/csgodlike",
	"misc/csunstoppable",
	""
}

new g_KillingMsg[12][] =
{
	"%s: Triple Kill",
	"%s: Multi Kill",
	"%s: Ludicrous Kill",
	"%s: Mega Kill",
	"%s: Ultra Kill",
	"%s: Monster Kill",
	"%s: Killing Spree",
	"%s: Rampage",
	"%s: Holy Shit",
	"%s: God Like",
	"%s: Unstoppable",
	""
}

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_dictionary("statsx.txt")

	register_clcmd("say /msounds", "cmdSwitchSounds", 0, " - switches sounds on and off")
	register_clcmd("say_team /msounds", "cmdSwitchSounds", 0, " - switches sounds on and off")

	register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
	register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
	register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
	register_event("StatusValue", "setTeam", "bef", "1=1")

	new mapname[32]

	if((get_map_objectives() & MapObjective_Bomb) || (equali(mapname, "de_", 3) || equali(mapname, "csde_", 5)))
	{
		register_event("BarTime", "eStopDefuse", "b", "1=0")
	}

	g_left_sync = CreateHudSyncObj()
	g_pcvar_mp_c4timer = get_cvar_pointer("mp_c4timer")
	g_c4timer_value = get_pcvar_num(g_pcvar_mp_c4timer)
}

public plugin_precache()
{
	new szConfigsDir[64], szCfgFile[64]

	get_configsdir(szConfigsDir, charsmax(szConfigsDir))
	formatex(szCfgFile, charsmax(szCfgFile), "%s/stats.ini", szConfigsDir)

	new buffer[256]
	new fp = fopen(szCfgFile, "rt")

	if(fp)
	{
		new xvarname[32], xvarid

		while(!feof(fp))
		{
			fgets(fp, buffer, charsmax(buffer))
			trim(buffer)

			if(buffer[0] != ';')
			{
				parse(buffer, xvarname, charsmax(xvarname))

				if((xvarid = get_xvar_id(xvarname)) != -1)
				{
					set_xvar_num(xvarid, 1)
				}
			}
		}

		fclose(fp)
	}

	formatex(szCfgFile, charsmax(szCfgFile), "%s/miscstats.ini", szConfigsDir)
	fp = fopen(szCfgFile, "rt")

	if(fp)
	{
		new szSoundKey[32], szSoundFile[SOUNDFILE_PATH_MAXLEN]

		while(!feof(fp))
		{
			fgets(fp, buffer, charsmax(buffer))
			trim(buffer)

			if(buffer[0] != ';' && parse(buffer, szSoundKey, charsmax(szSoundKey), szSoundFile, charsmax(szSoundFile)) == 2)
			{
				if(equal(szSoundKey, "KnifeKillSound"))
				{
					copy_sound(g_knifekillsound, charsmax(g_knifekillsound), szSoundFile)
					if(KnifeKillSound) precache_sound_custom(g_knifekillsound)
				}
				else
				if(equal(szSoundKey, "HeadShotKillSoundKiller"))
				{
					copy_sound(g_hssound_killer, charsmax(g_hssound_killer), szSoundFile)
					if(HeadShotKillSound) precache_sound_custom(g_hssound_killer)
				}
				else
				if(equal(szSoundKey, "BombDefusedSound"))
				{
					copy_sound(g_bombdefusedsound, charsmax(g_bombdefusedsound), szSoundFile)
					if(BombDefusedSound) precache_sound_custom(g_bombdefusedsound)
				}
				else
				if(equal(szSoundKey, "BombExplodingSound"))
				{
					copy_sound(g_bombexplodingsound, charsmax(g_bombexplodingsound), szSoundFile)
					if(BombExplodingSound) precache_sound_custom(g_bombexplodingsound)
				}
				else
				{
					if(equal(szSoundKey, "TripleKillSound"))
					{
						copy_sound(g_Sounds[0], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[0])
					}
					else
					if(equal(szSoundKey, "MultiKillSound"))
					{
						copy_sound(g_Sounds[1], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[1])
					}
					else
					if(equal(szSoundKey, "LudicrousKillSound"))
					{
						copy_sound(g_Sounds[2], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[2])
					}
					else
					if(equal(szSoundKey, "MegaKillSound"))
					{
						copy_sound(g_Sounds[3], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[3])
					}
					else
					if(equal(szSoundKey, "UltraKillSound"))
					{
						copy_sound(g_Sounds[4], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[4])
					}
					else
					if(equal(szSoundKey, "MonsterKillSound"))
					{
						copy_sound(g_Sounds[5], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[5])
					}
					else
					if(equal(szSoundKey, "KillingSpreeSound"))
					{
						copy_sound(g_Sounds[6], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[6])
					}
					else
					if(equal(szSoundKey, "RampageSound"))
					{
						copy_sound(g_Sounds[7], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[7])
					}
					else
					if(equal(szSoundKey, "HolyShitSound"))
					{
						copy_sound(g_Sounds[8], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[8])
					}
					else
					if(equal(szSoundKey, "GodLikeSound"))
					{
						copy_sound(g_Sounds[9], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[9])
					}
					else
					if(equal(szSoundKey, "UnstoppableSound"))
					{
						copy_sound(g_Sounds[10], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[10])
					}
				}
			}
		}

		fclose(fp)
	}
}

precache_sound_custom(const sound[])
{
	new fullpathsound[SOUNDFILE_PATH_MAXLEN]
	formatex(fullpathsound, charsmax(fullpathsound), "sound/%s.wav", sound)

	if(file_exists(fullpathsound))
	{
		precache_sound(fullpathsound[6])
	}
	else
	{
		log_amx("WARNING: Could not locate <%s> file", fullpathsound)
	}
}

copy_sound(dest[], len, src[])
{
	new n = copy(dest, len, src[10 * equali(src, "sound/", 10)])

	if(n > 4 && equal(dest[n-4], ".wav"))
	{
		dest[n-4] = EOS
	}
}

public plugin_cfg()
{
	new g_addStast[] = "amx_statscfg add ^"%s^" %s"

	server_cmd(g_addStast, "ST_KILL_STR", "KillingStreak")
	server_cmd(g_addStast, "ST_KILL_STR_SOUND", "KillingStreakSound")
	server_cmd(g_addStast, "ST_KNIFE_KILL_SOUND", "KnifeKillSound")
	server_cmd(g_addStast, "ST_HS_KILL_SOUND", "HeadShotKillSound")
	server_cmd(g_addStast, "ST_BOMB_CD_VOICE", "BombCountVoice")
	server_cmd(g_addStast, "ST_BOMB_DEF_SUCC_SOUND", "BombDefusedSound")
	server_cmd(g_addStast, "ST_BOMB_EXPLODING_SOUND", "BombExplodingSound")
}

public client_connect(id)
{
	if(is_user_bot(id))
	{
		g_msounds[id] = 0
		return
	}

	new info[2]

	if(!get_user_info(id, _msound, info, charsmax(info)) || info[0] != '0')
	{
		g_msounds[id] = 1
	}
	else
	{
		g_msounds[id] = 0
	}
}

public client_putinserver(id)
{
	g_multiKills[id] = {0, 0}
	g_streakKills[id] = {0, 0}
	g_connected[id] = true
}

public client_disconnected(id)
{
	g_connected[id] = false
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	if(wpnindex == CSW_C4)
		return

	new headshot = (hitplace == HIT_HEAD) ? 1 : 0
	new selfkill = (killer == victim) ? 1 : 0

	if((KillingStreak || KillingStreakSound) && !TK)
	{
		g_streakKills[victim][1]++
		g_streakKills[victim][0] = 0

		if(!selfkill)
		{
			g_streakKills[killer][0]++
			g_streakKills[killer][1] = 0

			new a = g_streakKills[killer][0] - 3

			if((a > -1) && !(a % 2))
			{
				new name[MAX_NAME_LENGTH]
				get_user_name(killer, name, charsmax(name))

				if((a >>= 1) > 10)
					a = 11

				if(KillingStreak)
				{
					set_hudmessage(255, 255, 255, 0.05, 0.50, 2, 0.02, 6.0, 0.01, 0.1, -1)
					ShowSyncHudMsg(0, g_left_sync, g_KillingMsg[a], name)
				}

				if(KillingStreakSound)
				{
					play_sound(0, g_Sounds[a])
				}
			}
		}
	}

	if(wpnindex == CSW_KNIFE && (KnifeKillSound))
	{
		if(KnifeKillSound)
			play_sound(0, g_knifekillsound)
	}

	if(headshot && (HeadShotKillSound))
	{
		if(HeadShotKillSound)
		{
			if(victim != killer)
				play_sound(killer, g_hssound_killer)
		}
	}
}

public setTeam(id)
	g_friend[id] = read_data(2)

public Event_HLTV_New_Round()
{
	g_c4timer_value = get_pcvar_num(g_pcvar_mp_c4timer)
	++g_roundCount
	g_C4Timer = 0
}

public eRestart()
{
	eEndRound()
	g_roundCount = 0
}

public eEndRound()
{
	g_C4Timer = -2
	remove_task(TASK_BOMB_TIMER)
}

public checkKills(param[])
{
	new id = param[0]
	new a = param[1]

	if(a == g_multiKills[id][0])
	{
		a -= 3

		if(a > -1)
		{
			if(a > 10)
			{
				a = 11
			}
		}

		g_multiKills[id] = {0, 0}
	}
}

public bombTimer()
{
	if(--g_C4Timer > 0)
	{
		if(BombCountVoice)
		{
			if(g_C4Timer == 30 || g_C4Timer == 20)
			{
				new temp[64]

				num_to_word(g_C4Timer, temp, charsmax(temp))
				format(temp, charsmax(temp), "^"vox/%s seconds until explosion^"", temp)
				play_sound(0, temp)
			}
			else
			if(g_C4Timer < 11)
			{
				new temp[64]

				num_to_word(g_C4Timer, temp, charsmax(temp))
				format(temp, charsmax(temp), "^"vox/%s^"", temp)
				play_sound(0, temp)
			}
		}
	}
	else
		remove_task(TASK_BOMB_TIMER)
}

public eStopDefuse(id)
{
	if(id == g_Defusing)
	{
		g_Defusing = 0
	}
}

public bomb_planted(planter)
{
	g_Defusing = 0
	g_C4Timer = g_c4timer_value + 1
	bombTimer()
	set_task(1.0, "bombTimer", TASK_BOMB_TIMER, "", 0, "b")
}

public bomb_defused(defuser)
{
	if(BombDefusedSound)
		play_sound(0, g_bombdefusedsound)
}

public bomb_explode()
{
	if(BombExplodingSound)
		play_sound(0, g_bombexplodingsound)
}

play_sound(id, sound[])
{
	if(id)
	{
		if(g_msounds[id])
		{
			client_cmd(id, "spk %s", sound)
		}
	}
	else
	{
		new players[MAX_PLAYERS], pnum, id
		get_players(players, pnum, "ch")

		for(--pnum; pnum >= 0; pnum--)
		{
			id = players[pnum]

			if(g_connected[id] && g_msounds[id])
				client_cmd(id, "spk %s", sound)
		}
	}
}

public cmdSwitchSounds(id)
{
	g_msounds[id] = !g_msounds[id]

	color_chat(id, "^x04[%s]^x01 Misc Sounds:^x03 %s", server, g_msounds[id] ? "On" : "Off")

	set_user_info(id, _msound, g_msounds[id] ? "1" : "0")

	client_cmd(id, "setinfo %s %s", _msound, g_msounds[id] ? "1" : "0")
}

stock color_chat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, "^x01", "^1")
	replace_all(msg, 190, "^x03", "^3")
	replace_all(msg, 190, "^x04", "^4")

	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()
			}
		}
	}
}
Vreau ca la sv_restart 1 sau la game commencing, sa inceapa sunetele de la 0. Multumesc
RoyalServer
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3854
Joined: 24 Aug 2011, 12:24
Detinator Steam: Nu
CS Status:
Detinator server CS: ☯∴
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 595 times
Contact:

03 Apr 2023, 13:55

de ce modifci autorii plg pe care le folosești?

la fel și aici topic375049.html
Nu îmi mai trimiteți PM pe forum! Nu merge să răspund
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)
Sounds.
Membru, skill 0
Membru, skill 0
Posts: 40
Joined: 19 Dec 2015, 11:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

04 Apr 2023, 05:26

Si daca le modific, nu vad unde este problema, e un plugin folosit de mine personal, nu e comercializat, eu doar l am facut dupa bunu plac
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3854
Joined: 24 Aug 2011, 12:24
Detinator Steam: Nu
CS Status:
Detinator server CS: ☯∴
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 595 times
Contact:

04 Apr 2023, 13:57

e lipsă de respect față de autor, dacă autoru original nu făcea plg, tu nu l aveai, simplu
dacă l modifici nu înseamnă că tu ești autorul, nu l ai făcut de la 0
eu unu adaug o linie comentată dacă editez ceva
Nu îmi mai trimiteți PM pe forum! Nu merge să răspund
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
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

04 Apr 2023, 14:05

Daca tot te pui autor inseamna ca stii ce faci :), daca stii ce faci de ce faci cereri?

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "CS Misc. Stats"
#define VERSION "1.9"
#define AUTHOR "www.extreamcs.ro"

#define server "extreamcs"

public KillingStreak
public KillingStreakSound
public KnifeKillSound
public HeadShotKillSound
public BombCountVoice
public BombDefusedSound
public BombExplodingSound

const SOUNDFILE_PATH_MAXLEN = 64
const SOUND_SHORTPATH_MAXLEN = SOUNDFILE_PATH_MAXLEN - 10
const TASK_BOMB_TIMER = 8038
new const _msound[] = "_msound"

new g_streakKills[MAX_PLAYERS + 1][2]
new g_multiKills[MAX_PLAYERS + 1][2]
new g_C4Timer
new g_Defusing
new g_roundCount
new g_friend[MAX_PLAYERS + 1]
new g_left_sync
new g_pcvar_mp_c4timer, g_c4timer_value
new g_connected[MAX_PLAYERS + 1]
new g_msounds[MAX_PLAYERS + 1]
new g_knifekillsound[SOUND_SHORTPATH_MAXLEN] = "misc/cshumiliation"
new g_hssound_killer[SOUND_SHORTPATH_MAXLEN] = "misc/csheadshot"
new g_bombdefusedsound[SOUND_SHORTPATH_MAXLEN] = "misc/csbombdefused"
new g_bombexplodingsound[SOUND_SHORTPATH_MAXLEN] = "misc/csbombexploding"

new g_Sounds[12][SOUND_SHORTPATH_MAXLEN] = 
{
	"misc/cstriplekill",
	"misc/csmultikill",
	"misc/csludicrouskill",
	"misc/csmegakill",
	"misc/csultrakill",
	"misc/csmonsterkill",
	"misc/cskillingspree",
	"misc/csrampage",
	"misc/csholyshit",
	"misc/csgodlike",
	"misc/csunstoppable",
	""
}

new g_KillingMsg[12][] =
{
	"%s: Triple Kill",
	"%s: Multi Kill",
	"%s: Ludicrous Kill",
	"%s: Mega Kill",
	"%s: Ultra Kill",
	"%s: Monster Kill",
	"%s: Killing Spree",
	"%s: Rampage",
	"%s: Holy Shit",
	"%s: God Like",
	"%s: Unstoppable",
	""
}

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_dictionary("statsx.txt")

	register_clcmd("say /msounds", "cmdSwitchSounds", 0, " - switches sounds on and off")
	register_clcmd("say_team /msounds", "cmdSwitchSounds", 0, " - switches sounds on and off")

	register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
	register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
	register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
	register_event("StatusValue", "setTeam", "bef", "1=1")

	new mapname[32]

	if((get_map_objectives() & MapObjective_Bomb) || (equali(mapname, "de_", 3) || equali(mapname, "csde_", 5)))
	{
		register_event("BarTime", "eStopDefuse", "b", "1=0")
	}

	g_left_sync = CreateHudSyncObj()
	g_pcvar_mp_c4timer = get_cvar_pointer("mp_c4timer")
	g_c4timer_value = get_pcvar_num(g_pcvar_mp_c4timer)
}

public plugin_precache()
{
	new szConfigsDir[64], szCfgFile[64]

	get_configsdir(szConfigsDir, charsmax(szConfigsDir))
	formatex(szCfgFile, charsmax(szCfgFile), "%s/stats.ini", szConfigsDir)

	new buffer[256]
	new fp = fopen(szCfgFile, "rt")

	if(fp)
	{
		new xvarname[32], xvarid

		while(!feof(fp))
		{
			fgets(fp, buffer, charsmax(buffer))
			trim(buffer)

			if(buffer[0] != ';')
			{
				parse(buffer, xvarname, charsmax(xvarname))

				if((xvarid = get_xvar_id(xvarname)) != -1)
				{
					set_xvar_num(xvarid, 1)
				}
			}
		}

		fclose(fp)
	}

	formatex(szCfgFile, charsmax(szCfgFile), "%s/miscstats.ini", szConfigsDir)
	fp = fopen(szCfgFile, "rt")

	if(fp)
	{
		new szSoundKey[32], szSoundFile[SOUNDFILE_PATH_MAXLEN]

		while(!feof(fp))
		{
			fgets(fp, buffer, charsmax(buffer))
			trim(buffer)

			if(buffer[0] != ';' && parse(buffer, szSoundKey, charsmax(szSoundKey), szSoundFile, charsmax(szSoundFile)) == 2)
			{
				if(equal(szSoundKey, "KnifeKillSound"))
				{
					copy_sound(g_knifekillsound, charsmax(g_knifekillsound), szSoundFile)
					if(KnifeKillSound) precache_sound_custom(g_knifekillsound)
				}
				else
				if(equal(szSoundKey, "HeadShotKillSoundKiller"))
				{
					copy_sound(g_hssound_killer, charsmax(g_hssound_killer), szSoundFile)
					if(HeadShotKillSound) precache_sound_custom(g_hssound_killer)
				}
				else
				if(equal(szSoundKey, "BombDefusedSound"))
				{
					copy_sound(g_bombdefusedsound, charsmax(g_bombdefusedsound), szSoundFile)
					if(BombDefusedSound) precache_sound_custom(g_bombdefusedsound)
				}
				else
				if(equal(szSoundKey, "BombExplodingSound"))
				{
					copy_sound(g_bombexplodingsound, charsmax(g_bombexplodingsound), szSoundFile)
					if(BombExplodingSound) precache_sound_custom(g_bombexplodingsound)
				}
				else
				{
					if(equal(szSoundKey, "TripleKillSound"))
					{
						copy_sound(g_Sounds[0], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[0])
					}
					else
					if(equal(szSoundKey, "MultiKillSound"))
					{
						copy_sound(g_Sounds[1], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[1])
					}
					else
					if(equal(szSoundKey, "LudicrousKillSound"))
					{
						copy_sound(g_Sounds[2], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[2])
					}
					else
					if(equal(szSoundKey, "MegaKillSound"))
					{
						copy_sound(g_Sounds[3], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[3])
					}
					else
					if(equal(szSoundKey, "UltraKillSound"))
					{
						copy_sound(g_Sounds[4], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[4])
					}
					else
					if(equal(szSoundKey, "MonsterKillSound"))
					{
						copy_sound(g_Sounds[5], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[5])
					}
					else
					if(equal(szSoundKey, "KillingSpreeSound"))
					{
						copy_sound(g_Sounds[6], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[6])
					}
					else
					if(equal(szSoundKey, "RampageSound"))
					{
						copy_sound(g_Sounds[7], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[7])
					}
					else
					if(equal(szSoundKey, "HolyShitSound"))
					{
						copy_sound(g_Sounds[8], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[8])
					}
					else
					if(equal(szSoundKey, "GodLikeSound"))
					{
						copy_sound(g_Sounds[9], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[9])
					}
					else
					if(equal(szSoundKey, "UnstoppableSound"))
					{
						copy_sound(g_Sounds[10], charsmax(g_Sounds[]), szSoundFile)
						if(KillingStreakSound) precache_sound_custom(g_Sounds[10])
					}
				}
			}
		}

		fclose(fp)
	}
}

precache_sound_custom(const sound[])
{
	new fullpathsound[SOUNDFILE_PATH_MAXLEN]
	formatex(fullpathsound, charsmax(fullpathsound), "sound/%s.wav", sound)

	if(file_exists(fullpathsound))
	{
		precache_sound(fullpathsound[6])
	}
	else
	{
		log_amx("WARNING: Could not locate <%s> file", fullpathsound)
	}
}

copy_sound(dest[], len, src[])
{
	new n = copy(dest, len, src[10 * equali(src, "sound/", 10)])

	if(n > 4 && equal(dest[n-4], ".wav"))
	{
		dest[n-4] = EOS
	}
}

public plugin_cfg()
{
	new g_addStast[] = "amx_statscfg add ^"%s^" %s"

	server_cmd(g_addStast, "ST_KILL_STR", "KillingStreak")
	server_cmd(g_addStast, "ST_KILL_STR_SOUND", "KillingStreakSound")
	server_cmd(g_addStast, "ST_KNIFE_KILL_SOUND", "KnifeKillSound")
	server_cmd(g_addStast, "ST_HS_KILL_SOUND", "HeadShotKillSound")
	server_cmd(g_addStast, "ST_BOMB_CD_VOICE", "BombCountVoice")
	server_cmd(g_addStast, "ST_BOMB_DEF_SUCC_SOUND", "BombDefusedSound")
	server_cmd(g_addStast, "ST_BOMB_EXPLODING_SOUND", "BombExplodingSound")
}

public client_connect(id)
{
	if(is_user_bot(id))
	{
		g_msounds[id] = 0
		return
	}

	new info[2]

	if(!get_user_info(id, _msound, info, charsmax(info)) || info[0] != '0')
	{
		g_msounds[id] = 1
	}
	else
	{
		g_msounds[id] = 0
	}
}

public client_putinserver(id)
{
	g_multiKills[id] = {0, 0}
	g_streakKills[id] = {0, 0}
	g_connected[id] = true
}

public client_disconnected(id)
{
	g_connected[id] = false
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	if(wpnindex == CSW_C4)
		return

	new headshot = (hitplace == HIT_HEAD) ? 1 : 0
	new selfkill = (killer == victim) ? 1 : 0

	if((KillingStreak || KillingStreakSound) && !TK)
	{
		g_streakKills[victim][1]++
		g_streakKills[victim][0] = 0

		if(!selfkill)
		{
			g_streakKills[killer][0]++
			g_streakKills[killer][1] = 0

			new a = g_streakKills[killer][0] - 3

			if((a > -1) && !(a % 2))
			{
				new name[MAX_NAME_LENGTH]
				get_user_name(killer, name, charsmax(name))

				if((a >>= 1) > 10)
					a = 11

				if(KillingStreak)
				{
					set_hudmessage(255, 255, 255, 0.05, 0.50, 2, 0.02, 6.0, 0.01, 0.1, -1)
					ShowSyncHudMsg(0, g_left_sync, g_KillingMsg[a], name)
				}

				if(KillingStreakSound)
				{
					play_sound(0, g_Sounds[a])
				}
			}
		}
	}

	if(wpnindex == CSW_KNIFE && (KnifeKillSound))
	{
		if(KnifeKillSound)
			play_sound(0, g_knifekillsound)
	}

	if(headshot && (HeadShotKillSound))
	{
		if(HeadShotKillSound)
		{
			if(victim != killer)
				play_sound(killer, g_hssound_killer)
		}
	}
}

public setTeam(id)
	g_friend[id] = read_data(2)

public Event_HLTV_New_Round()
{
	g_c4timer_value = get_pcvar_num(g_pcvar_mp_c4timer)
	++g_roundCount
	g_C4Timer = 0
}

public eRestart()
{
	eEndRound()
	g_roundCount = 0

	for(new i; i < get_maxplayers(); i++)
	{
		g_multiKills[i] = {0, 0}
		g_streakKills[i] = {0, 0}
	}
}

public eEndRound()
{
	g_C4Timer = -2
	remove_task(TASK_BOMB_TIMER)
}

public checkKills(param[])
{
	new id = param[0]
	new a = param[1]

	if(a == g_multiKills[id][0])
	{
		a -= 3

		if(a > -1)
		{
			if(a > 10)
			{
				a = 11
			}
		}

		g_multiKills[id] = {0, 0}
	}
}

public bombTimer()
{
	if(--g_C4Timer > 0)
	{
		if(BombCountVoice)
		{
			if(g_C4Timer == 30 || g_C4Timer == 20)
			{
				new temp[64]

				num_to_word(g_C4Timer, temp, charsmax(temp))
				format(temp, charsmax(temp), "^"vox/%s seconds until explosion^"", temp)
				play_sound(0, temp)
			}
			else
			if(g_C4Timer < 11)
			{
				new temp[64]

				num_to_word(g_C4Timer, temp, charsmax(temp))
				format(temp, charsmax(temp), "^"vox/%s^"", temp)
				play_sound(0, temp)
			}
		}
	}
	else
		remove_task(TASK_BOMB_TIMER)
}

public eStopDefuse(id)
{
	if(id == g_Defusing)
	{
		g_Defusing = 0
	}
}

public bomb_planted(planter)
{
	g_Defusing = 0
	g_C4Timer = g_c4timer_value + 1
	bombTimer()
	set_task(1.0, "bombTimer", TASK_BOMB_TIMER, "", 0, "b")
}

public bomb_defused(defuser)
{
	if(BombDefusedSound)
		play_sound(0, g_bombdefusedsound)
}

public bomb_explode()
{
	if(BombExplodingSound)
		play_sound(0, g_bombexplodingsound)
}

play_sound(id, sound[])
{
	if(id)
	{
		if(g_msounds[id])
		{
			client_cmd(id, "spk %s", sound)
		}
	}
	else
	{
		new players[MAX_PLAYERS], pnum, id
		get_players(players, pnum, "ch")

		for(--pnum; pnum >= 0; pnum--)
		{
			id = players[pnum]

			if(g_connected[id] && g_msounds[id])
				client_cmd(id, "spk %s", sound)
		}
	}
}

public cmdSwitchSounds(id)
{
	g_msounds[id] = !g_msounds[id]

	color_chat(id, "^x04[%s]^x01 Misc Sounds:^x03 %s", server, g_msounds[id] ? "On" : "Off")

	set_user_info(id, _msound, g_msounds[id] ? "1" : "0")

	client_cmd(id, "setinfo %s %s", _msound, g_msounds[id] ? "1" : "0")
}

stock color_chat(const id, const input[], any:...)
{
	new count = 1, players[32]
	static msg[191]
	vformat(msg, 190, input, 3)

	replace_all(msg, 190, "^x01", "^1")
	replace_all(msg, 190, "^x03", "^3")
	replace_all(msg, 190, "^x04", "^4")

	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()
			}
		}
	}
}
Sounds.
Membru, skill 0
Membru, skill 0
Posts: 40
Joined: 19 Dec 2015, 11:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

04 Apr 2023, 20:35

Sunte ti romani adevarati voi, zici ca am facut crima ca am schimbat autoru sa nu fac reclama :) ce oameni, nu mai am nevoie de nimic, am sa rezolv singur, ca voi v a laudati ca stiti de toate, dar doar la tastatura, o seara buna
Last edited by levin on 05 Apr 2023, 13:25, edited 1 time in total.
Reason: nu s român să fiu sincer
lexz
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 922
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 73 times
Been thanked: 137 times

04 Apr 2023, 21:35

rezolva-ti singur daca esti in stare de ce vii si ceri aici?

ne punem autori da nu stim sa scriem corect
lexz
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 922
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 73 times
Been thanked: 137 times

04 Apr 2023, 21:36

rezolva-ti singur daca esti in stare de ce vii si ceri aici?

ne punem autori da nu stim sa scriem corect
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests