Raised This Month: $ Target: $400
 0% 

Debug help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 08-27-2005 , 16:47   Debug help
Reply With Quote #1

Noobie question, how would I debug this code?
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "MP3 EAZY-E" #define VERSION "1.0" #define AUTHOR "bizzybone" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)     register_concmd("amx_playwav","cmdPlaywav",ADMIN_KICK,"<file path>") } public plugin_precache() {     precache_sound("misc/bendover.wav")     precache_sound("misc/annoy.wav") }     public cmdPlaywav(id,level,cid) {     if (!cmd_access(id,level,cid,2)) {         return PLUGIN_HANDLED     }     new wav[32]     read_argv(1,wav,31)         client_cmd(0,"wav play sounds/misc/%s.wav",wav)                 return PLUGIN_HANDLED }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 08-27-2005 , 16:59   Re: Debug help
Reply With Quote #2

Quote:
Originally Posted by Kensai
How would I debug this code?
Start with telling us the problem
XunTric is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 08-27-2005 , 17:09  
Reply With Quote #3

I type in the command and get "Unknown Command: wav"
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Velocity36
Senior Member
Join Date: Jul 2005
Old 08-27-2005 , 17:21  
Reply With Quote #4

Maybe this..

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "MP3 EAZY-E" #define VERSION "1.0" #define AUTHOR "bizzybone" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)     register_concmd("amx_playwav","cmdPlaywav",ADMIN_KICK,"<file path>") } public plugin_precache() {     precache_sound("misc/bendover.wav")     precache_sound("misc/annoy.wav") } public cmdPlaywav(id,level,cid) {     if (!cmd_access(id,level,cid,1)) {         return PLUGIN_HANDLED     }         new wav[32]     read_argv(1,wav,31)         client_cmd(0,"wav play sounds/misc/%s.wav")         return PLUGIN_HANDLED }
__________________
[img]http://img81.**************/img81/593/velocityferrari7mx.jpg[/img]
Velocity36 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 17:22  
Reply With Quote #5

"wav" isn't a Half-Life command, try using this line to get it to play instead:

Code:
client_cmd(0,"spk ^"sounds/misc/%s.wav^"",wav)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 08-27-2005 , 17:25  
Reply With Quote #6

Ah, okay, thanks much. I'll test it out now.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 08-27-2005 , 17:48  
Reply With Quote #7

Well, I don't get the Unknown command error, but now it just doesn't do anything.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 18:36  
Reply With Quote #8

Oh, whoops, the spk command assumes you're already in the /sounds/ directory, so just make it /misc/%s.wav
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 08-27-2005 , 18:40  
Reply With Quote #9

Like so?

Code:
client_cmd(0,"misc/%s.wav^"",wav)

?????
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-27-2005 , 18:46  
Reply With Quote #10

I believe so, just make sure you precache all of the sounds you are going to use. (Which, is about everything for a free-arg command huh?, so I advise changing that.)
pdoubleopdawg is offline
Reply


Thread Tools
Display Modes

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 14:17.


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