Raised This Month: $ Target: $400
 0% 

[Plugin] client_cmd won't play sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SEnergyable
Junior Member
Join Date: Oct 2011
Old 10-27-2011 , 05:31   [Plugin] client_cmd won't play sound
#1

Hello,

I'm new in plugin scripting and I want to create plugin similiar to ultimate sounds but with custom sounds, messages and streaks, it works good but it won't play sound (it will download it AND it does show message)

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

#define AUTHOR "SEnergy!"
#define VERSION "1.00"
#define PLUGIN "Sounds"

new first_blood
//new kills[9]
//new streak

new sounds[3][] =
{
	"announce/first_blood"
}

new messages[3][] =
{
	"%s has First Blood!"
}

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	register_event("DeathMsg", "event_death", "a");
	register_event("ResetHUD", "reset_hud", "b");
	return PLUGIN_CONTINUE
}

public event_death(id)
{
	new killer = read_data(1)
	new victim = read_data(2)
	new vicname[32], killname[32]
	get_user_name(victim, vicname, 31)
	get_user_name(killer, killname, 31)
	if(first_blood)
	{
		set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
		show_hudmessage(0, messages[0], killname)
		client_cmd(0, "spk %s", sounds[0]);
		first_blood = 0
	}
	return PLUGIN_CONTINUE
}

public reset_hud(id) 
{
    first_blood = 1
}

public plugin_precache()
{
	precache_sound("announce/first_blood.wav")
        return PLUGIN_CONTINUE
}

Last edited by SEnergyable; 10-27-2011 at 11:18.
SEnergyable is offline
 



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 14:22.


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