Raised This Month: $ Target: $400
 0% 

Play Sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-18-2007 , 09:16   Re: Play Sound
Reply With Quote #8

This is poorly optimized, here's a slightly better way:

Code:
#include <amxmodx> #define PLUGIN "TFC Sounds" #define VERSION "1.0" #define AUTHOR "Formula Zero" new g_Sound[] = "dir/sound.wav" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("say","say_handle") } public plugin_precache()     file_exists(g_Sound) ? precache_sound(g_Sound) : set_fail_state("Could not find sound file") public say_handle(id) {     static command[33]     read_argv(1,command,32)         if(equali(command,"omg",3))     {               client_cmd(0,"spk ^"%s^"",g_Sound)         return PLUGIN_HANDLED     }         return PLUGIN_CONTINUE }

Also, if you're planning on posting this, don't. It'll get unapproved (given one of the rules being not to post something that plays a sound when someone says something).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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