Raised This Month: $51 Target: $400
 12% 

sound of falling/picking up a bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakonda001
Member
Join Date: Jul 2020
Old 07-04-2020 , 12:59   sound of falling/picking up a bomb
Reply With Quote #1

brothers, help me add the sounds of falling/picking up a bomb to this plugin

Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "C4 CD Voice"
#define VERSION "1.1"
#define AUTHOR "c4timer_by_dv-zone"

new g_C4Timer

new const g_szBombPlant[] = "%!MRAD_BOMBPL", g_szBombDefuse[] = "%!MRAD_BOMBDEF"
new g_szSound[16]

new const g_szDefusSounds[][] = {
	"C4Females/bombdef2.wav",
	"C4Females/bombdef2.wav",
	"C4Females/bombdef2.wav"
}

new const g_szPlantedSounds[][] = {
	"C4Females/111.wav",
	"C4Females/114.wav",
	"C4Females/115.wav"
}

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

	register_logevent("round_new", 2, "1=Round_Start")
	register_logevent("round_end", 2, "1=Round_End")
	register_logevent("round_end", 2, "1&Restart_Round_")
	register_logevent("round_end", 2, "1&Restart_Round_")

	register_message(get_user_msgid("SendAudio"),"msgSendAudio")
}

public msgSendAudio()
{
    get_msg_arg_string(2, g_szSound, charsmax(g_szSound))
    
    if(equali(g_szSound, g_szBombPlant) || equali(g_szSound, g_szBombDefuse))
        return PLUGIN_HANDLED

    return PLUGIN_CONTINUE
}

public bomb_defused(defuser)
{
	new rand = random_num(0, charsmax(g_szDefusSounds))
	client_cmd(0, "spk %s", g_szDefusSounds[rand])
}

public bomb_planted(id)
{
	new rand = random_num(0, charsmax(g_szPlantedSounds))
	client_cmd(0, "spk %s", g_szPlantedSounds[rand])

	g_C4Timer = get_cvar_num("mp_c4timer")
	set_task(1.0, "bomb_voice", 8038, "", 0, "b")
}

public round_new()
{
	g_C4Timer = -1
	remove_task(8038)
}

public round_end()
{
	g_C4Timer = -1
	remove_task(8038)
}

public bomb_voice()
{
	if (--g_C4Timer > 0)
	{
		switch(g_C4Timer)
		{
			case 1:client_cmd(0, "spk C4Females/one")
			case 2:client_cmd(0, "spk C4Females/two")
			case 3:client_cmd(0, "spk C4Females/three")
			case 4:client_cmd(0, "spk C4Females/four")
			case 5:client_cmd(0, "spk C4Females/five")
			case 6:client_cmd(0, "spk C4Females/six")
			case 7:client_cmd(0, "spk C4Females/seven")
			case 8:client_cmd(0, "spk C4Females/eight")
			case 9:client_cmd(0, "spk C4Females/nine")
			case 10:client_cmd(0, "spk C4Females/ten")
		}
	}else
		remove_task(8038)
}

public plugin_precache()
{
	for(new i = 0; i < sizeof(g_szDefusSounds); i++)
	{
		precache_sound(g_szDefusSounds[i])
	}

	for(new i = 0; i < sizeof(g_szPlantedSounds); i++)
	{
		precache_sound(g_szPlantedSounds[i])
	}

	precache_sound("C4Females/one.wav")
	precache_sound("C4Females/two.wav")
	precache_sound("C4Females/three.wav")
	precache_sound("C4Females/four.wav")
	precache_sound("C4Females/five.wav")
	precache_sound("C4Females/six.wav")
	precache_sound("C4Females/seven.wav")
	precache_sound("C4Females/eight.wav")
	precache_sound("C4Females/nine.wav")
	precache_sound("C4Females/ten.wav")
}
anakonda001 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode