Raised This Month: $ Target: $400
 0% 

Play sound to every player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-09-2011 , 07:42   Play sound to every player?
Reply With Quote #1

How can I make a sound play to every player?
KviZ is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 04-09-2011 , 08:04   Re: Play sound to every player?
Reply With Quote #2

Quote:
Originally Posted by KviZ View Post
How can I make a sound play to every player?
PHP Code:
cl_cmd(0"speak wakaka.wav"
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-09-2011 , 08:53   Re: Play sound to every player?
Reply With Quote #3

PHP Code:
client_cmd0"spk sound.wav" ); 
hornet is offline
Old 04-09-2011, 09:47
KviZ
This message has been deleted by KviZ.
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 04-09-2011 , 10:02   Re: Play sound to every player?
Reply With Quote #4

Doesn't work :/
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <ammopacks>
#include <fun>
#include <basebuilder>

new Time
new Repeat_Time 
new L_Effect
new L_EffectX

public plugin_init()
{
    
register_plugin("BB Lightning""1.0""KviZ")
    
Time register_cvar("BB_Lightning_Time""10")
    
set_task(1.0"Lightning",___"b"
    
set_task(0.1"Lightning_Effect",___"b")
}
public 
Lightning()
{    
    if(!
bb_is_build_phase())
    {
        
Repeat_Time += 1
        
if(Repeat_Time == get_pcvar_num(Time))
        {
            
L_Effect 1
            L_EffectX 
1
        
}
    }
}
public 
Lightning_Effect()
{
    if(
L_Effect == 1)
    {    
        if(
L_EffectX == 1)
        {
            
server_cmd("amx_setlight 6")
        }
        if(
L_EffectX == 2)
        {
            
server_cmd("amx_setlight 10")
        }
        if(
L_EffectX == 3)
        {
            
server_cmd("amx_setlight 16")
        }
        if(
L_EffectX == 4)
        {
            
server_cmd("amx_setlight 20")
        }
        if(
L_EffectX == 5)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 6)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 7)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 8)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 9)
        {
            
server_cmd("amx_setlight 20")
            
client_cmd0"spk ambience\thunder_clap.wav" )
        }
        if(
L_EffectX == 10)
        {
            
server_cmd("amx_setlight 16")
        }
        if(
L_EffectX == 11)
        {
            
server_cmd("amx_setlight 14")
        }
        if(
L_EffectX == 12)
        {
            
server_cmd("amx_setlight 11")
        }
        if(
L_EffectX == 13)
        {
            
server_cmd("amx_setlight 5")
        }
        if(
L_EffectX == 14)
        {
            
server_cmd("amx_setlight 2")
            
L_Effect 0
            Repeat_Time 
0
        
}
        
L_EffectX += 1
    
}

KviZ is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-09-2011 , 10:30   Re: Play sound to every player?
Reply With Quote #5

Quote:
Originally Posted by KviZ View Post
Doesn't work :/
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <ammopacks>
#include <fun>
#include <basebuilder>

new Time
new Repeat_Time 
new L_Effect
new L_EffectX

public plugin_init()
{
    
register_plugin("BB Lightning""1.0""KviZ")
    
Time register_cvar("BB_Lightning_Time""10")
    
set_task(1.0"Lightning",___"b"
    
set_task(0.1"Lightning_Effect",___"b")
}
public 
Lightning()
{    
    if(!
bb_is_build_phase())
    {
        
Repeat_Time += 1
        
if(Repeat_Time == get_pcvar_num(Time))
        {
            
L_Effect 1
            L_EffectX 
1
        
}
    }
}
public 
Lightning_Effect()
{
    if(
L_Effect == 1)
    {    
        if(
L_EffectX == 1)
        {
            
server_cmd("amx_setlight 6")
        }
        if(
L_EffectX == 2)
        {
            
server_cmd("amx_setlight 10")
        }
        if(
L_EffectX == 3)
        {
            
server_cmd("amx_setlight 16")
        }
        if(
L_EffectX == 4)
        {
            
server_cmd("amx_setlight 20")
        }
        if(
L_EffectX == 5)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 6)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 7)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 8)
        {
            
server_cmd("amx_setlight 24")
        }
        if(
L_EffectX == 9)
        {
            
server_cmd("amx_setlight 20")
            
client_cmd0"spk ambience\thunder_clap.wav" )
        }
        if(
L_EffectX == 10)
        {
            
server_cmd("amx_setlight 16")
        }
        if(
L_EffectX == 11)
        {
            
server_cmd("amx_setlight 14")
        }
        if(
L_EffectX == 12)
        {
            
server_cmd("amx_setlight 11")
        }
        if(
L_EffectX == 13)
        {
            
server_cmd("amx_setlight 5")
        }
        if(
L_EffectX == 14)
        {
            
server_cmd("amx_setlight 2")
            
L_Effect 0
            Repeat_Time 
0
        
}
        
L_EffectX += 1
    
}

You must precache your sound. Search how to do so.
matsi is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-09-2011 , 11:17   Re: Play sound to every player?
Reply With Quote #6

client_cmd( 0, "spk ambience\thunder_clap.wav" )

->

client_cmd( 0, "spk ambience/thunder_clap.wav" )

No need to precache for spk command (if sound is default sound).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-09-2011 , 13:18   Re: Play sound to every player?
Reply With Quote #7

Well is that default sound?
matsi is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-09-2011 , 13:32   Re: Play sound to every player?
Reply With Quote #8

Yes, it is the sound used in de_aztec.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-09-2011 , 14:46   Re: Play sound to every player?
Reply With Quote #9

You still need to precache it i think. Well you wont lose anything if you do it.
bibu is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 04-09-2011 , 16:13   Re: Play sound to every player?
Reply With Quote #10

Quote:
Originally Posted by bibu View Post
You still need to precache it i think. Well you wont lose anything if you do it.
No, you dont have to precache it. Do you even understand what precache does?
matsi 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 20:08.


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