Raised This Month: $ Target: $400
 0% 

PLAY a .wav file to all users...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
graczu
Senior Member
Join Date: Mar 2006
Old 03-25-2006 , 12:21  
Reply With Quote #1

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