Raised This Month: $ Target: $400
 0% 

Play Sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Drak
Veteran Member
Join Date: Jul 2005
Old 02-17-2007 , 20:12   Re: Play Sound
Reply With Quote #2

Code:
#include <amxmodx> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("say","say_handle") } public say_handle(id) {     static command[33]     read_argv(1,command,32)         if(equali(command,"omg")) {         // Do the sound here         // Emit Sound way:         emit_sound(id,CHAN_AUTO,"my_sound.wav",1.0,ATTN_NORM,0,PITCH_NORM) //- Emits the sound from the player         // Play to all clients:         client_cmd(0,"spk dir_to_sound/mysound.wav")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
Simple enough, if you can understand that above code. It should work fine, just make sure you precache your sound(s) and ether emit or play the sound to the clients.
Drak is offline
Send a message via MSN to Drak
 



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 07:56.


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