Raised This Month: $ Target: $400
 0% 

PLAY a .wav file to all users...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-24-2006 , 21:10   PLAY a .wav file to all users...
Reply With Quote #1

How would I do this...

sorry..im stupid..wish i had v3x's brain..or i wish i was a seamstress...hmmm..hard decision.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
M4Maniac
Member
Join Date: Aug 2005
Old 03-24-2006 , 21:16  
Reply With Quote #2

Im pretty sure you have to create a precatch plugin
M4Maniac is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-24-2006 , 21:17  
Reply With Quote #3

its called precache...and that is just so people download the sound
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-24-2006 , 21:26  
Reply With Quote #4

client_cmd( 0 , "spk path/to/my.wav")

path starts in sound directory so if the sound was in sound/misc/my.wav it would be spk misc/my.wav
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-24-2006 , 21:45  
Reply With Quote #5

So is this good?

Code:
#include <amxmodx>   #include <amxmisc>   #define PLUGIN "start_sound"   #define VERSION "0.1"   #define AUTHOR "SweatyBanana"   public plugin_init()   {       register_plugin(PLUGIN, VERSION, AUTHOR)       register_event("HLTV", "new_round", "a", "1=0", "2=0") }   public plugin_precache() {     precache_sound("begin_sound/begin_sound.wav")     return PLUGIN_CONTINUE }   public new_round()   {       client_cmd( 0 , "begin_sound/begin_sound.wav") }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-24-2006 , 21:57  
Reply With Quote #6

Code:
client_cmd( 0 , "speak begin_sound/begin_sound.wav")
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-24-2006 , 22:00  
Reply With Quote #7

I'd use play. Its better.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
VEN
Veteran Member
Join Date: Jan 2005
Old 03-25-2006 , 02:54  
Reply With Quote #8

What's the diff.?
VEN is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-25-2006 , 09:03  
Reply With Quote #9

doesnt work.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
graczu
Senior Member
Join Date: Mar 2006
Old 03-25-2006 , 12:21  
Reply With Quote #10

here have this my script:

Code:
#include <amxmod> 
#include <amxmisc>

public plugin_init(){ 
  register_plugin("Play added Sounds Managment","0.9.9","graczu") 
  register_concmd("amx_play","cmdPlay",ADMIN_CHAT,"- play sound: amx_play soundfilename from sound/misc/") 
  register_concmd("amx_playshow","cmdDzwieki",0,"- show list of added sounds") 

} 

public cmdPlay(id,level,cid){ 
  if (!cmd_access(id,level,cid,2)) 
    return PLUGIN_HANDLED 
  new message[192], name[32],authid[32],forma[128] 
  read_args(message,191) 
  remove_quotes(message) 
  get_user_authid(id,authid,31) 
  get_user_name(id,name,31) 
  format(forma, 127, "sound/misc/%s.wav", message) 
  if (file_exists(forma)){    
  client_cmd(0,"spk misc/%s.wav",message) 
  client_print(0,print_chat,"[Play: %s :  %s ]",name,message) 
  } else { 
  client_print(0,print_chat,"[Play: %s : %s - brak pliku ]",name,forma) 
} 
  return PLUGIN_HANDLED 

} 

public cmdDzwieki(id) { 
 new motdfile[64], motd[128] 
 new nextline=0 
 new txtlen 
 while((nextline = read_file("addons/amxmodx/configs/sound.txt",nextline,motdfile,63,txtlen))){ 
 format(motd, 127, "- amx_play %s", motdfile) 
 console_print(id,motd) 
 } 
} 

public plugin_precache() { 
 new soundfile[64], sound[128] 
 new nextline=0 
 new txtlen 
 while((nextline = read_file("addons/amxmodx/configs/sound.txt",nextline,soundfile,63,txtlen))){ 
 format(sound, 127, "misc/%s.wav", soundfile) 
 precache_sound(sound)    
 } 
}
insert sound files to upload and be able to play in:

addons/amxmodx/configs/sound.txt

just names of files without .wav

insert files in: sound/misc/ (serverside)

when game:

amx_play soundname << to play sound
amx_playshow to see files in sound.txt
graczu 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 16:45.


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