Роман

Остановка музыки на последнем раунде.

1 post in this topic

В начале раунда есть озвучка до заражения(10, 9, 8, 7, 6, 5, 4, 3, 2, 1).
Нужно сделать, чтобы на последнем раунде(раунд перед сменой карты) не воспроизводился вот этот отсчёт до заражения. Вот плагин.

#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>
#include <dhudmessage>

#define PLUGIN "winhud"
#define VERSION	"0.1"
#define AUTHOR "ELF"
#define INITIATE_LAST_ROUND_TASK 545454

new bool:g_lastround = false;
new g_winh , g_winz , count , g_roundhud

public plugin_init()
{
    register_cvar("lastround", "1");
    set_task(90.0, "initiateLastRound", INITIATE_LAST_ROUND_TASK, "", 0, "d");
	
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("HLTV", "event_roundstart", "a", "1=0", "2=0")

	set_task (1.0, "showhud",_,_,_, "b")

	g_roundhud = 1
}

public plugin_precache()
{
	precache_sound("time/1.wav")
	precache_sound("time/2.wav")
	precache_sound("time/3.wav")
	precache_sound("time/4.wav")
	precache_sound("time/5.wav")
	precache_sound("time/6.wav")
	precache_sound("time/7.wav")
	precache_sound("time/8.wav")
	precache_sound("time/9.wav")
	precache_sound("time/10.wav")
	precache_sound("time/start1.mp3")
	precache_sound("time/start2.mp3")
	precache_sound("time/start3.mp3")
}

public initiateLastRound() { // вот это попытался добавить я, но ничего не вышло.
	if (!get_cvar_num("lastround")) return PLUGIN_CONTINUE;

	remove_task(INITIATE_LAST_ROUND_TASK);

	g_lastround = true;
	client_cmd(0, "wav stop; stopsound")

	return PLUGIN_CONTINUE; 
}

public event_roundstart()
{
	set_task(9.0, "start_countdown", 1499)
	
	for (new i = 1; i <= get_maxplayers(); i++) 
	{
		if (!is_user_connected(i))
		{
			continue;
		}
		
		new snd = random_num(0, 2);
		
		if (snd == 0)
		{
			client_cmd(i,"mp3 play sound/time/start1.mp3")
		}
		else if (snd == 1)
		{
			client_cmd(i,"mp3 play sound/time/start2.mp3")
		}
		else if (snd == 2)
		{
			client_cmd(i,"mp3 play sound/time/start3.mp3")
		}
	}
	g_roundhud = g_winh + g_winz + 1
	count = 16
}

public start_countdown()
{
	remove_task(1499)
	remove_task(1500)
	set_task(1.0, "countdown", 1500)
}

public countdown()
{
	if(count == 0) 
	{
		set_dhudmessage(255, 0, 0, -1.0, 0.22, 0, 1.0, 1.0, 1.0, 1.0)
		show_dhudmessage(0, "Кто-то стал Ходячим Трупом!")
	}
	if(count > 0) 
	{
		set_dhudmessage(random_num(0,255),random_num(0, 255),random_num(0,255), -1.0, 0.22, 0, 0.5, 0.5, 0.5, 0.5)
		if(count < 11) client_cmd(0,"spk  time/%d", count) 
		show_dhudmessage(0, "/---------------------\^n|Заражение через %d|^n\---------------------/", count)
	}
	count = count - 1
	if(count >= 0) set_task(1.0, "countdown", 1500)
}

public showhud()
{
	set_dhudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, 0.0, 0, 6.0, 1.1, 0.0, 0.0)
	show_dhudmessage(0, "[РАУНД %d] ^n| Купи привилегию онлайн | ^n| Никажу |", g_roundhud)
}

public zp_round_ended(winteam)
{
	if(winteam == WIN_ZOMBIES)
	{
		g_winz += 1 
	}
	else
	{
		g_winh += 1
	}	
}

fn_get_humans()
{
	static iAlive, id
	iAlive = 0
	
	for (id = 1; id <= 32; id++)
	{
		if (is_user_alive(id) && !zp_get_user_zombie(id))
			iAlive++
	}
	
	return iAlive;
}

fn_get_zombies()
{
	static iAlive, id
	iAlive = 0
	
	for (id = 1; id <= 32; id++)
	{
		if (is_user_alive(id) && zp_get_user_zombie(id))
			iAlive++
	}
	
	return iAlive;
}

Что нужно изменить/добавить?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now