Raised This Month: $ Target: $400
 0% 

[Plugin] client_cmd won't play sound


Post New Thread Closed Thread   
 
Thread Tools Display Modes
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
Blue Snake.
Member
Join Date: May 2011
Location: Romania
Old 10-27-2011 , 08:08   Re: [Plugin] client_cmd won't play sound
#2

shouldn't it be sound/announce/first_blood.wav?

And why your array is [3][], you have only 1 element?
Blue Snake. is offline
SEnergyable
Junior Member
Join Date: Oct 2011
Old 10-27-2011 , 08:25   Re: [Plugin] client_cmd won't play sound
#3

no, I have server things in my NonSteam folder, and I'm connecting via steam CS (so it will download all components so I'll know if it works for other players too) and it's downloading to sound/announce/ folder

cuz I'll add more things later on
SEnergyable is offline
SEnergyable
Junior Member
Join Date: Oct 2011
Old 10-27-2011 , 11:18   Re: [Plugin] client_cmd won't play sound
#4

can someone help me?: )
SEnergyable is offline
SEnergyable
Junior Member
Join Date: Oct 2011
Old 10-27-2011 , 15:54   Re: [Plugin] client_cmd won't play sound
#5

holy shit, there are posts posted 1 hour ago and they have been already answered, uuuugh, nobody can help me or what?
SEnergyable is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 10-27-2011 , 15:58   Re: [Plugin] client_cmd won't play sound
#6

http://forums.alliedmods.net/misc.php?do=showrules
Quote:
Originally Posted by Global Rules
Posting
  • Do not "bump" your threads. Bumping is posting simply to make the thread higher in the forum sort order.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-27-2011 , 16:01   Re: [Plugin] client_cmd won't play sound
#7

Quote:
Originally Posted by SEnergyable View Post
holy shit, there are posts posted 1 hour ago and they have been already answered, uuuugh, nobody can help me or what?
Locked for 15 days, learn to be patient, use those days to read rules.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Closed Thread



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