I can't add sound

Въпроси и проблеми свързани с AMXModX.
Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 18 Авг 2020, 21:34

atmax написа: 18 Авг 2020, 21:28 You want that sound for everyone or for the player that received the gifts?..
*the results of the bonus - all players
*the end of the bonus - only player

Аватар
atmax
Извън линия
Потребител
Потребител
Мнения: 492
Регистриран на: 22 Мар 2018, 15:06
Се отблагодари: 37 пъти
Получена благодарност: 43 пъти

I can't add sound

Мнение от atmax » 18 Авг 2020, 21:56

Ohh... So you want when someone got those bonuses to play the sound for everyone and when it ends to play this sound only for that player.. 🙄
Rest in peace my friend I always will remember you! 🖤👊

Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 18 Авг 2020, 22:00

atmax написа: 18 Авг 2020, 21:56 Ohh... So you want when someone got those bonuses to play the sound for everyone and when it ends to play this sound only for that player.. 🙄
yes

Аватар
gadinkata
Извън линия
Потребител
Потребител
Мнения: 259
Регистриран на: 21 Мар 2018, 12:33
Местоположение: Враца
Се отблагодари: 25 пъти
Получена благодарност: 7 пъти
Обратна връзка:

I can't add sound

Мнение от gadinkata » 18 Авг 2020, 22:15

Testing??Test it!testuvaigo

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>

#define PREFIX "!y[!tHERO!y]"
#define NEADED_FRAGS 20
#define HERO_ROUNDS 3

#define HERO_HEALTH 130
#define HERO_SPEED 1500

new const g_szHeroFlag[] = "b";


new g_NextRoundHero[33]
new g_Frags[33]

public plugin_init() {
	register_plugin("Hero mode", "1.0", "Ds")
	register_clcmd("say /hero", "hero_command")
	register_clcmd("say_team /hero", "hero_command")

	register_clcmd("say /rs", "reset_frags")
	register_clcmd("say_team /rs", "reset_frags")

	RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1)
	RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled_Post", 1)
}

public client_putinserver(iPlayer) {
	g_NextRoundHero[iPlayer] = 0
	g_Frags[iPlayer] = 0
}

public reset_frags(iPlayer) {
	g_Frags[iPlayer] = 0
}

public hero_command(iPlayer) {
	if (g_Frags[iPlayer] >= NEADED_FRAGS) {
	        client_cmd(iPlayer,"spk buttons/blip2")
		ChatColor(iPlayer, "%s !yYou will become a Hero at the next spawn, for 3 rounds", PREFIX)

		g_Frags[iPlayer] -= NEADED_FRAGS
		g_NextRoundHero[iPlayer] = HERO_ROUNDS
	}
	else {
	        client_cmd(iPlayer,"spk buttons/blip1")
		ChatColor(iPlayer, "%s !yYou have %d frags, you need 20 frags to activate!", PREFIX, NEADED_FRAGS - g_Frags[iPlayer])
	}
}

public Ham_PlayerKilled_Post(iVictim, iAttacker)
{
	if (is_user_connected(iVictim) && is_user_connected(iAttacker)) {
		g_Frags[iAttacker] += 1
	}
}

public Ham_Spawn_Post(iPlayer) {
	if (g_NextRoundHero[iPlayer] > 0) {
		set_user_flags(iPlayer, read_flags(g_szHeroFlag));

		set_pev(iPlayer, pev_health, float(HERO_HEALTH))
		
		switch (cs_get_user_team(iPlayer))
		{
			case CS_TEAM_CT:fm_set_rendering(iPlayer, kRenderFxGlowShell, random_num(0, 100), random_num(50, 180), 255, kRenderNormal, 15)
			case CS_TEAM_T: fm_set_rendering(iPlayer, kRenderFxGlowShell, 255, random_num(0, 150), random_num(0, 200), kRenderNormal, 15)
		}

		g_NextRoundHero[iPlayer] -= 1
		client_cmd(0,"spk buttons/blip2")
	}
	else {
		// Remove glow
		remove_user_flags(iPlayer, read_flags(g_szHeroFlag));
    	        fm_set_rendering(iPlayer)
		client_cmd(iPlayer,"spk buttons/blip1")
	}
}

public plugin_precache()
{
precache_sound( "buttons/blip1.wav" );
precache_sound( "buttons/blip2.wav" );
}

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

	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color
	replace_all(msg, 190, "!t", "^3") // Team Color

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

Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 18 Авг 2020, 22:31

gadinkata написа: 18 Авг 2020, 22:15 Testing??Test it!testuvaigo

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>

#define PREFIX "!y[!tHERO!y]"
#define NEADED_FRAGS 20
#define HERO_ROUNDS 3

#define HERO_HEALTH 130
#define HERO_SPEED 1500

new const g_szHeroFlag[] = "b";


new g_NextRoundHero[33]
new g_Frags[33]

public plugin_init() {
	register_plugin("Hero mode", "1.0", "Ds")
	register_clcmd("say /hero", "hero_command")
	register_clcmd("say_team /hero", "hero_command")

	register_clcmd("say /rs", "reset_frags")
	register_clcmd("say_team /rs", "reset_frags")

	RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1)
	RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled_Post", 1)
}

public client_putinserver(iPlayer) {
	g_NextRoundHero[iPlayer] = 0
	g_Frags[iPlayer] = 0
}

public reset_frags(iPlayer) {
	g_Frags[iPlayer] = 0
}

public hero_command(iPlayer) {
	if (g_Frags[iPlayer] >= NEADED_FRAGS) {
	        client_cmd(iPlayer,"spk buttons/blip2")
		ChatColor(iPlayer, "%s !yYou will become a Hero at the next spawn, for 3 rounds", PREFIX)

		g_Frags[iPlayer] -= NEADED_FRAGS
		g_NextRoundHero[iPlayer] = HERO_ROUNDS
	}
	else {
	        client_cmd(iPlayer,"spk buttons/blip1")
		ChatColor(iPlayer, "%s !yYou have %d frags, you need 20 frags to activate!", PREFIX, NEADED_FRAGS - g_Frags[iPlayer])
	}
}

public Ham_PlayerKilled_Post(iVictim, iAttacker)
{
	if (is_user_connected(iVictim) && is_user_connected(iAttacker)) {
		g_Frags[iAttacker] += 1
	}
}

public Ham_Spawn_Post(iPlayer) {
	if (g_NextRoundHero[iPlayer] > 0) {
		set_user_flags(iPlayer, read_flags(g_szHeroFlag));

		set_pev(iPlayer, pev_health, float(HERO_HEALTH))
		
		switch (cs_get_user_team(iPlayer))
		{
			case CS_TEAM_CT:fm_set_rendering(iPlayer, kRenderFxGlowShell, random_num(0, 100), random_num(50, 180), 255, kRenderNormal, 15)
			case CS_TEAM_T: fm_set_rendering(iPlayer, kRenderFxGlowShell, 255, random_num(0, 150), random_num(0, 200), kRenderNormal, 15)
		}

		g_NextRoundHero[iPlayer] -= 1
		client_cmd(0,"spk buttons/blip2")
	}
	else {
		// Remove glow
		remove_user_flags(iPlayer, read_flags(g_szHeroFlag));
    	        fm_set_rendering(iPlayer)
		client_cmd(iPlayer,"spk buttons/blip1")
	}
}

public plugin_precache()
{
precache_sound( "buttons/blip1.wav" );
precache_sound( "buttons/blip2.wav" );
}

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

	replace_all(msg, 190, "!g", "^4") // Green Color
	replace_all(msg, 190, "!y", "^1") // Default Color
	replace_all(msg, 190, "!t", "^3") // Team Color

	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()
			}
		}
	}
}
each new spawn is a sound that the bonuses are activated and the bonuses are over, you only need 1 time when the bonuses were issued and 1 time when the bonuses ran out

Аватар
gadinkata
Извън линия
Потребител
Потребител
Мнения: 259
Регистриран на: 21 Мар 2018, 12:33
Местоположение: Враца
Се отблагодари: 25 пъти
Получена благодарност: 7 пъти
Обратна връзка:

I can't add sound

Мнение от gadinkata » 18 Авг 2020, 23:17

Do you want the sounds to be heard at each new round or at rebirth, when the bonuses are active and when they are deactivated?
Or do you want the sounds to be heard once a round or rebirth at the moment?

Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 18 Авг 2020, 23:19

gadinkata написа: 18 Авг 2020, 23:17 Do you want the sounds to be heard at each new round or at rebirth, when the bonuses are active and when they are deactivated?
Or do you want the sounds to be heard once a round or rebirth at the moment?
only when activated and deactivated during spawn, but now every spawn has a sound

Аватар
gadinkata
Извън линия
Потребител
Потребител
Мнения: 259
Регистриран на: 21 Мар 2018, 12:33
Местоположение: Враца
Се отблагодари: 25 пъти
Получена благодарност: 7 пъти
Обратна връзка:

I can't add sound

Мнение от gadinkata » 18 Авг 2020, 23:49

do you want this sound to be missing when you type say / hero?

Код за потвърждение: Избери целия код

client_cmd(iPlayer,"spk buttons/blip1")
ChatColor(iPlayer, "%s !yYou have %d frags, you need 20 frags to activate!", PREFIX, NEADED_FRAGS - g_Frags[iPlayer])
And you want 3 rounds while you have a bonus to hear a sound at each rebirth?

Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 19 Авг 2020, 00:13

gadinkata написа: 18 Авг 2020, 23:49 do you want this sound to be missing when you type say / hero?

Код за потвърждение: Избери целия код

client_cmd(iPlayer,"spk buttons/blip1")
ChatColor(iPlayer, "%s !yYou have %d frags, you need 20 frags to activate!", PREFIX, NEADED_FRAGS - g_Frags[iPlayer])
And you want 3 rounds while you have a bonus to hear a sound at each rebirth?
no, if I was given bonuses with /hero then once the sound is only, with other spawns there is no, and when the bonuses are over, then also one sound

Аватар
USA_CA
Извън линия
Foreigner
Foreigner
Мнения: 106
Регистриран на: 19 Юли 2020, 18:02

I can't add sound

Мнение от USA_CA » 19 Авг 2020, 00:20

now it happens like this: if I activated bonuses, the sound happens with each spawn until it ends and you need to do only the first spawn, as well as when deactivating bonuses

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Поддръжка / Помощ”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 8 госта