AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Plugin] client_cmd won't play sound (https://forums.alliedmods.net/showthread.php?t=170614)

SEnergyable 10-27-2011 05:31

[Plugin] client_cmd won't play sound
 
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
}


Blue Snake. 10-27-2011 08:08

Re: [Plugin] client_cmd won't play sound
 
shouldn't it be sound/announce/first_blood.wav?

And why your array is [3][], you have only 1 element?

SEnergyable 10-27-2011 08:25

Re: [Plugin] client_cmd won't play sound
 
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 10-27-2011 11:18

Re: [Plugin] client_cmd won't play sound
 
can someone help me?: )

SEnergyable 10-27-2011 15:54

Re: [Plugin] client_cmd won't play sound
 
holy shit, there are posts posted 1 hour ago and they have been already answered, uuuugh, nobody can help me or what?

joshknifer 10-27-2011 15:58

Re: [Plugin] client_cmd won't play sound
 
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.


ConnorMcLeod 10-27-2011 16:01

Re: [Plugin] client_cmd won't play sound
 
Quote:

Originally Posted by SEnergyable (Post 1584454)
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.


All times are GMT -4. The time now is 14:22.

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