Raised This Month: $ Target: $400
 0% 

Sound not worked


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pewex
Senior Member
Join Date: Dec 2010
Location: AlliedMods
Old 01-04-2013 , 11:36   Sound not worked
Reply With Quote #1

Code:
#include <amxmodx>


    set_task(600.0,"PlaySound", 0)

new const yoursound1[] = "sound/misc/czs.wav" 
new const yoursound2[] = "sound/misc/czd.wav" 
new const yoursound3[] = "sound/misc/cze.wav" 

public plugin_precache() 
{ 
    precache_sound(yoursound1) 
    precache_sound(yoursound2) 
    precache_sound(yoursound3) 
} 

public plugin_init() 
{
    register_plugin("Press", "1.0.0", "")
    
    register_clcmd("+voicerecord", "PlaySound")
}

public PlaySound() 
{ 
switch(random_num(1, 3))
{
case 1:
{
    client_cmd(0, "spk ^"%s^"", yoursound1)
}
case 2:
{
    client_cmd(0, "spk ^"%s^"", yoursound2)
}
case 3:
{
    client_cmd(0, "spk ^"%s^"", yoursound3)
}
}

    return PLUGIN_HANDLED
}
Plugin not work well...

Please help

Last edited by pewex; 01-05-2013 at 09:19.
pewex is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-04-2013 , 11:39   Re: Sound not worked
Reply With Quote #2

Any errors?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 01-04-2013 , 11:44   Re: Sound not worked
Reply With Quote #3

PHP Code:
#include <amxmodx>


    
set_task(600.0,"PlaySound"0
->
PHP Code:
public plugin_init() 
{
    
register_plugin("Press""1.0.0""")
    
    
set_task600.0"PlaySound"54685465, .flags "b" )

Check if your sounds are in the good format too.
__________________
micapat is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-04-2013 , 16:54   Re: Sound not worked
Reply With Quote #4

PHP Code:
register_clcmd("+voicerecord""PlaySound"); 
You cann't hook Half Life In-Game Commands (command that starts with "+"), only not exist command
__________________
simanovich is offline
pewex
Senior Member
Join Date: Dec 2010
Location: AlliedMods
Old 01-04-2013 , 17:13   Re: Sound not worked
Reply With Quote #5

Quote:
Originally Posted by micapat View Post
PHP Code:
#include <amxmodx>


    
set_task(600.0,"PlaySound"0
->
PHP Code:
public plugin_init() 
{
    
register_plugin("Press""1.0.0""")
    
    
set_task600.0"PlaySound"54685465, .flags "b" )

Check if your sounds are in the good format too.

ps. my task:

Quote:
set_task( 52.0, "PlaySound", 54685465, .flags = "b" )

Last edited by pewex; 01-05-2013 at 09:20.
pewex is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-05-2013 , 06:53   Re: Sound not worked
Reply With Quote #6

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

new const g_songs_names[][] = {
    
"czs.wav",
    
"czd.wav",
    
"cze.wav"
}

public 
plugin_init() {
    
register_plugin("Press""1.0.0""pewex")
    
register_logevent"EventRoundStart"2"1=Round_Start" );
}

public 
plugin_precache() { 
    
precache_sound("misc/czs.wav"
    
precache_sound("misc/czd.wav"
    
precache_sound("misc/cze.wav"


public 
EventRoundStart() {
    
set_task(60.0,"PlaySound")
}

public 
PlaySound() {
    
client_cmd(0"spk misc/%s"g_songs_names[random(sizeof(g_songs_names))]);    

I set 60 secons instead 600.
600 seconds = 10 MIN. Max default round time is 9 min (without special hacks).
__________________
sorry my bad english...

Last edited by alonelive; 01-05-2013 at 06:59.
alonelive is offline
Reply


Thread Tools
Display Modes

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 13:39.


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